]> granicus.if.org Git - imagemagick/commitdiff
Fixed another case where the PNG encoder lost transparency.
authorglennrp <glennrp@git.imagemagick.org>
Fri, 26 Nov 2010 20:43:35 +0000 (20:43 +0000)
committerglennrp <glennrp@git.imagemagick.org>
Fri, 26 Nov 2010 20:43:35 +0000 (20:43 +0000)
ChangeLog
coders/png.c

index 23ad29b0d4342608ccc453ddb019bc17ec80fe62..8c62c40e9c593d183435086965768a1a866fafb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-26  6.6.6-0 Glenn Randers-Pehrson <glennrp@image...>
+  * Fixed another case where the PNG encoder lost transparency (reference
+http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17516).
+
 2010-11-23  6.6.6-0 Cristy  <quetzlzacatenango@image...>
   * The policy.xml sets not-to-exceed resource values (e.g. policy memory limit
     1GB, -limit 2GB exceeds policy maximum so memory limit is 1GB).
index f567c12e5ad98d029fcacbe3a85faa0eb3771d24..878a42143fd3a09d8745956108aac21a0025af1a 100644 (file)
 #define MNG_COALESCE_LAYERS /* In 5.4.4, this interfered with MMAP'ed files. */
 #define MNG_INSERT_LAYERS   /* Troublesome, but seem to work as of 5.4.4 */
 #define PNG_BUILD_PALETTE   /* This works as of 5.4.3. */
+#if 0
 #define PNG_SORT_PALETTE    /* This works as of 5.4.0 but not in 6.5. */
+#endif
 #if defined(MAGICKCORE_JPEG_DELEGATE)
 #  define JNG_SUPPORTED /* Not finished as of 5.5.2.  See "To do" comments. */
 #endif
@@ -7373,7 +7375,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 #endif
 
 #if (MAGICKCORE_QUANTUM_DEPTH >= 16)
-  if (mng_info->write_png_colortype != 16)
+  if (image_depth == 16 && mng_info->write_png_colortype != 16)
     if (LosslessReduceDepthOK(image) != MagickFalse)
       image->depth = 8;
 #endif
@@ -7386,7 +7388,6 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
   image_matte=image->matte;
 
 #ifdef PNG_BUILD_PALETTE
-  
   if (((mng_info->write_png_colortype-1) == PNG_COLOR_TYPE_PALETTE) ||
       (mng_info->write_png_colortype == 0 && image->depth <= 8))
     {
@@ -7412,7 +7413,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info,
 #endif
 
   mng_info->IsPalette=image->storage_class == PseudoClass &&
-    image_colors <= 256 && !IsOpaqueImage(image,&image->exception);
+    image_colors <= 256;
 
   /*
     Allocate the PNG structures