Page 1 of 1

[SOLVED] IM7 svn r8502: gif.c does not compile

Posted: 2012-06-26T12:08:11-07:00
by NicolasRobidoux
Latest ImageMagick 7 svn.

Code: Select all

sudo make uninstall && make clean && CFLAGS="-march=native -O2" CXXFLAGS="-march=native -O2" ./configure --enable-hdri && make && sudo make install
...
coders/gif.c: In function 'ReadGIFImage':
coders/gif.c:1337:11: warning: implicit declaration of function 'IsGrayPixel' [-Wimplicit-function-declaration]
...
MagickCore/.libs/libMagickCore.so: undefined reference to `IsGrayPixel'
collect2: ld returned 1 exit status
make[1]: *** [utilities/animate] Error 1
make[1]: Leaving directory `/home/nicolas/ImageMagick/ImageMagick'
make: *** [all] Error 2
It happened between r8485 and 8502:

Code: Select all

svn diff -r 8485:8501 coders/gif.c | more
Index: coders/gif.c
===================================================================
--- coders/gif.c	(revision 8485)
+++ coders/gif.c	(revision 8501)
@@ -1331,12 +1331,14 @@
         }
         colormap=(unsigned char *) RelinquishMagickMemory(colormap);
       }
-    for (i=0; i < (ssize_t) image->colors; i++)
-      if ((image->colormap[i].red != image->colormap[i].green) ||
-          (image->colormap[i].green != image->colormap[i].blue))
-        break;
-    if ((i == (ssize_t) image->colors) && (image->gamma == 1.0))
-      SetImageColorspace(image,GRAYColorspace,exception);
+    if (image->gamma == 1.0)
+      {
+        for (i=0; i < (ssize_t) image->colors; i++)
+          if (IsGrayPixel(image->colormap+i) == MagickFalse)
+            break;
+        (void) SetImageColorspace(image,i == (ssize_t) image->colors ? 
+          GRAYColorspace : RGBColorspace,exception);
+      }
     if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
       if (image->scene >= (image_info->scene+image_info->number_scenes-1))
         break;
Actually r8489 compiles just fine.

Re: [SOLVED]IM7 svn r8502: gif.c does not compile (fatal er

Posted: 2012-06-26T12:57:06-07:00
by NicolasRobidoux
r8503 contains the fix. (Thanks Cristy.)