From 0cb906d804e3cb4685e414610ccc1c82d756c7bf Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sat, 11 Jun 2011 14:22:22 -0500 Subject: [PATCH] [devel] Imported from libpng-1.5.3beta11.tar --- ANNOUNCE | 6 ++++-- libpng-manual.txt | 11 +++++++++-- libpng.3 | 11 +++++++++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 213553e88..161e53c37 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -156,9 +156,11 @@ Version 1.5.3rc02 [June 8, 2011] Version 1.5.3beta11 [June 11, 2011] Fixed png_handle_sCAL which is broken in 1.5; added sCAL to pngtest.png - Revised documentation about png_set_user_limits() to say that it can - only be used to reduce the defined limit, and that it also affects + Revised documentation about png_set_user_limits() to say that it also affects png writing. + Revised handling of png_set_user_limits() so that it can increase the + limit beyond the PNG_USER_WIDTH|HEIGHT_MAX; previously it could only + reduce it. Make the 16-to-8 scaling accurate. Dividing by 256 with no rounding is wrong (high by one) 25% of the time. Dividing by 257 with rounding is wrong in 128 out of 65536 cases. Getting the right answer all the time diff --git a/libpng-manual.txt b/libpng-manual.txt index 96878fd35..b073c4bd3 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -597,7 +597,7 @@ large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. Since very few applications really need to process such large images, we have imposed an arbitrary 1-million limit on rows and columns. Larger images will be rejected immediately with a png_error() call. If -you wish to reduce this limit, you can use +you wish to change this limit, you can use png_set_user_limits(png_ptr, width_max, height_max); @@ -4100,7 +4100,14 @@ Prior to libpng-1.5.3, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED option was off by default, and slightly inaccurate scaling occurred. This option can no longer be turned off, and 16-to-8 scaling is always accurate. This change will result in some different results while -reading 16-bit images, with some of the pixels no longer being off-by-one. +reading 16-bit images, with none of the pixels being off-by-one any +longer (see Clause 13.12 of the PNG specification). + +Prior to libpng-1.5.3, the png_set_user_limits() function could only be +used to reduce the width and height limits from the value of +PNG_USER_WIDTH_MAX and PNG_USER_HEIGHT_MAX, although this document said +that it could be used to override them. Now this function will reduce or +increase the limits. B. Changes to the build and configuration of libpng diff --git a/libpng.3 b/libpng.3 index ea935b27d..57e4bb5bd 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1548,7 +1548,7 @@ large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. Since very few applications really need to process such large images, we have imposed an arbitrary 1-million limit on rows and columns. Larger images will be rejected immediately with a png_error() call. If -you wish to reduce this limit, you can use +you wish to change this limit, you can use png_set_user_limits(png_ptr, width_max, height_max); @@ -5051,7 +5051,14 @@ Prior to libpng-1.5.3, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED option was off by default, and slightly inaccurate scaling occurred. This option can no longer be turned off, and 16-to-8 scaling is always accurate. This change will result in some different results while -reading 16-bit images, with some of the pixels no longer being off-by-one. +reading 16-bit images, with none of the pixels being off-by-one any +longer (see Clause 13.12 of the PNG specification). + +Prior to libpng-1.5.3, the png_set_user_limits() function could only be +used to reduce the width and height limits from the value of +PNG_USER_WIDTH_MAX and PNG_USER_HEIGHT_MAX, although this document said +that it could be used to override them. Now this function will reduce or +increase the limits. B. Changes to the build and configuration of libpng