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

index b580e78a97dd79552a252446b463bf3c6ad8b99f..cafaeda65762f19aa96137f5071e72bd1822e788 100644 (file)
@@ -46,6 +46,7 @@
 #include "MagickCore/exception-private.h"
 #include "MagickCore/cache.h"
 #include "MagickCore/client.h"
+#include "MagickCore/colorspace-private.h"
 #include "MagickCore/constitute.h"
 #include "MagickCore/constitute-private.h"
 #include "MagickCore/delegate.h"
@@ -1092,6 +1093,14 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
             image->endian=(*(char *) &lsb_first) == 1 ? LSBEndian : MSBEndian;
          }
     }
+  if (IsGrayColorspace(image->colorspace) != MagickFalse)
+    {
+      /*
+        sRGB masquerading as a grayscale image?
+      */
+      if (IsGrayImage(image,&image->exception) == MagickFalse)
+        (void) SetImageColorspace(image,sRGBColorspace);
+    }
   (void) SyncImageProfiles(image);
   option=GetImageOption(image_info,"delegate:bimodal");
   if ((IfMagickTrue(IsStringTrue(option))) &&