From: glennrp Date: Fri, 26 Nov 2010 20:43:35 +0000 (+0000) Subject: Fixed another case where the PNG encoder lost transparency. X-Git-Tag: 7.0.1-0~8454 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8eb57274a813fc3f2e2f96b166eb569f5e17aa26;p=imagemagick Fixed another case where the PNG encoder lost transparency. --- diff --git a/ChangeLog b/ChangeLog index 23ad29b0d..8c62c40e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-11-26 6.6.6-0 Glenn Randers-Pehrson + * 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 * 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). diff --git a/coders/png.c b/coders/png.c index f567c12e5..878a42143 100644 --- a/coders/png.c +++ b/coders/png.c @@ -113,7 +113,9 @@ #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