From: cristy Date: Thu, 9 May 2013 12:28:16 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3692 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c669ac662c9459cc8d50204240a48734bd4daa99;p=imagemagick --- diff --git a/MagickCore/constitute.c b/MagickCore/constitute.c index b580e78a9..cafaeda65 100644 --- a/MagickCore/constitute.c +++ b/MagickCore/constitute.c @@ -46,6 +46,7 @@ #include "MagickCore/exception-private.h" #include "MagickCore/cache.h" #include "MagickCore/client.h" +#include "MagickCore/colorspace-private.h" #include "MagickCore/constitute.h" #include "MagickCore/constitute-private.h" #include "MagickCore/delegate.h" @@ -1092,6 +1093,14 @@ MagickExport MagickBooleanType WriteImage(const ImageInfo *image_info, image->endian=(*(char *) &lsb_first) == 1 ? LSBEndian : MSBEndian; } } + if (IsGrayColorspace(image->colorspace) != MagickFalse) + { + /* + sRGB masquerading as a grayscale image? + */ + if (IsGrayImage(image,&image->exception) == MagickFalse) + (void) SetImageColorspace(image,sRGBColorspace); + } (void) SyncImageProfiles(image); option=GetImageOption(image_info,"delegate:bimodal"); if ((IfMagickTrue(IsStringTrue(option))) &&