summaryrefslogtreecommitdiff
path: root/pngrtran.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-08-27 10:48:45 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-08-27 10:48:45 -0500
commit4554a54a6cc6099021242e8404f11c47c77de250 (patch)
tree5ae411ba253350ece5b9563eb6dbc0f3438ac8a0 /pngrtran.c
parent8c69d7bc631c9ff16eb4c3dde742d6fda06ff501 (diff)
downloadlibpng-4554a54a6cc6099021242e8404f11c47c77de250.tar.gz
[devel] Don't force 1, 2, and 4-bit depths to 8 when PNG_NO_16BIT is defined.
Diffstat (limited to 'pngrtran.c')
-rw-r--r--pngrtran.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pngrtran.c b/pngrtran.c
index 98b492d54..2dbdb50fa 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.5.0 [August 26, 2010]
+ * Last changed in libpng 1.5.0 [August 27, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1293,8 +1293,11 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
info_ptr->bit_depth = 8;
#else
/* Force chopping 16-bit input down to 8 */
- png_ptr->transformations |=PNG_16_TO_8;
- info_ptr->bit_depth = 8;
+ if (info_ptr->bit_depth == 16)
+ {
+ png_ptr->transformations |=PNG_16_TO_8;
+ info_ptr->bit_depth = 8;
+ }
#endif
#endif
@@ -2109,7 +2112,9 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
png_uint_32 i;
png_uint_32 row_width = row_info->width;
+#ifdef PNG_READ_16BIT_SUPPORTED
png_byte hi_filler = (png_byte)((filler>>8) & 0xff);
+#endif
png_byte lo_filler = (png_byte)(filler & 0xff);
png_debug(1, "in png_do_read_filler");