]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Fri, 17 May 2013 18:56:58 +0000 (18:56 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Fri, 17 May 2013 18:56:58 +0000 (18:56 +0000)
MagickCore/constitute.c
coders/miff.c

index 4587c2765fe872118faf02bf3cf613872fa4d140..12cababd542f0b53f61459c131ab8ad4dec24281 100644 (file)
@@ -1094,17 +1094,6 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info,
             image->endian=(*(char *) &lsb_first) == 1 ? LSBEndian : MSBEndian;
          }
     }
-  if (IsImageGray(image,exception) == MagickFalse)
-    {
-      /*
-        sRGB masquerading as a grayscale image?
-      */
-      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))) &&
index 76196b303fdf9cf6db75b0e64791f68e30292015..a47a01e669b427b2762b171066a9553df662be8a 100644 (file)
@@ -1956,6 +1956,17 @@ static MagickBooleanType WriteMIFFImage(const ImageInfo *image_info,
       (void) SetImageStorageClass(image,DirectClass,exception);
     image->depth=image->depth <= 8 ? 8UL : image->depth <= 16 ? 16UL :
       image->depth <= 32 ? 32UL : 64UL;
+    if (IsImageGray(image,exception) == MagickFalse)
+      {
+        /*
+          sRGB masquerading as a grayscale image?
+        */
+        if (IsGrayColorspace(image->colorspace) != MagickFalse)
+          (void) SetImageColorspace(image,sRGBColorspace,exception);
+      }
+    else
+      if (IsGrayColorspace(image->colorspace) == MagickFalse)
+        (void) SetImageColorspace(image,GRAYColorspace,exception);
     quantum_info=AcquireQuantumInfo(image_info,image);
     if (quantum_info == (QuantumInfo *) NULL)
       ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");