From f3219f988547edd669cc24a1087a9abd24a8a834 Mon Sep 17 00:00:00 2001 From: cristy Date: Wed, 1 Oct 2014 20:06:07 +0000 Subject: [PATCH] --- MagickCore/pixel.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 8f9ce13ce..164d1db4c 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -6094,11 +6094,14 @@ MagickExport void SetPixelChannelMask(Image *image, PixelChannel channel=GetPixelChannelChannel(image,i); SetPixelChannelTraits(image,channel, GetChannelBit(channel_mask,channel) == 0 ? CopyPixelTrait : - image->alpha_trait != BlendPixelTrait || (channel == AlphaPixelChannel) ? - UpdatePixelTrait : (PixelTrait) (UpdatePixelTrait | image->alpha_trait)); + (image->alpha_trait == BlendPixelTrait) && + (channel != AlphaPixelChannel) ? (PixelTrait) + (UpdatePixelTrait | BlendPixelTrait) : UpdatePixelTrait); } if (image->storage_class == PseudoClass) SetPixelChannelTraits(image,IndexPixelChannel,CopyPixelTrait); + if (image->alpha_trait != BlendPixelTrait) + SetPixelChannelTraits(image,AlphaPixelChannel,image->alpha_trait); if (image->read_mask != MagickFalse) SetPixelChannelTraits(image,ReadMaskPixelChannel,CopyPixelTrait); if (image->write_mask != MagickFalse) -- 2.40.0