diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2017-12-08 13:43:36 -0800 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2017-12-09 12:38:40 -0800 |
commit | 43a84c5d99d14881773b78b58892e9b049b938d9 (patch) | |
tree | 12620e252fc187fb83f4f3eb06a8ef725807615b /xps | |
parent | 4ee9656472805dc39a6ed3a8bd097dd04e497c19 (diff) | |
download | ghostpdl-43a84c5d99d14881773b78b58892e9b049b938d9.tar.gz |
Bug 698794 detect alpha data in PNG image
We were making the decision as to the presence/absence of
the alpha data in the PNG image a little early. There
was one more step related to png_set_tRNS_to_alpha
Diffstat (limited to 'xps')
-rw-r--r-- | xps/xpspng.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xps/xpspng.c b/xps/xpspng.c index dab9ac385..70bdbc66a 100644 --- a/xps/xpspng.c +++ b/xps/xpspng.c @@ -125,8 +125,13 @@ xps_png_has_alpha(xps_context_t *ctx, byte *rbuf, int rlen) /* * Read PNG header */ - png_read_info(png, info); + if (png_get_valid(png, info, PNG_INFO_tRNS)) + { + /* this will also expand the depth to 8-bits */ + png_set_tRNS_to_alpha(png); + } + png_read_update_info(png, info); switch (png_get_color_type(png, info)) { |