[master] Port change to pngrtran.c from 1.5.3: when expanding a paletted image,
always expand to RGBA if transparency is present.
diff --git a/ANNOUNCE b/ANNOUNCE
index 0f26e17..6c14e83 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -34,6 +34,8 @@
was introduced in libpng-1.2.20beta01.
Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
before IDAT.
+ Port change to pngrtran.c from 1.5.3: when expanding a paletted image,
+ always expand to RGBA if transparency is present.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit
diff --git a/CHANGES b/CHANGES
index 5081935..e31ab4b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2802,6 +2802,8 @@
was introduced in libpng-1.2.20beta01.
Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
before IDAT.
+ Port change to pngrtran.c from 1.5.3: when expanding a paletted image,
+ always expand to RGBA if transparency is present.
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit
diff --git a/pngrtran.c b/pngrtran.c
index df4920c..4cd4d87 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1181,8 +1181,7 @@
{
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;