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
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;