From: cristy Date: Wed, 29 Dec 2010 13:43:35 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~8340 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=667a892c591043922e152ad5d5f030e249841004;p=imagemagick --- diff --git a/ChangeLog b/ChangeLog index 1c81557f5..2b8378bb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * -posterize fails with more than 40 levels (reference http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17741). * Add support for the MacPaint image format. + * Eliminate spurios 'invalid colormap index' exception for 16-bit SGI images + (bug report by steven.sittser@fligh...). 2010-12-21 6.6.6-7 Glenn Randers-Pehrson * Use a clone instead of the main image in coders/png.c, so the image diff --git a/coders/sgi.c b/coders/sgi.c index e921aca03..b855c184c 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -263,10 +263,6 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) Image *image; - ssize_t - y, - z; - MagickBooleanType status; @@ -276,31 +272,31 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) register IndexPacket *indexes; + register PixelPacket + *q; + register ssize_t i, x; - register PixelPacket - *q; - register unsigned char *p; - ssize_t - count; - SGIInfo iris_info; size_t - bytes_per_pixel; + bytes_per_pixel, + quantum; + + ssize_t + count, + y, + z; unsigned char *iris_pixels; - size_t - quantum; - /* Open image file. */ @@ -367,7 +363,7 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) if (iris_info.depth < 3) { image->storage_class=PseudoClass; - image->colors=256; + image->colors=iris_info.bytes_per_pixel > 1 ? 65535 : 256; } if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) if (image->scene >= (image_info->scene+image_info->number_scenes-1)) @@ -423,6 +419,9 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) } else { + size_t + *runlength; + ssize_t offset, *offsets; @@ -433,9 +432,6 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) unsigned int data_order; - size_t - *runlength; - /* Read runlength-encoded image format. */ @@ -572,8 +568,8 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + y,image->rows); if (status == MagickFalse) break; } @@ -639,8 +635,8 @@ static Image *ReadSGIImage(const ImageInfo *image_info,ExceptionInfo *exception) break; if (image->previous == (Image *) NULL) { - status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y, - image->rows); + status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) + y,image->rows); if (status == MagickFalse) break; }