From 1883ec49dde1aa932dd75c115fd01a841848a216 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 7 Jun 2011 15:36:54 -0500 Subject: [PATCH] [legacy] Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, always expand to RGBA if transparency is present. --- ANNOUNCE | 2 ++ CHANGES | 2 ++ pngrtran.c | 3 +-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index ba2ff6f5..fb36db78 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -110,6 +110,8 @@ version 1.2.45beta01 [June 7, 2011] was introduced in libpng-1.2.20beta01. Check for up->location !PNG_AFTER_IDAT when writing unknown chunks before IDAT. + Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, + always expand to RGBA if transparency is present. (subscription required; visit https://lists.sourceforge.net/lists/listinfo/png-mng-implement diff --git a/CHANGES b/CHANGES index 545fe26f..00ec950b 100644 --- a/CHANGES +++ b/CHANGES @@ -2711,6 +2711,8 @@ version 1.2.45beta01 [June 7, 2011] was introduced in libpng-1.2.20beta01. Check for up->location !PNG_AFTER_IDAT when writing unknown chunks before IDAT. + Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image, + always expand to RGBA if transparency is present. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngrtran.c b/pngrtran.c index af1aa8e4..ca05fe95 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -1196,8 +1196,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) { if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { - if (png_ptr->num_trans && - (png_ptr->transformations & PNG_EXPAND_tRNS)) + if (png_ptr->num_trans) info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; else info_ptr->color_type = PNG_COLOR_TYPE_RGB;