From ce3e5ef190b5a7f53aa2bd39a9c3605565538d98 Mon Sep 17 00:00:00 2001 From: cristy Date: Sun, 12 May 2013 13:03:57 +0000 Subject: [PATCH] --- MagickCore/constitute.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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))) && -- 2.50.0