]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sat, 10 Mar 2018 00:57:17 +0000 (19:57 -0500)
committerCristy <urban-warrior@imagemagick.org>
Sat, 10 Mar 2018 00:57:17 +0000 (19:57 -0500)
coders/gray.c

index 439815e1293d0d4aae91a0ccc961045283769107..8d105ddebff173271a89fbf81b00200079d19877 100644 (file)
@@ -427,7 +427,7 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
                 break;
               for (x=0; x < (ssize_t) image->columns; x++)
               {
-                SetPixelRed(image,GetPixelRed(canvas_image,p),q);
+                SetPixelGray(image,GetPixelGray(canvas_image,p),q);
                 p+=GetPixelChannels(canvas_image);
                 q+=GetPixelChannels(image);
               }
@@ -445,120 +445,6 @@ static Image *ReadGRAYImage(const ImageInfo *image_info,
             if (status == MagickFalse)
               break;
           }
-        for (y=0; y < (ssize_t) image->extract_info.height; y++)
-        {
-          register const Quantum
-            *magick_restrict p;
-
-          register Quantum
-            *magick_restrict q;
-
-          register ssize_t
-            x;
-
-          if (count != (ssize_t) length)
-            {
-              ThrowFileException(exception,CorruptImageError,
-                "UnexpectedEndOfFile",image->filename);
-              break;
-            }
-          q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
-            exception);
-          if (q == (Quantum *) NULL)
-            break;
-          length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
-            quantum_info,GreenQuantum,pixels,exception);
-          if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
-            break;
-          if (((y-image->extract_info.y) >= 0) && 
-              ((y-image->extract_info.y) < (ssize_t) image->rows))
-            {
-              p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
-                canvas_image->columns,1,exception);
-              q=GetAuthenticPixels(image,0,y-image->extract_info.y,
-                image->columns,1,exception);
-              if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
-                break;
-              for (x=0; x < (ssize_t) image->columns; x++)
-              {
-                SetPixelGreen(image,GetPixelGreen(canvas_image,p),q);
-                p+=GetPixelChannels(canvas_image);
-                q+=GetPixelChannels(image);
-              }
-              if (SyncAuthenticPixels(image,exception) == MagickFalse)
-                break;
-           }
-          pixels=(const unsigned char *) ReadBlobStream(image,length,
-            GetQuantumPixels(quantum_info),&count);
-          if (count != (ssize_t) length)
-            break;
-        }
-        if (image->previous == (Image *) NULL)
-          {
-            status=SetImageProgress(image,LoadImageTag,2,6);
-            if (status == MagickFalse)
-              break;
-          }
-        for (y=0; y < (ssize_t) image->extract_info.height; y++)
-        {
-          register const Quantum
-            *magick_restrict p;
-
-          register Quantum
-            *magick_restrict q;
-
-          register ssize_t
-            x;
-
-          if (count != (ssize_t) length)
-            {
-              ThrowFileException(exception,CorruptImageError,
-                "UnexpectedEndOfFile",image->filename);
-              break;
-            }
-          q=GetAuthenticPixels(canvas_image,0,0,canvas_image->columns,1,
-            exception);
-          if (q == (Quantum *) NULL)
-            break;
-          length=ImportQuantumPixels(canvas_image,(CacheView *) NULL,
-            quantum_info,BlueQuantum,pixels,exception);
-          if (SyncAuthenticPixels(canvas_image,exception) == MagickFalse)
-            break;
-          if (((y-image->extract_info.y) >= 0) && 
-              ((y-image->extract_info.y) < (ssize_t) image->rows))
-            {
-              p=GetVirtualPixels(canvas_image,canvas_image->extract_info.x,0,
-                canvas_image->columns,1,exception);
-              q=GetAuthenticPixels(image,0,y-image->extract_info.y,
-                image->columns,1,exception);
-              if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
-                break;
-              for (x=0; x < (ssize_t) image->columns; x++)
-              {
-                SetPixelBlue(image,GetPixelBlue(canvas_image,p),q);
-                p+=GetPixelChannels(canvas_image);
-                q+=GetPixelChannels(image);
-              }
-              if (SyncAuthenticPixels(image,exception) == MagickFalse)
-                break;
-            }
-          pixels=(const unsigned char *) ReadBlobStream(image,length,
-            GetQuantumPixels(quantum_info),&count);
-          if (count != (ssize_t) length)
-            break;
-        }
-        if (image->previous == (Image *) NULL)
-          {
-            status=SetImageProgress(image,LoadImageTag,3,6);
-            if (status == MagickFalse)
-              break;
-          }
-        if (image->previous == (Image *) NULL)
-          {
-            status=SetImageProgress(image,LoadImageTag,4,6);
-            if (status == MagickFalse)
-              break;
-          }
         if (image->alpha_trait != UndefinedPixelTrait)
           {
             for (y=0; y < (ssize_t) image->extract_info.height; y++)