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

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
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

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

Post 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.
Last edited by NicolasRobidoux on 2012-06-26T13:02:15-07:00, edited 1 time in total.
NicolasRobidoux
Posts: 1944
Joined: 2010-08-28T11:16:00-07:00
Authentication code: 8675308
Location: Montreal, Canada

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

Post by NicolasRobidoux »

r8503 contains the fix. (Thanks Cristy.)
Post Reply