]> granicus.if.org Git - imagemagick/commitdiff
://github.com/ImageMagick/ImageMagick/issues/250
authorCristy <urban-warrior@imagemagick.org>
Sat, 13 Aug 2016 23:29:18 +0000 (19:29 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 13 Aug 2016 23:29:51 +0000 (19:29 -0400)
ChangeLog
MagickCore/channel.c

index 2b06786d9a64df9af3490c83f91da92f596af208..1586ae26c22a41b0eada06b02a532eb1c31ce9f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2016-08-07  7.0.2-8 Cristy  <quetzlzacatenango@image...>
   * Prevent spurious removal of MPC cache files (reference
     https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=30256).
+  * Note alpha channel when combining 4 or more images (reference
+    https://github.com/ImageMagick/ImageMagick/issues/250).
 
 2016-08-06  7.0.2-7 Cristy  <quetzlzacatenango@image...>
   * Release ImageMagick version 7.0.2-7, GIT revision 10980:ecc03a2:20160806.
index 1c64db9b3fec0e70700add485ba5fa019d73285e..38282e8d7860186dc4636211ad54579c74c71673 100644 (file)
@@ -507,8 +507,30 @@ MagickExport Image *CombineImages(const Image *image,
     (void) SetImageColorspace(combine_image,sRGBColorspace,exception);
   else
     (void) SetImageColorspace(combine_image,colorspace,exception);
-  if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
-    combine_image->alpha_trait=BlendPixelTrait;
+  switch (combine_image->colorspace)
+  {
+    case UndefinedColorspace:
+    case sRGBColorspace:
+    { 
+      if (GetImageListLength(image) > 3)
+        combine_image->alpha_trait=BlendPixelTrait;
+      break;
+    }
+    case GRAYColorspace:
+    {
+      if (GetImageListLength(image) > 1)
+        combine_image->alpha_trait=BlendPixelTrait;
+      break;
+    }
+    case CMYKColorspace:
+    { 
+      if (GetImageListLength(image) > 4)
+        combine_image->alpha_trait=BlendPixelTrait;
+      break;
+    }
+    default:
+      break;
+  }
   /*
     Combine images.
   */