From: cristy Date: Sun, 12 May 2013 13:03:57 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3685 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce3e5ef190b5a7f53aa2bd39a9c3605565538d98;p=imagemagick --- diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index 5079d8735..4587c2765 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -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))) &&