From: cristy Date: Sun, 14 Mar 2010 21:50:50 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9801 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7e9059b99836cace470118ca917ee4a1d2ef3e1;p=imagemagick --- diff --git a/coders/tiff.c b/coders/tiff.c index 807c127f5..c4acc3d81 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1270,8 +1270,29 @@ static Image *ReadTIFFImage(const ImageInfo *image_info, q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); if (q == (PixelPacket *) NULL) break; - length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, - quantum_type,pixels,exception); + if (bits_per_sample != 8) + length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, + quantum_type,pixels,exception); + else + { + register const unsigned char + *restrict p; + + register long + x; + + p=pixels; + for (x=0; x < (long) image->columns; x++) + { + q->red=ScaleCharToQuantum(TIFFGetR(*p)); + q->green=ScaleCharToQuantum(TIFFGetG(*p)); + q->blue=ScaleCharToQuantum(TIFFGetB(*p)); + if (image->matte != MagickFalse) + q->opacity=(Quantum) ScaleCharToQuantum(TIFFGetA(*p)); + p++; + q++; + } + } if (SyncAuthenticPixels(image,exception) == MagickFalse) break; if (image->previous == (Image *) NULL)