[devel] Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED.
This allows the functions
to read and write ints to be disabled independently of PNG_USE_READ_MACROS,
which allows libpng to be built with the functions even though the default
is to use the macros - this allows applications to choose at app build
time whether or not to use macros (previously impossible because the
functions weren't in the default build.)
diff --git a/ANNOUNCE b/ANNOUNCE
index 8f8aeb0..0b6b464 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
-Libpng 1.5.0beta19 - April 18, 2010
+Libpng 1.5.0beta19 - April 24, 2010
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@@ -162,7 +162,7 @@
Removed the xcode project because it has not been updated to work
with libpng-1.5.0.
-version 1.5.0beta18 [April 18, 2010]
+version 1.5.0beta18 [April 17, 2010]
Restored the ability to include optional pngusr.h
Moved replacements for png_error() and png_warning() from the
contrib/pngminim project to pngerror.c, for use when warnings or
@@ -171,7 +171,13 @@
Updated contrib/pngminim project to work with the new pnglibconf.h
Added some PNG_NO_* defines to contrib/pngminim/*/pngusr.h to save space.
-version 1.5.0beta19 [April 18, 2010]
+version 1.5.0beta19 [April 24, 2010]
+ Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED. This allows the functions
+ to read and write ints to be disabled independently of PNG_USE_READ_MACROS,
+ which allows libpng to be built with the functions even though the default
+ is to use the macros - this allows applications to choose at app build
+ time whether or not to use macros (previously impossible because the
+ functions weren't in the default build.)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
diff --git a/CHANGES b/CHANGES
index 8708736..7be4c88 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2653,7 +2653,13 @@
Updated contrib/pngminim project to work with the new pnglibconf.h
Added some PNG_NO_* defines to contrib/pngminim/*/pngusr.h to save space.
-version 1.5.0beta19 [April 18, 2010]
+version 1.5.0beta19 [April 24, 2010]
+ Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED. This allows the functions
+ to read and write ints to be disabled independently of PNG_USE_READ_MACROS,
+ which allows libpng to be built with the functions even though the default
+ is to use the macros - this allows applications to choose at app build
+ time whether or not to use macros (previously impossible because the
+ functions weren't in the default build.)
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
diff --git a/png.h b/png.h
index 2c74a2a..d9d3bc2 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.5.0beta19 - April 18, 2010
+ * libpng version 1.5.0beta19 - April 24, 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.)
@@ -11,7 +11,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- * libpng versions 0.97, January 1998, through 1.5.0beta19 - April 18, 2010: Glenn
+ * libpng versions 0.97, January 1998, through 1.5.0beta19 - April 24, 2010: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -170,7 +170,7 @@
*
* This code is released under the libpng license.
*
- * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta19, April 18, 2010, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.5.0beta19, April 24, 2010, are
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@@ -282,7 +282,7 @@
* Y2K compliance in libpng:
* =========================
*
- * April 18, 2010
+ * April 24, 2010
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
@@ -346,7 +346,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.0beta19"
#define PNG_HEADER_VERSION_STRING \
- " libpng version 1.5.0beta19 - April 18, 2010\n"
+ " libpng version 1.5.0beta19 - April 24, 2010\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
@@ -2024,17 +2024,23 @@
((png_int_32)(*((buf) + 3))))
# endif
#endif
+
+#ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED
extern PNG_EXPORT(png_uint_32,png_get_uint_32,(png_bytep buf),,201);
extern PNG_EXPORT(png_uint_16,png_get_uint_16,(png_bytep buf),,202);
-# ifdef PNG_GET_INT_32_SUPPORTED
+#endif
+#ifdef PNG_GET_INT_32_SUPPORTED
extern PNG_EXPORT(png_int_32,png_get_int_32,(png_bytep buf),,203);
-# endif
+#endif
+
extern PNG_EXPORT(png_uint_32,png_get_uint_31,(png_structp png_ptr,
png_bytep buf),,204);
/* No png_get_int_16 -- may be added if there's a real need for it. */
/* Place a 32-bit number into a buffer in PNG byte order (big-endian). */
+#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
extern PNG_EXPORT(void,png_save_uint_32,(png_bytep buf, png_uint_32 i),,205);
+#endif
#ifdef PNG_SAVE_INT_32_SUPPORTED
extern PNG_EXPORT(void,png_save_int_32,(png_bytep buf, png_int_32 i),,206);
#endif
@@ -2043,8 +2049,10 @@
* The parameter is declared unsigned int, not png_uint_16,
* just to avoid potential problems on pre-ANSI C compilers.
*/
+#ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED
extern PNG_EXPORT(void,png_save_uint_16,(png_bytep buf, unsigned int i),,207);
/* No png_save_int_16 -- may be added if there's a real need for it. */
+#endif
/* The last ordinal number (this is the *last* one, the next one to
* use is one more than this.)
diff --git a/pngconf.h b/pngconf.h
index 8e03ba4..52a58df 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
- * libpng version 1.5.0beta19 - April 18, 2010
+ * libpng version 1.5.0beta19 - April 24, 2010
*
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -41,8 +41,12 @@
/* This controls optimization of the reading of 16 and 32 bit values
* from PNG files. It can be set on a per-app-file basis - it
* just changes whether a macro is used to the function is called.
- * The library builder sets the default.
+ * The library builder sets the default, if read functions are not
+ * built into the library the macro implementation is forced on.
*/
+#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
+# define PNG_USE_READ_MACROS
+#endif
#if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS)
# if PNG_DEFAULT_READ_MACROS
# define PNG_USE_READ_MACROS
diff --git a/scripts/pnglibconf.dfa b/scripts/pnglibconf.dfa
index 4351dc3..c357600 100644
--- a/scripts/pnglibconf.dfa
+++ b/scripts/pnglibconf.dfa
@@ -137,6 +137,18 @@
# Default to using the read macros
setting DEFAULT_READ_MACROS default 1
+# The alternative is to call functions to read PNG values, if
+# the functions are turned *off* the read macros must always
+# be enabled, so turning this off will actually force the
+# USE_READ_MACROS option on (see pngconf.h)
+option READ_INT_FUNCTIONS requires READ
+
+# The same for write, but these can only be switched off if
+# no writing is required at all - hence the use of an 'enables'
+# not a 'requires' below:
+option WRITE_INT_FUNCTIONS off
+option WRITE enables WRITE_INT_FUNCTIONS
+
# Generic options - affect both read and write.
option BENIGN_ERRORS off
option MNG_FEATURES
@@ -361,7 +373,7 @@
option HANDLE_AS_UNKNOWN
-option GET_INT_32 requires READ
+option GET_INT_32 requires READ READ_INT_FUNCTIONS
# png_get_int_32 is required by the ancillary chunks oFFs and pCAL
option READ_oFFs enables GET_INT_32
option READ_pCAL enables GET_INT_32
diff --git a/scripts/pnglibconf.h b/scripts/pnglibconf.h
index 403106b..863d970 100644
--- a/scripts/pnglibconf.h
+++ b/scripts/pnglibconf.h
@@ -1,7 +1,7 @@
-/* 1.5.0beta17 STANDARD API DEFINITION */
+/* 1.5.0beta19 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */
-/* libpng version 1.5.0beta17 - April 2, 2010 */
+/* libpng version 1.5.0beta19 - April 2, 2010 */
/* Copyright (c) 1998-2010 Glenn Randers-Pehrson */
@@ -48,6 +48,7 @@
#define PNG_IO_STATE_SUPPORTED
#define PNG_SET_USER_LIMITS_SUPPORTED
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
+#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
#define PNG_WRITE_FILTER_SUPPORTED
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
@@ -84,14 +85,15 @@
#define PNG_READ_SHIFT_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
+#define PNG_READ_INT_FUNCTIONS_SUPPORTED
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_hIST_SUPPORTED
-#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED
#define PNG_READ_BACKGROUND_SUPPORTED
+#define PNG_READ_QUANTIZE_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_PACKSWAP_SUPPORTED