[master] Imported from libpng-1.4.6beta06.tar

This commit is contained in:
Glenn Randers-Pehrson
2011-01-22 21:48:43 -06:00
parent 8502e1ff25
commit 686d45dcfd
11 changed files with 53 additions and 85 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.4.6beta06 - March 14, 2011 Libpng 1.4.6beta06 - January 23, 2011
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@@ -49,9 +49,7 @@ version 1.4.6beta05 [January 23, 2011]
Fixed a typo in the *.def files and deleted entries that are now Fixed a typo in the *.def files and deleted entries that are now
declared in pngpriv.h declared in pngpriv.h
version 1.4.6beta06 [March 14, 2011] version 1.4.6beta06 [January 23, 2011]
Updated contrib/pngsuite/README to add the word "modify".
Added the private PNG_UNUSED() macro definition in pngconf.h.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit

View File

@@ -2761,9 +2761,7 @@ version 1.4.6beta05 [January 23, 2011]
Fixed a typo in the *.def files and deleted entries that are now Fixed a typo in the *.def files and deleted entries that are now
declared in pngpriv.h declared in pngpriv.h
version 1.4.6beta06 [March 14, 2011] version 1.4.6beta06 [January 23, 2011]
Updated contrib/pngsuite/README to add the word "modify".
Added the private PNG_UNUSED() macro definition in pngconf.h.
Send comments/corrections/commendations to glennrp at users.sourceforge.net Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit or to png-mng-implement at lists.sf.net (subscription required; visit

View File

@@ -1,20 +1,17 @@
pngsuite pngsuite
-------- --------
(c) Willem van Schaik, 1999, 2011 (c) Willem van Schaik, 1999
Permission to use, copy, modify, and distribute these images for any Permission to use, copy, and distribute these images for any purpose and
purpose and without fee is hereby granted. without fee is hereby granted.
The 15 "bas*.png" images are part of the much larger PngSuite test-set of These 15 images are part of the much larger PngSuite test-set of
images, available for developers of PNG supporting software. The images, available for developers of PNG supporting software. The
complete set, available at http:/www.schaik.com/pngsuite/, contains complete set, available at http:/www.schaik.com/pngsuite/, contains
a variety of images to test interlacing, gamma settings, ancillary a variety of images to test interlacing, gamma settings, ancillary
chunks, etc. chunks, etc.
The "ft*.png" images are "free/libre" replacements for the transparent
corresponding t*.png images in the PngSuite.
The images in this directory represent the basic PNG color-types: The images in this directory represent the basic PNG color-types:
grayscale (1-16 bit deep), full color (8 or 16 bit), paletted grayscale (1-16 bit deep), full color (8 or 16 bit), paletted
(1-8 bit) and grayscale or color images with alpha channel. You (1-8 bit) and grayscale or color images with alpha channel. You
@@ -38,21 +35,7 @@ can use them to test the proper functioning of PNG software.
basn6a08.png 8-bit RGBA basn6a08.png 8-bit RGBA
basn6a16.png 16-bit RGBA basn6a16.png 16-bit RGBA
ftbbn0g04.png 4-bit grayscale, black bKGD Here is the correct result of typing "pngtest -m *.png" in
ftbbn2c16.png 16-bit truecolor, black bKGD
ftbbn3p08.png 8-bit paletted, black bKGD
ftbgn2c16.png 16-bit truecolor, gray bKGD
ftbgn3p08.png 8-bit paletted, gray bKGD
ftbrn2c08.png 8-bit truecolor, red bKGD
ftbwn0g16.png 16-bit gray, white bKGD
ftbwn3p08.png 8-bit paletted, white bKGD
ftbyn3p08.png 8-bit paletted, yellow bKGD
ftp0n0g08.png 8-bit grayscale, opaque
ftp0n2c08.png 8-bit truecolor, opaque
ftp0n3p08.png 8-bit paletted, opaque
ftp1n3p08.png 8-bit paletted, no bKGD
Here is the correct result of typing "pngtest -m bas*.png" in
this directory: this directory:
Testing basn0g01.png: PASS (524 zero samples) Testing basn0g01.png: PASS (524 zero samples)

12
png.c
View File

@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 23, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -541,19 +541,19 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
png_charp PNGAPI png_charp PNGAPI
png_get_copyright(png_const_structp png_ptr) png_get_copyright(png_const_structp png_ptr)
{ {
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
#ifdef PNG_STRING_COPYRIGHT #ifdef PNG_STRING_COPYRIGHT
return PNG_STRING_COPYRIGHT return PNG_STRING_COPYRIGHT
#else #else
#ifdef __STDC__ #ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \ return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.4.6beta06 - March 8, 2011" PNG_STRING_NEWLINE \ "libpng version 1.4.6beta06 - January 23, 2011" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE); PNG_STRING_NEWLINE);
#else #else
return ((png_charp) "libpng version 1.4.6beta06 - March 8, 2011\ return ((png_charp) "libpng version 1.4.6beta06 - January 23, 2011\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\ Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
@@ -573,7 +573,7 @@ png_charp PNGAPI
png_get_libpng_ver(png_const_structp png_ptr) png_get_libpng_ver(png_const_structp png_ptr)
{ {
/* Version of *.c files used when building libpng */ /* Version of *.c files used when building libpng */
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING); return ((png_charp) PNG_LIBPNG_VER_STRING);
} }
@@ -581,7 +581,7 @@ png_charp PNGAPI
png_get_header_ver(png_const_structp png_ptr) png_get_header_ver(png_const_structp png_ptr)
{ {
/* Version of *.h files used when building libpng */ /* Version of *.h files used when building libpng */
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
return ((png_charp) PNG_LIBPNG_VER_STRING); return ((png_charp) PNG_LIBPNG_VER_STRING);
} }

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.4.6beta06 - March 14, 2011 * libpng version 1.4.6beta06 - January 23, 2011
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -84,18 +84,6 @@
/* End of material added to libpng-1.2.8 */ /* End of material added to libpng-1.2.8 */
/* Added at libpng-1.4.6 */
#ifndef PNG_UNUSED
/* Unused formal parameter warnings are silenced using the following macro
* which is expected to have no bad effects on performance (optimizing
* compilers will probably remove it entirely). Note that if you replace
* it with something other than whitespace, you must include the terminating
* semicolon.
*/
# define PNG_UNUSED(param) (void)param;
#endif
/* End of material added to libpng-1.4.6 */
#ifndef PNG_VERSION_INFO_ONLY #ifndef PNG_VERSION_INFO_ONLY
/* This is the size of the compression buffer, and thus the size of /* This is the size of the compression buffer, and thus the size of

View File

@@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation /* pngerror.c - stub functions for i/o and memory allocation
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 23, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -306,7 +306,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
/* Here if not setjmp support or if png_ptr is null. */ /* Here if not setjmp support or if png_ptr is null. */
PNG_ABORT(); PNG_ABORT();
#ifndef PNG_CONSOLE_IO_SUPPORTED #ifndef PNG_CONSOLE_IO_SUPPORTED
PNG_UNUSED(error_message) /* Make compiler happy */ error_message = error_message; /* Make compiler happy */
#endif #endif
} }
@@ -352,9 +352,9 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
fprintf(stderr, PNG_STRING_NEWLINE); fprintf(stderr, PNG_STRING_NEWLINE);
} }
#else #else
PNG_UNUSED(warning_message) /* Make compiler happy */ warning_message = warning_message; /* Make compiler happy */
#endif #endif
PNG_UNUSED(png_ptr) /* Make compiler happy */ png_ptr = png_ptr; /* Make compiler happy */
} }
#endif /* PNG_WARNINGS_SUPPORTED */ #endif /* PNG_WARNINGS_SUPPORTED */

View File

@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode /* pngpread.c - read a png file in push mode
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 23, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1204,7 +1204,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{ {
png_error(png_ptr, "Out of place tEXt"); png_error(png_ptr, "Out of place tEXt");
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ info_ptr = info_ptr; /* To quiet some compiler warnings */
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
@@ -1302,7 +1302,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{ {
png_error(png_ptr, "Out of place zTXt"); png_error(png_ptr, "Out of place zTXt");
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ info_ptr = info_ptr; /* To quiet some compiler warnings */
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
@@ -1503,7 +1503,7 @@ png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
{ {
png_error(png_ptr, "Out of place iTXt"); png_error(png_ptr, "Out of place iTXt");
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ info_ptr = info_ptr; /* To quiet some compiler warnings */
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
@@ -1637,7 +1637,8 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
) )
#endif #endif
png_chunk_error(png_ptr, "unknown critical chunk"); png_chunk_error(png_ptr, "unknown critical chunk");
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
info_ptr = info_ptr; /* To quiet some compiler warnings */
} }
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED

View File

@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file /* pngread.c - read a PNG file
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 14, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1337,8 +1337,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */ /* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
png_read_end(png_ptr, info_ptr); png_read_end(png_ptr, info_ptr);
PNG_UNUSED(transforms) /* Quiet compiler warnings */ transforms = transforms; /* Quiet compiler warnings */
PNG_UNUSED(params) params = params;
} }
#endif /* PNG_INFO_IMAGE_SUPPORTED */ #endif /* PNG_INFO_IMAGE_SUPPORTED */

View File

@@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 23, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -703,7 +703,7 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
} }
png_crc_finish(png_ptr, length); png_crc_finish(png_ptr, length);
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */ info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
} }
#ifdef PNG_READ_gAMA_SUPPORTED #ifdef PNG_READ_gAMA_SUPPORTED
@@ -2505,7 +2505,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_crc_finish(png_ptr, skip); png_crc_finish(png_ptr, skip);
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED #ifndef PNG_READ_USER_CHUNKS_SUPPORTED
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */ info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
#endif #endif
} }
@@ -2961,7 +2961,7 @@ png_do_read_interlace(png_structp png_ptr)
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width); row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
} }
#ifndef PNG_READ_PACKSWAP_SUPPORTED #ifndef PNG_READ_PACKSWAP_SUPPORTED
PNG_UNUSED(transformations) /* Silence compiler warning */ transformations = transformations; /* Silence compiler warning */
#endif #endif
} }
#endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_READ_INTERLACING_SUPPORTED */

View File

@@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng /* pngtest.c - a simple test program to test libpng
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 14, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -387,7 +387,7 @@ static void
pngtest_flush(png_structp png_ptr) pngtest_flush(png_structp png_ptr)
{ {
/* Do nothing; fflush() is said to be just a waste of energy. */ /* Do nothing; fflush() is said to be just a waste of energy. */
PNG_UNUSED(png_ptr) /* Stifle compiler warning */ png_ptr = png_ptr; /* Stifle compiler warning */
} }
#endif #endif

View File

@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file /* pngwrite.c - general routines to write a PNG file
* *
* Last changed in libpng 1.4.6 [March 8, 2011] * Last changed in libpng 1.4.6 [January 14, 2011]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -1451,8 +1451,8 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
/* It is REQUIRED to call this to finish writing the rest of the file */ /* It is REQUIRED to call this to finish writing the rest of the file */
png_write_end(png_ptr, info_ptr); png_write_end(png_ptr, info_ptr);
PNG_UNUSED(transforms) /* Quiet compiler warnings */ transforms = transforms; /* Quiet compiler warnings */
PNG_UNUSED(params) params = params;
} }
#endif #endif
#endif /* PNG_WRITE_SUPPORTED */ #endif /* PNG_WRITE_SUPPORTED */