fx.c doesn't compile ImageMagick-6.4.8-7

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
epo001

fx.c doesn't compile ImageMagick-6.4.8-7

Post by epo001 »

Make error lines

/bin/sh ./libtool --silent --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I./config -I./ltdl -I./ltdl -I/usr/X11/include/freetype2 -I/usr/X11/include -I/usr/X11R6/include -I/usr/include/libxml2 -g -O2 -Wall -W -D_THREAD_SAFE -c -o magick/magick_libMagickCore_la-fx.lo `test -f 'magick/fx.c' || echo './'`magick/fx.c
magick/fx.c: In function ‘ApplyEvaluateOperator’:
magick/fx.c:1197: error: invalid operands to binary %
make[1]: *** [magick/magick_libMagickCore_la-fx.lo] Error 1

My config invocation was
/configure --with-quantum-depth=16 --disable-dependency-tracking --with-x=yes --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib/ --without-perl --enable-hdri && make

Ed
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: fx.c doesn't compile ImageMagick-6.4.8-7

Post by magick »

Darn. That patch was applied moments before our release. Will have a new release within a day or two that fixes the problem. Thanks.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: fx.c doesn't compile ImageMagick-6.4.8-7

Post by anthony »

yes, I ran into that error myself when I added 'AddModulus' method to -evaluate.
I fixed it so it worked under Fedora, but obviously needed even more type handling.


Cristy... Your change of my original code has BROKEN the handling of a negative constant. This is an easy this to do, but does not generate the intended results.

For Example...

Code: Select all

  convert -size 10x200 gradient: -evaluate AddModulus -30% show:
is clipping the result as both '%' and/or fmod() will leave a negative result if the "value+constant" result is negative.

I'll patch and submit the change, switching from a 'truncated divisor' that % and fmod() uses to a 'floored divisor' method that will always return a positive value.
See Wikipedia, Modulo operation for more details of modulus handling with regards to sign.
ASIDE: This page has been very useful to me when dealing with cyclic values :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
MrLight

Re: fx.c doesn't compile ImageMagick-6.4.8-7

Post by MrLight »

I found out, that the Problem is THE

--> hdri

Without it, it compile without problems.
I use (MacPorts on Mac 10.5.6)

Mr Light
pS: My first Post here ...
Post Reply