[devel] Changed several "#ifdef PNG_UNKNOWN_CHUNK_SUPPORTED" to

to "#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED", to make the png_set_keep
    mechanism available for ignoring known chunks even when not saving
    unknown chunks.
This commit is contained in:
Glenn Randers-Pehrson
2009-06-13 10:05:05 -05:00
parent b5444a1779
commit 7824a70c1d
7 changed files with 67 additions and 51 deletions

24
png.h
View File

@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.4.0beta63 - June 5, 2009
* libpng version 1.4.0beta63 - June 12, 2009
* Copyright (c) 1998-2009 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.)
@@ -9,7 +9,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.4.0beta63 - June 5, 2009: Glenn
* libpng versions 0.97, January 1998, through 1.4.0beta63 - June 12, 2009: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -120,7 +120,7 @@
* 1.2.10rc1-2 13 10210 12.so.0.10[.0]
* 1.2.10 13 10210 12.so.0.10[.0]
* 1.4.0beta1-5 14 10400 14.so.0.0[.0]
* 1.2.11beta1-4 13 10210 12.so.0.11[.0]
* 1.2.11beta1-4 13 10211 12.so.0.11[.0]
* 1.4.0beta7-8 14 10400 14.so.0.0[.0]
* 1.2.11 13 10211 12.so.0.11[.0]
* 1.2.12 13 10212 12.so.0.12[.0]
@@ -157,7 +157,7 @@
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* libpng versions 1.2.6, August 15, 2004, through 1.4.0beta63, June 5, 2009, are
* libpng versions 1.2.6, August 15, 2004, through 1.4.0beta63, June 12, 2009, are
* Copyright (c) 2004, 2006-2007 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:
@@ -333,7 +333,7 @@
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.4.0beta63"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.4.0beta63 - June 5, 2009\n"
" libpng version 1.4.0beta63 - June 12, 2009\n"
#define PNG_LIBPNG_VER_SONUM 14
#define PNG_LIBPNG_VER_DLLNUM 14
@@ -1263,7 +1263,7 @@ struct png_struct_def
png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */
#endif
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
#if defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED)
int num_chunk_list;
png_bytep chunk_list;
#endif
@@ -2332,8 +2332,8 @@ extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
#endif
#endif /* PNG_sCAL_SUPPORTED || PNG_WRITE_sCAL_SUPPORTED */
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
/* provide a list of chunks and how they are to be handled, if the built-in
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
/* Provide a list of chunks and how they are to be handled, if the built-in
handling or default unknown chunk handling is not desired. Any chunks not
listed will be handled in the default manner. The IHDR and IEND chunks
must not be listed.
@@ -2344,6 +2344,10 @@ extern PNG_EXPORT(void,png_set_sCAL_s) PNGARG((png_structp png_ptr,
*/
extern PNG_EXPORT(void, png_set_keep_unknown_chunks) PNGARG((png_structp
png_ptr, int keep, png_bytep chunk_list, int num_chunks));
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
chunk_name));
#endif
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
extern PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr,
png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns));
extern PNG_EXPORT(void, png_set_unknown_chunk_location)
@@ -2351,10 +2355,6 @@ extern PNG_EXPORT(void, png_set_unknown_chunk_location)
extern PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp
png_ptr, png_infop info_ptr, png_unknown_chunkpp entries));
#endif
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
PNG_EXPORT(int,png_handle_as_unknown) PNGARG((png_structp png_ptr, png_bytep
chunk_name));
#endif
/* Png_free_data() will turn off the "valid" flag for anything it frees.
If you need to turn it off for a chunk that your application has freed,