From: cristy Date: Fri, 18 Oct 2013 12:06:13 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3212 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37a3fb9006eb8eb1e8a15c2911aa629fc894bdfb;p=imagemagick --- diff --git a/coders/miff.c b/coders/miff.c index 639dabe69..1ff33c019 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");