From: dirk Date: Sun, 4 Jan 2015 16:32:14 +0000 (+0000) Subject: QuantizeImage will change the colorspace when the number of requested colors is highe... X-Git-Tag: 7.0.1-0~1500 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd66cbe3ecb61270ac3a6f6298fca8e08d6ee4e9;p=imagemagick QuantizeImage will change the colorspace when the number of requested colors is higher than the number of colors in the image. --- diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index 42dc6e8ab..ab62ee3d2 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -2745,7 +2745,13 @@ MagickExport MagickBooleanType QuantizeImage(const QuantizeInfo *quantize_info, } if ((image->storage_class == PseudoClass) && (image->colors <= maximum_colors)) - return(MagickTrue); + { + if ((quantize_info->colorspace != UndefinedColorspace) && + (quantize_info->colorspace != CMYKColorspace)) + (void) TransformImageColorspace(image,quantize_info->colorspace, + exception); + return(MagickTrue); + } depth=quantize_info->tree_depth; if (depth == 0) {