Page 1 of 1

Equality operator in fx image

Posted: 2014-05-15T07:50:40-07:00
by Danack
Hi,

I think I've discovered a bug in the equality operator in the fx operator.

Code: Select all

    convert -size 256x256 "xc:pink" input1.jpg
    convert -size 256x256 "gradient:black-white" input2.jpg
    convert input1.jpg input2.jpg -fx "colorInt=int(256 * v.p{0,j}.lightness); pos = int(256 * i/w); (int(pos) >= int(120) && int(pos) <= int(120))" output1.png
    convert input1.jpg input2.jpg -fx "colorInt=int(256 * v.p{0,j}.lightness); pos = int(256 * i/w); int(pos) == int(120) " output2.png
In the above example the single equality operator "int(pos) == int(120)" should be equivalent to "(int(pos) >= int(120) && int(pos) <= int(120)" however the two output images are different.

output1.png appears correct - or at least what I expect:
Image

output2.png appears incorrect
Image

Re: Equality operator in fx image

Posted: 2014-05-15T08:27:40-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.9-2 Beta available by sometime tomorrow. Thanks.