Documentation Error on -fx
Posted: 2007-09-09T17:56:57-07:00
On your page http://www.imagemagick.org/script/fx.php, you state regarding the ternary operator:
x ? y : z: ternary conditional expression, returns value y if x > 0, otherwise z; only one ternary conditional permitted per statement
However this does not work. The statement reads that -fx will test to see if x is positive. I have tried using -fx "(abs(u-v) - .01)?v:u" and I always get v for the result. I consulted with Anthony Thyssen and he tells me to use -fx "(abs(u-v) > .01)?v:u". That is x must be a test, not a value!
I think you need to rephrase your discussion of the ternary condition in your documentation to make this more clear. Something like
x>0 ? y : z: ternary conditional expression, returns value y if x > 0, otherwise z; only one ternary conditional permitted per statement
Thanks.
Fred Weinhaus
x ? y : z: ternary conditional expression, returns value y if x > 0, otherwise z; only one ternary conditional permitted per statement
However this does not work. The statement reads that -fx will test to see if x is positive. I have tried using -fx "(abs(u-v) - .01)?v:u" and I always get v for the result. I consulted with Anthony Thyssen and he tells me to use -fx "(abs(u-v) > .01)?v:u". That is x must be a test, not a value!
I think you need to rephrase your discussion of the ternary condition in your documentation to make this more clear. Something like
x>0 ? y : z: ternary conditional expression, returns value y if x > 0, otherwise z; only one ternary conditional permitted per statement
Thanks.
Fred Weinhaus