From: dirk Date: Mon, 12 Oct 2015 09:37:29 +0000 (+0200) Subject: Fixed modification of the alpha channel for associate and disassociate. X-Git-Tag: 7.0.1-0~565^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9414e1527720e525cdd677d08080eb134e9ab94;p=imagemagick Fixed modification of the alpha channel for associate and disassociate. --- diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 72df89bda..5e352089d 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -982,8 +982,7 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, for (x=0; x < (ssize_t) image->columns; x++) { double - gamma, - Sa; + gamma; register ssize_t i; @@ -993,11 +992,12 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, q+=GetPixelChannels(image); continue; } - Sa=QuantumScale*GetPixelAlpha(image,q); - gamma=Sa; + gamma=QuantumScale*GetPixelAlpha(image,q); for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel=GetPixelChannelChannel(image,i); + if (channel == AlphaPixelChannel) + continue; PixelTrait traits=GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue; @@ -1130,6 +1130,8 @@ MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, for (i=0; i < (ssize_t) GetPixelChannels(image); i++) { PixelChannel channel=GetPixelChannelChannel(image,i); + if (channel == AlphaPixelChannel) + continue; PixelTrait traits=GetPixelChannelTraits(image,channel); if ((traits & UpdatePixelTrait) == 0) continue;