From: dirk Date: Wed, 15 Oct 2014 16:28:15 +0000 (+0000) Subject: Fixed CMYK issue in SetImageBackgroundColor. X-Git-Tag: 7.0.1-0~1886 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc896c168ef8ea953097eac619069b197f46c6de;p=imagemagick Fixed CMYK issue in SetImageBackgroundColor. --- diff --git a/MagickCore/image.c b/MagickCore/image.c index 50d2c3fe3..daf68fe0d 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -2065,6 +2065,9 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, MagickBooleanType status; + PixelInfo + background; + ssize_t y; @@ -2080,6 +2083,9 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, if ((image->background_color.alpha_trait == BlendPixelTrait) && (image->alpha_trait != BlendPixelTrait)) (void) SetImageAlpha(image,OpaqueAlpha,exception); + background=image->background_color; + if (image->colorspace == CMYKColorspace) + ConvertRGBToCMYK(&background); /* Set image background color. */ @@ -2103,7 +2109,7 @@ MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - SetPixelInfoPixel(image,&image->background_color,q); + SetPixelInfoPixel(image,&background,q); q+=GetPixelChannels(image); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)