List Info

Thread: Should ReadGIFImage() call DecodeImage() when pinged?




Should ReadGIFImage() call DecodeImage() when pinged?
user name
2007-01-23 13:04:05
Hi, thanks for writing the excellent library ImageMagick, it's very useful. I had a question about the gif coder, specifically whether or not ReadGIFImage() should call DecodeImage() when an image is pinged via PingImage(). From what I can tell, DecodeImage reads the pixels out of the image using GetImagePixels() and saves them to the pixel cache using SyncImagePixels(). If my understanding is correct, it seems appropriate to skip this step when the image is pinged. Here's a diff to gif.c in 6.3.1 that would only call DecodeImage when the image is read (i.e. not when pinged). If my understanding about when DecodeImage() should be called is incorrect, please let me know. Otherwise, let me know if this change looks acceptable. --Mark --- coders/gif.c 8 Jan 2007 17:23:20 -0000 1.1.1.1 +++ coders/gif.c 23 Jan 2007 18:58:06 -0000 -1218,13 +1218,17 static Image *ReadGIFImage(const ImageIn /* Decode image. */ + if (image_info->ping == MagickFalse) + { status=DecodeImage(image,(Quantum) opacity); - if ((image_info->ping == MagickFalse) && (status == MagickFalse)) + + if (status == MagickFalse) { global_colormap=(unsigned char *) RelinquishMagickMemory( global_colormap); ThrowReaderException(CorruptImageError,"CorruptImage"); } + } if (image_info->number_scenes != 0) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) break; _______________________________________________ Magick-developers mailing list Magick-developersimagemagick.org http://studio.imagemagick.org/mailman/listinfo/magick-developers
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )