[devel] Imported from libpng-1.5.3beta11.tar
diff --git a/ANNOUNCE b/ANNOUNCE
index 213553e..161e53c 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -156,9 +156,11 @@
 
 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 96878fd..b073c4b 100644
--- a/libpng-manual.txt
+++ b/libpng-manual.txt
@@ -597,7 +597,7 @@
 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 @@
 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 ea935b2..57e4bb5 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1548,7 +1548,7 @@
 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 @@
 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