]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 12 May 2013 13:03:57 +0000 (13:03 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 12 May 2013 13:03:57 +0000 (13:03 +0000)
MagickCore/constitute.c

index 5079d8735f099d06ab036f2666697523a606987e..4587c2765fe872118faf02bf3cf613872fa4d140 100644 (file)
@@ -1094,14 +1094,17 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
             image->endian=(*(char *) &lsb_first) == 1 ? LSBEndian : MSBEndian;
          }
     }
-  if (IsGrayColorspace(image->colorspace) != MagickFalse)
+  if (IsImageGray(image,exception) == MagickFalse)
     {
       /*
         sRGB masquerading as a grayscale image?
       */
-      if (IsImageGray(image,exception) == MagickFalse)
+      if (IsGrayColorspace(image->colorspace) != MagickFalse)
         (void) SetImageColorspace(image,sRGBColorspace,exception);
     }
+  else
+    if (IsGrayColorspace(image->colorspace) == MagickFalse)
+      (void) SetImageColorspace(image,GRAYColorspace,exception);
   (void) SyncImageProfiles(image);
   option=GetImageOption(image_info,"delegate:bimodal");
   if ((IfMagickTrue(IsStringTrue(option))) &&