]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 14 Mar 2010 21:50:50 +0000 (21:50 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 14 Mar 2010 21:50:50 +0000 (21:50 +0000)
coders/tiff.c

index 807c127f58a0a18b9a98e1f713053ab06fd0f482..c4acc3d8123eaa8e8140fa72340bc20c35e8b2d3 100644 (file)
@@ -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)