]> granicus.if.org Git - imagemagick/commitdiff
Don't composite alpha channel for -channel RGB
authorCristy <urban-warrior@imagemagick.org>
Sat, 25 Aug 2018 21:10:29 +0000 (17:10 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 25 Aug 2018 21:10:29 +0000 (17:10 -0400)
MagickCore/composite.c

index 037e40e1538863917cd7a984d1353c1c08830f58..4875e245526261b32261f403292d7d096e33a0a3 100644 (file)
@@ -1513,10 +1513,11 @@ MagickExport MagickBooleanType CompositeImage(Image *image,
 
         PixelChannel channel = GetPixelChannelChannel(image,i);
         PixelTrait traits = GetPixelChannelTraits(image,channel);
-        PixelTrait source_traits=GetPixelChannelTraits(source_image,channel);
+        PixelTrait source_traits = GetPixelChannelTraits(source_image,channel);
         if (traits == UndefinedPixelTrait)
           continue;
-        if (channel == AlphaPixelChannel)
+        if ((channel == AlphaPixelChannel) &&
+            ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0))
           {
             /*
               Set alpha channel.