From efe4e5d10d3afc5983cdd7733f8d38f855ed3f9b Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 23 Sep 2015 22:08:04 -0500 Subject: [libpng16] Reverted the fix of byte order in png_do_read_filler() with 16-bit input that was made in version 1.6.17beta01, to preserve legacy behavior even though it was incorrect. Instead, added new API png_set_filter_16() and png_set_add_alpha_16() that set a flag to make png_do_read_filter() interpret the filler bytes properly. --- example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example.c') diff --git a/example.c b/example.c index 0a241413b..902b6c584 100644 --- a/example.c +++ b/example.c @@ -522,7 +522,7 @@ void read_png(FILE *fp, int sig_read) /* File is already open */ png_set_swap(png_ptr); /* Add filler (or alpha) byte (before/after each RGB triplet) */ - png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); + png_set_filler_16(png_ptr, 0xffff, PNG_FILLER_AFTER); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Turn on interlace handling. REQUIRED if you are not using @@ -958,7 +958,7 @@ void write_png(char *file_name /* , ... other image information ... */) /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels). The second parameter is not used. */ - png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); + png_set_filler_16(png_ptr, 0, PNG_FILLER_BEFORE); /* Flip BGR pixels to RGB */ png_set_bgr(png_ptr); -- cgit v1.2.1