From: cristy Date: Fri, 17 May 2013 18:56:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3670 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e0705bd050c958606cbf330804460aae9e7c2e4;p=imagemagick --- diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index 4587c2765..12cababd5 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -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))) && diff --git a/coders/miff.c b/coders/miff.c index 76196b303..a47a01e66 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -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");