From: cristy Date: Mon, 1 Apr 2013 00:30:14 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3972 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=322f6355487e3da8d0275e57383505e819224728;p=imagemagick --- diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 9da853fc1..005910392 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -325,6 +325,9 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image, assert(clut_image->signature == MagickSignature); if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse) return(MagickFalse); + if ((IsGrayColorspace(image->colorspace) != MagickFalse) && + (IsGrayColorspace(clut_image->colorspace) == MagickFalse)) + (void) TransformImageColorspace(image,sRGBColorspace,exception); clut_map=(PixelInfo *) AcquireQuantumMemory(MaxMap+1UL,sizeof(*clut_map)); if (clut_map == (PixelInfo *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",