Compare commits

..

46 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
9f1cd70774 [devel] Imported from libpng-1.5.3beta03.tar 2011-04-16 21:39:11 -05:00
Glenn Randers-Pehrson
d2795b7909 [devel] Revised a comment about png_do_strip_channel(). 2011-04-16 19:41:23 -05:00
Glenn Randers-Pehrson
b75b24103d [devel] Added some whitespace in comments. 2011-04-16 19:35:05 -05:00
Glenn Randers-Pehrson
cb1aee2506 [devel] Fixed bug with stripping the filler or alpha channel when writing,
that was introduced in libpng-1.5.2beta01.
2011-04-16 19:27:34 -05:00
John Bowler
8d4ce1fed5 [devel] Fixed 64-bit builds where png_uint_32 is smaller than png_size_t 2011-04-15 06:54:30 -05:00
John Bowler
7abc130a81 [devel] Updated the vstudio project to zlib-1.2.5 2011-04-15 06:39:30 -05:00
John Bowler
5adc5a2ff8 [devel] Removed the now-unused PNG_DEPSTRUCT macro 2011-04-15 06:38:29 -05:00
John Bowler
b302c4721a [devel] Removed the PNG_PTR_NORETURN attribute 2011-04-15 06:37:34 -05:00
John Bowler
537c146082 [devel] Fixed gcc -ansi -pedantic compile, using __STRICT_ANSI__ 2011-04-15 06:36:21 -05:00
Glenn Randers-Pehrson
b6743ea08e [devel] Updated zlib.props to zlib-1.2.5 2011-04-04 15:40:59 -05:00
Glenn Randers-Pehrson
61365b6d15 [devel] Removed "#if 1" and the matching "#endif" 2011-04-03 19:49:37 -05:00
Glenn Randers-Pehrson
1b491cbda0 [devel] Bump to version libpng-1.5.3beta03 2011-04-03 06:51:53 -05:00
Glenn Randers-Pehrson
8abcf141fa [devel] Imported from libpng-1.5.3beta02.tar 2011-04-03 06:36:34 -05:00
Glenn Randers-Pehrson
b8e314072f [devel] Replaced pngtest.png with one that has the zTXt CMF optimized. 2011-04-02 08:28:31 -05:00
Glenn Randers-Pehrson
6785856858 [devel] Optimize the zlib CMF byte in non-IDAT compressed chunks 2011-04-02 08:26:42 -05:00
Glenn Randers-Pehrson
e99107b1aa [devel] Moved misplaced declarations 2011-04-02 05:49:03 -05:00
Glenn Randers-Pehrson
f30f0e04e3 [devel] Fixed typo in scripts/symbols.def
(compression_level -> compression_method)
2011-04-01 22:17:55 -05:00
Glenn Randers-Pehrson
c3b3240a03 [devel] Improved the optimization of the zlib CMF byte
(see libpng-1.2.6beta03).
2011-04-01 22:10:41 -05:00
Glenn Randers-Pehrson
65a24d0638 [devel] Add comment in pngtest.c about setting zlib strategy for text
compression
2011-04-01 20:41:53 -05:00
Glenn Randers-Pehrson
a45f47c225 [devel] Updated documentation on setting non-IDAT zlib compression parameters 2011-04-01 15:31:26 -05:00
Glenn Randers-Pehrson
c683100e31 [devel] zlib text compression parameters fall back on non-IDAT parameters
except for strategy which defaults to the zlib default.
2011-04-01 15:24:18 -05:00
Glenn Randers-Pehrson
ec8296ab81 [devel] Relocated some comment lines in pngwutil.c 2011-04-01 15:09:05 -05:00
Glenn Randers-Pehrson
bdb0130aea [devel] Remove "sPLT" from list of chunks that require compressed text 2011-04-01 14:55:01 -05:00
Glenn Randers-Pehrson
5975f31ff0 [devel] Added PNG_READ_COMPRESSED_TEXT_SUPPORTED macro. 2011-04-01 13:15:36 -05:00
Glenn Randers-Pehrson
205483d592 [devel] Added PNG_WRITE_COMPRESSED_TEXT_SUPPORTED macro. 2011-04-01 12:33:42 -05:00
Glenn Randers-Pehrson
3bb8683a79 [devel] Only compile the new zlib re-initializing code when text or iCCP
is supported.
2011-04-01 08:12:24 -05:00
Glenn Randers-Pehrson
bef60dc624 [devel] Updated scripts/symbols.def with new API functions. 2011-04-01 00:28:59 -05:00
Glenn Randers-Pehrson
8eb8833b74 [devel] Updated manual about the new API additions 2011-04-01 00:16:50 -05:00
Glenn Randers-Pehrson
b0525f83e1 [devel] Bump to version libpng-1.5.3beta02 2011-03-31 23:50:46 -05:00
Glenn Randers-Pehrson
ee1369b853 [devel] Imported from libpng-1.5.3beta01.tar 2011-03-31 23:50:36 -05:00
Glenn Randers-Pehrson
ea0c7b699e [devel] Update LAST_ORDINAL to 226 in png.h, to account for new API. 2011-03-31 23:25:29 -05:00
Glenn Randers-Pehrson
f83783115f [devel] Use a mode bit to avoid reopening the zstream except when necessary. 2011-03-31 22:06:04 -05:00
Glenn Randers-Pehrson
ed8aab4d85 [devel] Free zstream memory with deflateEnd before reinitializing it. 2011-03-31 21:33:39 -05:00
Glenn Randers-Pehrson
6bdea98992 [devel] Revised pngtest.c to set the zlib strategy, and restored pngtest.png 2011-03-31 21:14:55 -05:00
Glenn Randers-Pehrson
4a392c74cf [devel] Replace pngtest.png with one compressed with libpng-1.5.3beta01.
The zTXt chunk is 4 bytes larger than before.
2011-03-31 20:56:05 -05:00
Glenn Randers-Pehrson
1ecd786d95 [devel] Enable API for setting zlib non-IDAT parameters. 2011-03-31 20:53:47 -05:00
Glenn Randers-Pehrson
1345cbeea8 [devel] Update change comments (1.5.2 -> 1.5.3) 2011-03-31 20:33:04 -05:00
Glenn Randers-Pehrson
ab23d34dd9 [devel] Update change date 2011-03-31 20:19:28 -05:00
Glenn Randers-Pehrson
907333884f [devel] Bump to version libpng-1.5.3beta01 2011-03-31 20:16:03 -05:00
Glenn Randers-Pehrson
6b3d50b2cd [devel] Re-initialize the zlib compressor before compressing non-IDAT chunks. 2011-03-31 20:14:29 -05:00
Glenn Randers-Pehrson
dcc3505c7b [devel] Imported from libpng-1.5.2.tar 2011-03-31 11:29:05 -05:00
Glenn Randers-Pehrson
0d00d83ef0 [devel] Removed unused "6" and "8" from the key to the transformation matrix 2011-03-30 17:18:32 -05:00
Glenn Randers-Pehrson
47dc5f7b54 [devel] Fix spelling in a comment. 2011-03-30 09:59:02 -05:00
Glenn Randers-Pehrson
f2598a8b60 [devel] Imported from libpng-1.5.2rc03.tar 2011-03-24 23:08:31 -05:00
Glenn Randers-Pehrson
80de04e560 [devel] Don't include standard header files in png.h while building the symbol
table, to avoid cpp failure on SunOS (introduced PNG_BUILDING_SYMBOL_TABLE
macro).
2011-03-24 23:06:26 -05:00
Glenn Randers-Pehrson
77fd083041 [devel] Bump to version libpng-1.5.2rc03 2011-03-24 09:01:33 -05:00
44 changed files with 638 additions and 281 deletions

View File

@@ -1,5 +1,5 @@
Libpng 1.5.2rc02 - March 22, 2011
Libpng 1.5.3beta03 - April 17, 2011
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.
@@ -9,60 +9,50 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
1.5.2rc02.tar.xz (LZMA-compressed, recommended)
1.5.2rc02.tar.gz
1.5.2rc02.tar.bz2
1.5.3beta03.tar.xz (LZMA-compressed, recommended)
1.5.3beta03.tar.gz
1.5.3beta03.tar.bz2
Source files with CRLF line endings (for Windows), without the
"configure" script
lp152r02.7z (LZMA-compressed, recommended)
lp152r02.zip
lp153b03.7z (LZMA-compressed, recommended)
lp153b03.zip
Other information:
1.5.2rc02-README.txt
1.5.2rc02-LICENSE.txt
1.5.3beta03-README.txt
1.5.3beta03-LICENSE.txt
Changes since the last public release (1.5.1):
Changes since the last public release (1.5.2):
Version 1.5.2beta01 [February 13, 2011]
More -Wshadow fixes for older gcc compilers. Older gcc versions apparently
check formal parameters names in function declarations (as well as
definitions) to see if they match a name in the global namespace.
Revised PNG_EXPORTA macro to not use an empty parameter, to accommodate the
old VisualC++ preprocessor.
Turned on interlace handling in png_read_png().
Fixed gcc pendantic warnings.
Handle longjmp in Cygwin.
Fixed png_get_current_row_number() in the interlaced case.
Cleaned up ALPHA flags and transformations.
Implemented expansion to 16 bits.
Version 1.5.3beta01 [April 1, 2011]
Re-initialize the zlib compressor before compressing non-IDAT chunks.
Added API functions to set parameters for zlib compression of non-IDAT
chunks.
Version 1.5.2beta02 [February 19, 2011]
Fixed mistake in the descriptions of user read_transform and write_transform
function prototypes in the manual. The row_info struct is png_row_infop.
Reverted png_get_current_row_number() to previous (1.5.2beta01) behavior.
Corrected png_get_current_row_number documentation
Fixed the read/write row callback documentation.
This documents the current behavior, where the callback is called after
every row with information pertaining to the next row.
Version 1.5.3beta02 [April 3, 2011]
Updated scripts/symbols.def with new API functions.
Only compile the new zlib re-initializing code when text or iCCP is
supported, using PNG_WRITE_COMPRESSED_TEXT_SUPPORTED macro.
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
Optimize the zlib CMF byte in non-IDAT compressed chunks
Version 1.5.2beta03 [March 3, 2011]
Fixed scripts/makefile.vcwin32
Updated contrib/pngsuite/README to add the word "modify".
Define PNG_ALLOCATED to blank when _MSC_VER<1300.
Version 1.5.2rc01 [March 19, 2011]
Define remaining attributes to blank when MSC_VER<1300.
ifdef out mask arrays in pngread.c when interlacing is not supported.
Version 1.5.2rc02 [March 22, 2011]
Added a hint to try CPP=/bin/cpp if "cpp -E" fails in scripts/pnglibconf.mak
and in contrib/pngminim/*/makefile, eg., on SunOS 5.10, and removed "strip"
from the makefiles.
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
Version 1.5.3beta03 [April 17, 2011]
Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have
snprintf, and the "__STRICT_ANSI__" detects that condition more reliably
than __STDC__ (John Bowler).
Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells
the compiler that a user supplied callback (the error handler) does not
return, yet there is no guarantee in practice that the application code
will correctly implement the error handler because the compiler only
issues a warning if there is a mistake (John Bowler).
Removed the no-longer-used PNG_DEPSTRUCT macro.
Updated the zlib version to 1.2.5 in the VStudio project.
Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in
pngwutil.c (John Bowler).
Fixed bug with stripping the filler or alpha channel when writing, that
was introduced in libpng-1.5.2beta01.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit

35
CHANGES
View File

@@ -3280,6 +3280,41 @@ Version 1.5.2rc02 [March 22, 2011]
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
Version 1.5.2rc03 [March 24, 2011]
Don't include standard header files in png.h while building the symbol table,
to avoid cpp failure on SunOS (introduced PNG_BUILDING_SYMBOL_TABLE macro).
Version 1.5.2 [March 31, 2011]
No changes.
Version 1.5.3beta01 [April 1, 2011]
Re-initialize the zlib compressor before compressing non-IDAT chunks.
Added API functions to set parameters for zlib compression of non-IDAT
chunks.
Version 1.5.3beta02 [April 3, 2011]
Updated scripts/symbols.def with new API functions.
Only compile the new zlib re-initializing code when text or iCCP is
supported, using PNG_WRITE_COMPRESSED_TEXT_SUPPORTED macro.
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
Optimize the zlib CMF byte in non-IDAT compressed chunks
Version 1.5.3beta03 [April 17, 2011]
Fixed gcc -ansi -pedantic compile. A strict ANSI system does not have
snprintf, and the "__STRICT_ANSI__" detects that condition more reliably
than __STDC__ (John Bowler).
Removed the PNG_PTR_NORETURN attribute because it too dangerous. It tells
the compiler that a user supplied callback (the error handler) does not
return, yet there is no guarantee in practice that the application code
will correctly implement the error handler because the compiler only
issues a warning if there is a mistake (John Bowler).
Removed the no-longer-used PNG_DEPSTRUCT macro.
Updated the zlib version to 1.2.5 in the VStudio project.
Fixed 64-bit builds where png_uint_32 is smaller than png_size_t in
pngwutil.c (John Bowler).
Fixed bug with stripping the filler or alpha channel when writing, that
was introduced in libpng-1.5.2beta01.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@@ -33,7 +33,7 @@ enable_testing()
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 5)
set(PNGLIB_RELEASE 2)
set(PNGLIB_RELEASE 3)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
@@ -264,7 +264,7 @@ install(CODE ${PNG_CONFIG_INSTALL_CODE})
# SET UP LINKS
if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 15.${PNGLIB_RELEASE}.1.5.2rc02
# VERSION 15.${PNGLIB_RELEASE}.1.5.3beta03
VERSION 15.${PNGLIB_RELEASE}.0
SOVERSION 15
CLEAN_DIRECT_OUTPUT 1)

View File

@@ -10,7 +10,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.5.2rc02, March 22, 2011, are
libpng versions 1.2.6, August 15, 2004, through 1.5.3beta03, April 17, 2011, are
Copyright (c) 2004, 2006-2011 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
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
March 22, 2011
April 17, 2011

View File

@@ -124,7 +124,7 @@ pngvalid.o pngtest.o: pnglibconf.h
SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-DPNGLIB_VERSION='@PNGLIB_VERSION@'\
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
-DPNG_NO_USE_READ_MACROS
-DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
.dfn.out:
rm -f $@ dfn.c dfn?.out
@@ -162,7 +162,7 @@ scripts/pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk
test -z "$(CPPFLAGS)"
echo "com @PNGLIB_VERSION@ STANDARD API DEFINITION" |\
$(AWK) -f ${srcdir}/scripts/options.awk out=dfn1.out\
logunsupported=2 - ${srcdir}/scripts/pnglibconf.dfa 1>&2
logunsupported=3 - ${srcdir}/scripts/pnglibconf.dfa 1>&2
$(AWK) -f ${srcdir}/scripts/options.awk out=dfn2.out dfn1.out 1>&2
rm dfn1.out
mv dfn2.out $@

View File

@@ -362,7 +362,7 @@ SUFFIXES = .chk .dfn .out
SYMBOL_CFLAGS = -DPNGLIB_LIBNAME='PNG@PNGLIB_MAJOR@@PNGLIB_MINOR@_0'\
-DPNGLIB_VERSION='@PNGLIB_VERSION@'\
-DSYMBOL_PREFIX='$(SYMBOL_PREFIX)'\
-DPNG_NO_USE_READ_MACROS
-DPNG_NO_USE_READ_MACROS -DPNG_BUILDING_SYMBOL_TABLE
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-am

2
README
View File

@@ -1,4 +1,4 @@
README for libpng version 1.5.2rc02 - March 22, 2011 (shared library 15.0)
README for libpng version 1.5.3beta03 - April 17, 2011 (shared library 15.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.

24
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for libpng 1.5.2rc02.
# Generated by GNU Autoconf 2.68 for libpng 1.5.3beta03.
#
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng'
PACKAGE_VERSION='1.5.2rc02'
PACKAGE_STRING='libpng 1.5.2rc02'
PACKAGE_VERSION='1.5.3beta03'
PACKAGE_STRING='libpng 1.5.3beta03'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
PACKAGE_URL=''
@@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libpng 1.5.2rc02 to adapt to many kinds of systems.
\`configure' configures libpng 1.5.3beta03 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1377,7 +1377,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpng 1.5.2rc02:";;
short | recursive ) echo "Configuration of libpng 1.5.3beta03:";;
esac
cat <<\_ACEOF
@@ -1485,7 +1485,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
libpng configure 1.5.2rc02
libpng configure 1.5.3beta03
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1908,7 +1908,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpng $as_me 1.5.2rc02, which was
It was created by libpng $as_me 1.5.3beta03, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2723,7 +2723,7 @@ fi
# Define the identity of the package.
PACKAGE='libpng'
VERSION='1.5.2rc02'
VERSION='1.5.3beta03'
cat >>confdefs.h <<_ACEOF
@@ -2787,10 +2787,10 @@ fi
PNGLIB_VERSION=1.5.2rc02
PNGLIB_VERSION=1.5.3beta03
PNGLIB_MAJOR=1
PNGLIB_MINOR=5
PNGLIB_RELEASE=2
PNGLIB_RELEASE=3
@@ -13040,7 +13040,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by libpng $as_me 1.5.2rc02, which was
This file was extended by libpng $as_me 1.5.3beta03, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13106,7 +13106,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
libpng config.status 1.5.2rc02
libpng config.status 1.5.3beta03
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"

View File

@@ -18,15 +18,15 @@ AC_PREREQ(2.59)
dnl Version number stuff here:
AC_INIT([libpng], [1.5.2rc02], [png-mng-implement@lists.sourceforge.net])
AC_INIT([libpng], [1.5.3beta03], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake
AM_MAINTAINER_MODE
PNGLIB_VERSION=1.5.2rc02
PNGLIB_VERSION=1.5.3beta03
PNGLIB_MAJOR=1
PNGLIB_MINOR=5
PNGLIB_RELEASE=2
PNGLIB_RELEASE=3
dnl End of version number stuff

View File

@@ -2,7 +2,7 @@
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.5.0 [January 6, 2011]
* Last changed in libpng 1.5.2 [March 31, 2011]
* This file has been placed in the public domain by the authors.
* Maintained 1998-2011 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger)

View File

@@ -1,6 +1,6 @@
libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.5.2rc02 - March 22, 2011
libpng version 1.5.3beta03 - April 17, 2011
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.5.2rc02 - March 22, 2011
libpng versions 0.97, January 1998, through 1.5.3beta03 - April 17, 2011
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -1263,8 +1263,6 @@ Within the matrix,
"T" means the transformation is obtained by png_set_tRNS_to_alpha().
"B" means the transformation is obtained by png_set_background(), or
png_strip_alpha().
"8" means the transformation is obtained by png_set_strip_16().
"6" means the transformation is obtained by png_set_expand_16().
When an entry has multiple transforms listed all are required to cause the
right overall transformation. When two transforms are separated by a comma
@@ -2297,11 +2295,11 @@ with zlib) for details on the compression levels.
#include zlib.h
/* set the zlib compression level */
/* Set the zlib compression level */
png_set_compression_level(png_ptr,
Z_BEST_COMPRESSION);
/* set other zlib parameters */
/* Set other zlib parameters for compressing IDAT */
png_set_compression_mem_level(png_ptr, 8);
png_set_compression_strategy(png_ptr,
Z_DEFAULT_STRATEGY);
@@ -2309,7 +2307,15 @@ with zlib) for details on the compression levels.
png_set_compression_method(png_ptr, 8);
png_set_compression_buffer_size(png_ptr, 8192)
extern PNG_EXPORT(void,png_set_zbuf_size)
/* Set zlib parameters for text compression
* If you don't call these, the parameters
* fall back on those defined for IDAT chunks
*/
png_set_text_compression_mem_level(png_ptr, 8);
png_set_text_compression_strategy(png_ptr,
Z_DEFAULT_STRATEGY);
png_set_text_compression_window_bits(png_ptr, 15);
png_set_text_compression_method(png_ptr, 8);
Setting the contents of info for output
@@ -3737,7 +3743,8 @@ The png_zalloc() function no longer zeroes out the memory that it
allocates.
Support for dithering was disabled by default in libpng-1.4.0, because
been well tested and doesn't actually "dither". The code was not
it has not been well tested and doesn't actually "dither".
The code was not
removed, however, and could be enabled by building libpng with
PNG_READ_DITHER_SUPPORTED defined. In libpng-1.4.2, this support
was reenabled, but the function was renamed png_set_quantize() to
@@ -3853,6 +3860,12 @@ PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0
will lead to a link failure.
Prior to libpng-1.5.3, the zlib compressor used the same set of parameters
when compressing the IDAT data and textual data such as zTXt and iCCP.
In libpng-1.5.3 we reinitialized the zlib stream for each type of data.
We added five png_set_text_*() functions for setting the parameters to
use with textual data.
B. Changes to the build and configuration of libpng
Details of internal changes to the library code can be found in the CHANGES
@@ -4161,13 +4174,13 @@ Other rules can be inferred by inspecting the libpng source.
XIV. Y2K Compliance in libpng
March 22, 2011
April 17, 2011
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.5.2rc02 are Y2K compliant. It is my belief that earlier
upward through 1.5.3beta03 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@@ -1,6 +1,6 @@
.TH LIBPNG 3 "March 22, 2011"
.TH LIBPNG 3 "April 17, 2011"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.2rc02
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta03
.SH SYNOPSIS
\fI\fB
@@ -800,6 +800,26 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.5.2rc02
\fI\fB
\fBvoid png_set_text_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP
\fI\fB
\fBvoid png_set_text_compression_mem_level (png_structp \fP\fIpng_ptr\fP\fB, int \fImem_level\fP\fB);\fP
\fI\fB
\fBvoid png_set_text_compression_strategy (png_structp \fP\fIpng_ptr\fP\fB, int \fIstrategy\fP\fB);\fP
\fI\fB
\fBvoid png_set_text_compression_window_bits (png_structp \fP\fIpng_ptr\fP\fB, int \fIwindow_bits\fP\fB);\fP
\fI\fB
\fBvoid \fP\fIpng_set_text_compression_method\fP\fB, (png_structp \fP\fIpng_ptr\fP\fB, int \fImethod)\fP\fB);\fP
\fI\fB
\fBvoid png_set_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
\fI\fB
@@ -923,7 +943,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.5.2rc02 - March 22, 2011
libpng version 1.5.3beta03 - April 17, 2011
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -934,7 +954,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.5.2rc02 - March 22, 2011
libpng versions 0.97, January 1998, through 1.5.3beta03 - April 17, 2011
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -2186,8 +2206,6 @@ Within the matrix,
"T" means the transformation is obtained by png_set_tRNS_to_alpha().
"B" means the transformation is obtained by png_set_background(), or
png_strip_alpha().
"8" means the transformation is obtained by png_set_strip_16().
"6" means the transformation is obtained by png_set_expand_16().
When an entry has multiple transforms listed all are required to cause the
right overall transformation. When two transforms are separated by a comma
@@ -3220,11 +3238,11 @@ with zlib) for details on the compression levels.
#include zlib.h
/* set the zlib compression level */
/* Set the zlib compression level */
png_set_compression_level(png_ptr,
Z_BEST_COMPRESSION);
/* set other zlib parameters */
/* Set other zlib parameters for compressing IDAT */
png_set_compression_mem_level(png_ptr, 8);
png_set_compression_strategy(png_ptr,
Z_DEFAULT_STRATEGY);
@@ -3232,7 +3250,15 @@ with zlib) for details on the compression levels.
png_set_compression_method(png_ptr, 8);
png_set_compression_buffer_size(png_ptr, 8192)
extern PNG_EXPORT(void,png_set_zbuf_size)
/* Set zlib parameters for text compression
* If you don't call these, the parameters
* fall back on those defined for IDAT chunks
*/
png_set_text_compression_mem_level(png_ptr, 8);
png_set_text_compression_strategy(png_ptr,
Z_DEFAULT_STRATEGY);
png_set_text_compression_window_bits(png_ptr, 15);
png_set_text_compression_method(png_ptr, 8);
.SS Setting the contents of info for output
@@ -4660,7 +4686,8 @@ The png_zalloc() function no longer zeroes out the memory that it
allocates.
Support for dithering was disabled by default in libpng-1.4.0, because
been well tested and doesn't actually "dither". The code was not
it has not been well tested and doesn't actually "dither".
The code was not
removed, however, and could be enabled by building libpng with
PNG_READ_DITHER_SUPPORTED defined. In libpng-1.4.2, this support
was reenabled, but the function was renamed png_set_quantize() to
@@ -4776,6 +4803,12 @@ PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0
will lead to a link failure.
Prior to libpng-1.5.3, the zlib compressor used the same set of parameters
when compressing the IDAT data and textual data such as zTXt and iCCP.
In libpng-1.5.3 we reinitialized the zlib stream for each type of data.
We added five png_set_text_*() functions for setting the parameters to
use with textual data.
B. Changes to the build and configuration of libpng
Details of internal changes to the library code can be found in the CHANGES
@@ -5084,13 +5117,13 @@ Other rules can be inferred by inspecting the libpng source.
.SH XIV. Y2K Compliance in libpng
March 22, 2011
April 17, 2011
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.5.2rc02 are Y2K compliant. It is my belief that earlier
upward through 1.5.3beta03 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that
@@ -5277,7 +5310,9 @@ the first widely used release:
1.5.1rc01-02 15 10501 15.so.15.1[.0]
1.5.1 15 10501 15.so.15.1[.0]
1.5.2beta01-03 15 10502 15.so.15.2[.0]
1.5.2rc01 15 10502 15.so.15.2[.0]
1.5.2rc01-03 15 10502 15.so.15.2[.0]
1.5.2 15 10502 15.so.15.2[.0]
1.5.3beta01-03 15 10503 15.so.15.3[.0]
Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be
@@ -5334,7 +5369,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.5.2rc02 - March 22, 2011:
Libpng version 1.5.3beta03 - April 17, 2011:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -5357,7 +5392,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.5.2rc02, March 22, 2011, are
libpng versions 1.2.6, August 15, 2004, through 1.5.3beta03, April 17, 2011, 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
@@ -5456,7 +5491,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
March 22, 2011
April 17, 2011
.\" end of man page

View File

@@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "March 22, 2011"
.TH LIBPNGPF 3 "April 17, 2011"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.2rc02
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta03
(private functions)
.SH SYNOPSIS
\fB#include \fI"pngpriv.h"

2
png.5
View File

@@ -1,4 +1,4 @@
.TH PNG 5 "March 22, 2011"
.TH PNG 5 "April 17, 2011"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

12
png.c
View File

@@ -14,7 +14,7 @@
#include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_2rc02 Your_png_h_is_not_version_1_5_2rc02;
typedef png_libpng_version_1_5_3beta03 Your_png_h_is_not_version_1_5_3beta03;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -555,13 +555,13 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return PNG_STRING_NEWLINE \
"libpng version 1.5.2rc02 - March 22, 2011" PNG_STRING_NEWLINE \
"libpng version 1.5.3beta03 - April 17, 2011" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE;
# else
return "libpng version 1.5.2rc02 - March 22, 2011\
return "libpng version 1.5.3beta03 - April 17, 2011\
Copyright (c) 1998-2011 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -1102,7 +1102,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
if (fp < 0)
{
fp = -fp;
*ascii++ = 45; /* '-' PLUS 1 TOTAL 1*/
*ascii++ = 45; /* '-' PLUS 1 TOTAL 1 */
--size;
}
@@ -1329,7 +1329,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
*/
size -= cdigits;
*ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision*/
*ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */
if (exp_b10 < 0)
{
*ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
@@ -1401,7 +1401,7 @@ png_ascii_from_fixed(png_structp png_ptr, png_charp ascii, png_size_t size,
if (num <= 0x80000000U) /* else overflowed */
{
unsigned int ndigits = 0, first = 16/*flag value*/;
unsigned int ndigits = 0, first = 16 /* flag value */;
char digits[10];
while (num)

94
png.h
View File

@@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.5.2rc02 - March 22, 2011
* libpng version 1.5.3beta03 - April 17, 2011
* Copyright (c) 1998-2011 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.2rc02 - March 22, 2011: Glenn
* libpng versions 0.97, January 1998, through 1.5.3beta03 - April 17, 2011: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@@ -148,7 +148,9 @@
* 1.5.1rc01-02 15 10501 15.so.15.1[.0]
* 1.5.1 15 10501 15.so.15.1[.0]
* 1.5.2beta01-03 15 10502 15.so.15.2[.0]
* 1.5.2rc01 15 10502 15.so.15.2[.0]
* 1.5.2rc01-03 15 10502 15.so.15.2[.0]
* 1.5.2 15 10502 15.so.15.2[.0]
* 1.5.3beta01-03 15 10503 15.so.15.3[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@@ -180,7 +182,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.5.2rc02, March 22, 2011, are
* libpng versions 1.2.6, August 15, 2004, through 1.5.3beta03, April 17, 2011, are
* Copyright (c) 2004, 2006-2011 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:
@@ -292,13 +294,13 @@
* Y2K compliance in libpng:
* =========================
*
* March 22, 2011
* April 17, 2011
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.5.2rc02 are Y2K compliant. It is my belief that
* upward through 1.5.3beta03 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@@ -354,9 +356,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.5.2rc02"
#define PNG_LIBPNG_VER_STRING "1.5.3beta03"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.5.2rc02 - March 22, 2011\n"
" libpng version 1.5.3beta03 - April 17, 2011\n"
#define PNG_LIBPNG_VER_SONUM 15
#define PNG_LIBPNG_VER_DLLNUM 15
@@ -364,12 +366,12 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 5
#define PNG_LIBPNG_VER_RELEASE 2
#define PNG_LIBPNG_VER_RELEASE 3
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
#define PNG_LIBPNG_VER_BUILD 02
#define PNG_LIBPNG_VER_BUILD 03
/* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1
@@ -394,7 +396,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10502 /* 1.5.2 */
#define PNG_LIBPNG_VER 10503 /* 1.5.3 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -407,18 +409,23 @@
#endif
#ifndef PNG_VERSION_INFO_ONLY
/* Standard header files (not needed for the version info) */
# ifdef PNG_SETJMP_SUPPORTED
# include <setjmp.h>
# endif
# ifndef PNG_BUILDING_SYMBOL_TABLE
/*
* Standard header files (not needed for the version info or while
* building symbol table -- see scripts/pnglibconf.dfa)
*/
# ifdef PNG_SETJMP_SUPPORTED
# include <setjmp.h>
# endif
/* Need the time information for converting tIME chunks, it
* defines struct tm:
*/
#ifdef PNG_CONVERT_tIME_SUPPORTED
/* "time.h" functions are not supported on all operating systems */
# include <time.h>
#endif
/* Need the time information for converting tIME chunks, it
* defines struct tm:
*/
# ifdef PNG_CONVERT_tIME_SUPPORTED
/* "time.h" functions are not supported on all operating systems */
# include <time.h>
# endif
# endif
/* Machine specific configuration. */
# include "pngconf.h"
@@ -511,7 +518,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_5_2rc02;
typedef char* png_libpng_version_1_5_3beta03;
/* Three color definitions. The order of the red, green, and blue, (and the
* exact size) is not important, although the size of the fields need to
@@ -839,25 +846,18 @@ typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp));
#endif
#ifdef PNG_SETJMP_SUPPORTED
/* This must match the function definition in <setjmp.h>, and the
* application must include this before png.h to obtain the definition
* of jmp_buf. The function is required to be PNG_NORETURN. (Note that
* PNG_PTR_NORETURN is used here because current versions of the Microsoft
* C compiler do not support the PNG_NORETURN attribute on a pointer.)
/* This must match the function definition in <setjmp.h>, and the application
* must include this before png.h to obtain the definition of jmp_buf. The
* function is required to be PNG_NORETURN, but this is not checked. If the
* function does return the application will crash via an abort() or similar
* system level call.
*
* If you get a type warning from the compiler when linking against this line
* then your compiler has 'longjmp' that does not match the requirements of the
* compiler that built libpng. You will have to write a wrapper function for
* your compiler's longjmp and call png_set_longjmp_fn directly (not via the
* png_jmpbuf macro.)
*
* If you get a warning here while building the library you will need to make
* If you get a warning here while building the library you may need to make
* changes to ensure that pnglibconf.h records the calling convention used by
* your compiler. This may be very difficult - try using a different compiler
* to build the library!
*/
typedef PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)),
PNG_PTR_NORETURN);
PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
#endif
/* Transform masks for the high-level interface */
@@ -1407,6 +1407,24 @@ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structp png_ptr,
PNG_EXPORT(73, void, png_set_compression_method, (png_structp png_ptr,
int method));
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
/* Also set zlib parameters for compressing non-IDAT chunks */
PNG_EXPORT(222, void, png_set_text_compression_level,
(png_structp png_ptr, int level));
PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structp png_ptr,
int mem_level));
PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structp png_ptr,
int strategy));
PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structp
png_ptr, int window_bits));
PNG_EXPORT(226, void, png_set_text_compression_method, (png_structp png_ptr,
int method));
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
/* These next functions are called for input/output, memory, and error
* handling. They are in the file pngrio.c, pngwio.c, and pngerror.c,
* and call standard C I/O routines such as fread(), fwrite(), and
@@ -2291,7 +2309,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
* scripts/symbols.def as well.
*/
#ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(221);
PNG_EXPORT_LAST_ORDINAL(226);
#endif
#ifdef __cplusplus

View File

@@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.5.2rc02 - (PENDING RELEASE)
* libpng version 1.5.3beta03 - April 17, 2011
*
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -22,29 +22,31 @@
#ifndef PNGCONF_H
#define PNGCONF_H
#ifndef PNG_BUILDING_SYMBOL_TABLE
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
* definition file for machine specific limits, this may impact the
* correctness of the definitons below (see uses of INT_MAX).
*/
#ifndef PNG_NO_LIMITS_H
# include <limits.h>
#endif
# ifndef PNG_NO_LIMITS_H
# include <limits.h>
# endif
/* For the memory copy APIs (i.e. the standard definitions of these),
* because this file defines png_memcpy and so on the base APIs must
* be defined here.
*/
#ifdef BSD
# include <strings.h>
#else
# include <string.h>
#endif
# ifdef BSD
# include <strings.h>
# else
# include <string.h>
# endif
/* For png_FILE_p - this provides the standard definition of a
* FILE
*/
#ifdef PNG_STDIO_SUPPORTED
# include <stdio.h>
# ifdef PNG_STDIO_SUPPORTED
# include <stdio.h>
# endif
#endif
/* This controls optimization of the reading of 16 and 32 bit values
@@ -351,23 +353,6 @@
# ifndef PNG_NORETURN
# define PNG_NORETURN __attribute__((__noreturn__))
# endif
# ifndef PNG_PTR_NORETURN
/* It's not enough to have the compiler be the correct compiler at
* this point - it's necessary for the library (which defines
* the type of the library longjmp) to also be the GNU library.
* This is because many systems use the GNU compiler with a
* non-GNU libc implementation. Min/GW headers are also compatible
* with GCC as well as uclibc, so it seems best to exclude known
* problem libcs here rather than just including known libcs.
*
* NOTE: this relies on the only use of PNG_PTR_NORETURN being with
* the system longjmp. If the same type is used elsewhere then this
* will need to be changed.
*/
# if !defined(__CYGWIN__)
# define PNG_PTR_NORETURN __attribute__((__noreturn__))
# endif
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __attribute__((__malloc__))
# endif
@@ -380,9 +365,6 @@
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __attribute__((__deprecated__))
# endif
# ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
# endif
# ifndef PNG_PRIVATE
# if 0 /* Doesn't work so we use deprecated instead*/
# define PNG_PRIVATE \
@@ -402,9 +384,6 @@
# ifndef PNG_NORETURN
# define PNG_NORETURN __declspec(noreturn)
# endif
# ifndef PNG_PTR_NORETURN
# define PNG_PTR_NORETURN /* not supported */
# endif
# ifndef PNG_ALLOCATED
# define PNG_ALLOCATED __declspec(restrict)
# endif
@@ -417,9 +396,6 @@
# ifndef PNG_DEPRECATED
# define PNG_DEPRECATED __declspec(deprecated)
# endif
# ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT __declspec(deprecated)
# endif
# ifndef PNG_PRIVATE
# define PNG_PRIVATE __declspec(deprecated)
# endif
@@ -436,15 +412,9 @@
#ifndef PNG_NORETURN
# define PNG_NORETURN /* This function does not return */
#endif
#ifndef PNG_PTR_NORETURN
# define PNG_PTR_NORETURN /* This function does not return */
#endif
#ifndef PNG_ALLOCATED
# define PNG_ALLOCATED /* The result of the function is new memory */
#endif
#ifndef PNG_DEPSTRUCT
# define PNG_DEPSTRUCT /* Access to this struct member is deprecated */
#endif
#ifndef PNG_PRIVATE
# define PNG_PRIVATE /* This is a private libpng function */
#endif

View File

@@ -1,7 +1,7 @@
/* pngmem.c - stub functions for memory allocation
*
* Last changed in libpng 1.5.1 [February 3, 2011]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -187,8 +187,9 @@ png_malloc_default,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
int num_blocks;
png_uint_32 total_size;
png_bytep table;
int i;
int i, mem_level, window_bits;
png_byte huge * hptr;
int window_bits
if (ret != NULL)
{
@@ -196,14 +197,22 @@ png_malloc_default,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
ret = NULL;
}
if (png_ptr->zlib_window_bits > 14)
num_blocks = (int)(1 << (png_ptr->zlib_window_bits - 14));
window_bits =
png_ptr->zlib_window_bits >= png_ptr->zlib_text_window_bits ?
png_ptr->zlib_window_bits : png_ptr->zlib_text_window_bits;
if (window_bits > 14)
num_blocks = (int)(1 << (window_bits - 14));
else
num_blocks = 1;
if (png_ptr->zlib_mem_level >= 7)
num_blocks += (int)(1 << (png_ptr->zlib_mem_level - 7));
mem_level =
png_ptr->zlib_mem_level >= png_ptr->zlib_text_mem_level ?
png_ptr->zlib_mem_level : png_ptr->zlib_text_mem_level;
if (mem_level >= 7)
num_blocks += (int)(1 << (mem_level - 7));
else
num_blocks++;
@@ -277,7 +286,7 @@ png_malloc_default,(png_structp png_ptr, png_alloc_size_t size),PNG_ALLOCATED)
{
# ifndef PNG_USER_MEM_SUPPORTED
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
png_error(png_ptr, "Out of Memory"); /* Note "o" and "M" */
png_error(png_ptr, "Out of Memory"); /* Note "O" and "M" */
else
png_warning(png_ptr, "Out of Memory");

View File

@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.2 [March 31, 2011]
* Copyright (c) 1998-2011 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.)
@@ -1288,7 +1288,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
{
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
png_error(png_ptr, "Out of place tEXt");
/*NOT REACHED*/
/* NOT REACHED */
}
#ifdef PNG_MAX_MALLOC_64K
@@ -1385,7 +1385,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
{
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
png_error(png_ptr, "Out of place zTXt");
/*NOT REACHED*/
/* NOT REACHED */
}
#ifdef PNG_MAX_MALLOC_64K
@@ -1589,7 +1589,7 @@ png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
{
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
png_error(png_ptr, "Out of place iTXt");
/*NOT REACHED*/
/* NOT REACHED */
}
#ifdef PNG_MAX_MALLOC_64K

View File

@@ -6,7 +6,7 @@
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -232,7 +232,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#endif
/* End of memory model/platform independent support */
#ifndef PNG_NO_SNPRINTF
#if !defined(PNG_NO_SNPRINTF) && !defined(__STRICT_ANSI__)
# ifdef _MSC_VER
# define png_snprintf _snprintf /* Added to v 1.2.19 */
# define png_snprintf2 _snprintf
@@ -277,6 +277,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
#define PNG_BACKGROUND_IS_GRAY 0x800
#define PNG_HAVE_PNG_SIGNATURE 0x1000
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
#define PNG_ZLIB_READY_FOR_ZTXT 0x4000 /* 1: ready for ZTXT; 0: for IDAT */
/* Flags for the transformations the PNG library does on the image data */
#define PNG_BGR 0x0001
@@ -345,13 +346,13 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
/* 0x200000L unused */
/* 0x400000L unused */
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000L /* Added to libpng-1.4.0 */
/* 0x1000000L unused */
/* 0x2000000L unused */
/* 0x4000000L unused */
/* 0x8000000L unused */
/* 0x10000000L unused */
/* 0x20000000L unused */
/* 0x40000000L unused */
#define PNG_FLAG_ZTXT_CUSTOM_STRATEGY 0x1000000L /* 5 lines added */
#define PNG_FLAG_ZTXT_CUSTOM_LEVEL 0x2000000L /* to libpng-1.5.3 */
#define PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL 0x4000000L
#define PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS 0x8000000L
#define PNG_FLAG_ZTXT_CUSTOM_METHOD 0x10000000L
/* 0x20000000L unused */
/* 0x40000000L unused */
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
PNG_FLAG_CRC_ANCILLARY_NOWARN)
@@ -540,8 +541,7 @@ PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
png_size_t length));
/* Decompress data in a chunk that uses compression */
#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
#if defined(PNG_READ_COMPRESSED_TEXT_SUPPORTED)
PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
int comp_type, png_size_t chunklength, png_size_t prefix_length,
png_size_t *data_length));
@@ -644,6 +644,7 @@ PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr,
png_const_uint_16p hist, int num_hist));
#endif
/* Chunks that have keywords */
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,

View File

@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.2 [March 31, 2011]
* Copyright (c) 1998-2011 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.)

View File

@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.2 [March 31, 2011]
* Copyright (c) 1998-2011 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.)
@@ -1491,7 +1491,7 @@ png_do_read_transformations(png_structp png_ptr)
(png_ptr->row_info.color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
png_ptr->row_info.color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1,
0/*!at_start, because SWAP_ALPHA happens later*/);
0 /* at_start == false, because SWAP_ALPHA happens later */);
#endif
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED

View File

@@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -278,8 +278,7 @@ png_crc_error(png_structp png_ptr)
return (0);
}
#if defined(PNG_READ_zTXt_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) || \
defined(PNG_READ_iCCP_SUPPORTED)
#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
static png_size_t
png_inflate(png_structp png_ptr, png_bytep data, png_size_t size,
png_bytep output, png_size_t output_size)
@@ -438,8 +437,8 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
png_size_t expanded_size = png_inflate(png_ptr,
(png_bytep)(png_ptr->chunkdata + prefix_size),
chunklength - prefix_size,
0, /*output*/
0); /*output size*/
0, /* output */
0); /* output size */
/* Now check the limits on this chunk - if the limit fails the
* compressed data will be removed, the prefix will remain.
@@ -536,7 +535,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
*newlength = prefix_size;
}
#endif
#endif /* PNG_READ_COMPRESSED_TEXT_SUPPORTED */
/* Read and check the IDHR chunk */
void /* PRIVATE */

View File

@@ -341,11 +341,11 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
png_error(png_ptr, "Invalid sCAL unit");
if (swidth == NULL || (lengthw = png_strlen(swidth)) <= 0 ||
swidth[0] == 45 /*'-'*/ || !png_check_fp_string(swidth, lengthw))
swidth[0] == 45 /* '-' */ || !png_check_fp_string(swidth, lengthw))
png_error(png_ptr, "Invalid sCAL width");
if (sheight == NULL || (lengthh = png_strlen(sheight)) <= 0 ||
sheight[0] == 45 /*'-'*/ || !png_check_fp_string(sheight, lengthh))
sheight[0] == 45 /* '-' */ || !png_check_fp_string(sheight, lengthh))
png_error(png_ptr, "Invalid sCAL height");
info_ptr->scal_unit = (png_byte)unit;

View File

@@ -69,6 +69,16 @@ struct png_struct_def
int zlib_window_bits; /* holds zlib compression window bits */
int zlib_mem_level; /* holds zlib compression memory level */
int zlib_strategy; /* holds zlib compression strategy */
/* Added at libpng 1.5.3 */
#if defined(PNG_WRITE_COMPRESSED_TEXT_SUPPORTED) || \
defined(PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION)
int zlib_text_level; /* holds zlib compression level */
int zlib_text_method; /* holds zlib compression method */
int zlib_text_window_bits; /* holds zlib compression window bits */
int zlib_text_mem_level; /* holds zlib compression memory level */
int zlib_text_strategy; /* holds zlib compression strategy */
#endif
/* End of material added at libpng 1.5.3 */
png_uint_32 width; /* width of image in pixels */
png_uint_32 height; /* height of image in pixels */

View File

@@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng
*
* Last changed in libpng 1.5.0 [January 6, 2011]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -913,6 +913,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
# endif
#endif
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
/* Normally one would use Z_DEFAULT_STRATEGY for text compression.
* This is here just to make pngtest replicate the results from libpng
* versions prior to 1.5.3, and to test this new API.
*/
png_set_text_compression_strategy(write_ptr, Z_FILTERED);
#endif
if (status_dots_requested == 1)
{
#ifdef PNG_WRITE_SUPPORTED
@@ -1784,4 +1792,4 @@ main(int argc, char *argv[])
}
/* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_5_2rc02 Your_png_h_is_not_version_1_5_2rc02;
typedef png_libpng_version_1_5_3beta03 Your_png_h_is_not_version_1_5_3beta03;

View File

@@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -442,7 +442,11 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
/* At the start sp will point to the first byte to copy and dp to where
* it is copied to. ep always points just beyond the end of the row, so
* the loop simply copies (channels-1) channels until sp reaches ep.
*
* at_start: 0 -- convert AG, XG, ARGB, XRGB, AAGG, XXGG, etc.
* : nonzero -- convert GA, GX, RGBA, RGBX, GGAA, RRGGBBXX, etc.
*/
/* GA, GX, XG cases */
if (row_info->channels == 2)
{

View File

@@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.2 [March 31, 2011]
* Copyright (c) 2011 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*

View File

@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
* Last changed in libpng 1.5.1 [February 3, 2011]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -1177,7 +1177,7 @@ png_set_filter(png_structp png_ptr, int method, int filters)
* better compression.
*/
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* GRR 970116 */
/* Conveneince reset API. */
/* Convenience reset API. */
static void
png_reset_filter_heuristics(png_structp png_ptr)
{
@@ -1491,6 +1491,86 @@ png_set_compression_method(png_structp png_ptr, int method)
png_ptr->zlib_method = method;
}
/* The following were added to libpng-1.5.3 */
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
void PNGAPI
png_set_text_compression_level(png_structp png_ptr, int level)
{
png_debug(1, "in png_set_text_compression_level");
if (png_ptr == NULL)
return;
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_LEVEL;
png_ptr->zlib_text_level = level;
}
void PNGAPI
png_set_text_compression_mem_level(png_structp png_ptr, int mem_level)
{
png_debug(1, "in png_set_text_compression_mem_level");
if (png_ptr == NULL)
return;
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL;
png_ptr->zlib_text_mem_level = mem_level;
}
void PNGAPI
png_set_text_compression_strategy(png_structp png_ptr, int strategy)
{
png_debug(1, "in png_set_text_compression_strategy");
if (png_ptr == NULL)
return;
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_STRATEGY;
png_ptr->zlib_text_strategy = strategy;
}
void PNGAPI
png_set_text_compression_window_bits(png_structp png_ptr, int window_bits)
{
if (png_ptr == NULL)
return;
if (window_bits > 15)
png_warning(png_ptr, "Only compression windows <= 32k supported by PNG");
else if (window_bits < 8)
png_warning(png_ptr, "Only compression windows >= 256 supported by PNG");
#ifndef WBITS_8_OK
/* Avoid libpng bug with 256-byte windows */
if (window_bits == 8)
{
png_warning(png_ptr, "Text compression window is being reset to 512");
window_bits = 9;
}
#endif
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS;
png_ptr->zlib_text_window_bits = window_bits;
}
void PNGAPI
png_set_text_compression_method(png_structp png_ptr, int method)
{
png_debug(1, "in png_set_text_compression_method");
if (png_ptr == NULL)
return;
if (method != 8)
png_warning(png_ptr, "Only compression method 8 is supported by PNG");
png_ptr->flags |= PNG_FLAG_ZTXT_CUSTOM_METHOD;
png_ptr->zlib_text_method = method;
}
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
/* end of API added to libpng-1.5.3 */
void PNGAPI
png_set_write_status_fn(png_structp png_ptr, png_write_status_ptr write_row_fn)
{

View File

@@ -1,7 +1,7 @@
/* pngwtran.c - transforms the data in a row for PNG writers
*
* Last changed in libpng 1.5.2 [(PENDING RELEASE)]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -45,7 +45,7 @@ png_do_write_transformations(png_structp png_ptr)
#ifdef PNG_WRITE_FILLER_SUPPORTED
if (png_ptr->transformations & PNG_FILLER)
png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1,
!(png_ptr->flags & PNG_FILLER_AFTER));
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
#endif
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED

View File

@@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file
*
* Last changed in libpng 1.5.0 [January 6, 2011]
* Last changed in libpng 1.5.3 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 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.)
@@ -192,7 +192,7 @@ png_write_chunk_end(png_structp png_ptr)
png_write_data(png_ptr, buf, (png_size_t)4);
}
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
/* This pair of functions encapsulates the operation of (a) compressing a
* text string, and (b) issuing it later as a series of chunk data writes.
* The compression_state structure is shared context for these functions
@@ -220,13 +220,12 @@ png_text_compress(png_structp png_ptr,
comp->max_output_ptr = 0;
comp->output_ptr = NULL;
comp->input = NULL;
comp->input_len = 0;
comp->input_len = text_len;
/* We may just want to pass the text right through */
if (compression == PNG_TEXT_COMPRESSION_NONE)
{
comp->input = (png_const_bytep)text;
comp->input_len = text_len;
return((int)text_len);
}
@@ -256,9 +255,41 @@ png_text_compress(png_structp png_ptr,
* wouldn't cause a failure, just a slowdown due to swapping).
*/
if (!(png_ptr->mode & PNG_ZLIB_READY_FOR_ZTXT))
{
/* png_warning(png_ptr, "Initialize compressor for ztxt"); */
/* Free memory from previously opened zstream */
deflateEnd(&png_ptr->zstream);
/* Initialize the compressor for zTXt compression. */
ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_text_level,
png_ptr->zlib_text_method, png_ptr->zlib_text_window_bits,
png_ptr->zlib_text_mem_level, png_ptr->zlib_text_strategy);
if (ret != Z_OK)
{
if (ret == Z_VERSION_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor for text-- version error");
if (ret == Z_STREAM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor for text-- stream error");
if (ret == Z_MEM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor for text-- mem error");
png_error(png_ptr, "zlib failed to initialize compressor for text");
}
png_ptr->mode |= PNG_ZLIB_READY_FOR_ZTXT;
}
/* Set up the compression buffers */
/* TODO: the following cast hides a potential overflow problem. */
png_ptr->zstream.avail_in = (uInt)text_len;
/* NOTE: assume zlib doesn't overwrite the input */
png_ptr->zstream.next_in = (Bytef *)text;
png_ptr->zstream.avail_out = png_ptr->zbuf_size;
@@ -418,6 +449,66 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
return;
}
if (comp->input_len >= 2 && comp->input_len < 16384)
{
unsigned int z_cmf; /* zlib compression method and flags */
/* Optimize the CMF field in the zlib stream. This hack of the zlib
* stream is compliant to the stream specification.
*/
if (comp->num_output_ptr)
z_cmf = comp->output_ptr[0][0];
else
z_cmf = png_ptr->zbuf[0];
if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
{
unsigned int z_cinfo;
unsigned int half_z_window_size;
png_size_t uncompressed_idat_size = comp->input_len;
z_cinfo = z_cmf >> 4;
half_z_window_size = 1 << (z_cinfo + 7);
while (uncompressed_idat_size <= half_z_window_size &&
half_z_window_size >= 256)
{
z_cinfo--;
half_z_window_size >>= 1;
}
z_cmf = (z_cmf & 0x0f) | (z_cinfo << 4);
if (comp->num_output_ptr)
{
if (comp->output_ptr[0][0] != z_cmf)
{
int tmp;
comp->output_ptr[0][0] = (png_byte)z_cmf;
tmp = comp->output_ptr[0][1] & 0xe0;
tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
comp->output_ptr[0][1] = (png_byte)tmp;
}
}
else
{
int tmp;
png_ptr->zbuf[0] = (png_byte)z_cmf;
tmp = png_ptr->zbuf[1] & 0xe0;
tmp += 0x1f - ((z_cmf << 8) + tmp) % 0x1f;
png_ptr->zbuf[1] = (png_byte)tmp;
}
}
else
png_error(png_ptr,
"Invalid zlib compression method or flags in non-IDAT chunk");
}
/* Write saved output buffers, if any */
for (i = 0; i < comp->num_output_ptr; i++)
{
@@ -437,9 +528,8 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
/* Reset zlib for another zTXt/iTXt or image data */
deflateReset(&png_ptr->zstream);
png_ptr->zstream.data_type = Z_BINARY;
}
#endif
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
/* Write the IHDR chunk, and update the png_struct with the necessary
* information. Note that the rest of this code depends upon this
@@ -632,35 +722,37 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD))
png_ptr->zlib_method = 8;
#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
#ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_STRATEGY))
png_ptr->zlib_text_strategy = Z_DEFAULT_STRATEGY;
if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_LEVEL))
png_ptr->zlib_text_level = png_ptr->zlib_level;
if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_MEM_LEVEL))
png_ptr->zlib_text_mem_level = png_ptr->zlib_mem_level;
if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_WINDOW_BITS))
png_ptr->zlib_text_window_bits = png_ptr->zlib_window_bits;
if (!(png_ptr->flags & PNG_FLAG_ZTXT_CUSTOM_METHOD))
png_ptr->zlib_text_method = png_ptr->zlib_method;
#else
png_ptr->zlib_text_strategy = Z_DEFAULT_STRATEGY;
png_ptr->zlib_text_level = png_ptr->zlib_level;
png_ptr->zlib_text_mem_level = png_ptr->zlib_mem_level;
png_ptr->zlib_text_window_bits = png_ptr->zlib_window_bits;
png_ptr->zlib_text_method = png_ptr->zlib_method;
#endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION */
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
/* Initialize the zlib compressor */
ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
png_ptr->zlib_method, png_ptr->zlib_window_bits,
png_ptr->zlib_mem_level, png_ptr->zlib_strategy);
if (ret != Z_OK)
{
if (ret == Z_VERSION_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- version error");
if (ret == Z_STREAM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- stream error");
if (ret == Z_MEM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- mem error");
png_error(png_ptr, "zlib failed to initialize compressor");
}
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
/* libpng is not interested in zstream.data_type, so set it
* to a predefined value, to avoid its evaluation inside zlib
*/
png_ptr->zstream.data_type = Z_BINARY;
png_ptr->mode = PNG_HAVE_IHDR;
png_ptr->mode = PNG_HAVE_IHDR; /* not READY_FOR_ZTXT */
}
/* Write the palette. We are careful not to trust png_color to be in the
@@ -745,12 +837,56 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
png_debug(1, "in png_write_IDAT");
/* Optimize the CMF field in the zlib stream. */
/* This hack of the zlib stream is compliant to the stream specification. */
if (!(png_ptr->mode & PNG_HAVE_IDAT) &&
png_ptr->compression_type == PNG_COMPRESSION_TYPE_BASE)
{
unsigned int z_cmf = data[0]; /* zlib compression method and flags */
unsigned int z_cmf; /* zlib compression method and flags */
#ifdef PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
int ret;
/* Reinitialize the compressor if necessary */
if (png_ptr->mode & PNG_ZLIB_READY_FOR_ZTXT)
{
/* Free memory from previously opened zstream */
deflateEnd(&png_ptr->zstream);
ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
png_ptr->zlib_method, png_ptr->zlib_window_bits,
png_ptr->zlib_mem_level, png_ptr->zlib_strategy);
if (ret != Z_OK)
{
if (ret == Z_VERSION_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- version error");
if (ret == Z_STREAM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- stream error");
if (ret == Z_MEM_ERROR)
png_error(png_ptr,
"zlib failed to initialize compressor -- mem error");
png_error(png_ptr, "zlib failed to initialize compressor");
}
png_ptr->mode &= ~PNG_ZLIB_READY_FOR_ZTXT; /* Ready for IDAT */
}
#endif /* PNG_WRITE_COMPRESSED_TEXT_SUPPORTED */
png_ptr->zstream.next_out = png_ptr->zbuf;
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
/* libpng is not interested in zstream.data_type, so set it
* to a predefined value, to avoid its evaluation inside zlib
*/
png_ptr->zstream.data_type = Z_BINARY;
/* Optimize the CMF field in the zlib stream. This hack of the zlib
* stream is compliant to the stream specification.
*/
z_cmf = data[0];
if ((z_cmf & 0x0f) == 8 && (z_cmf & 0xf0) <= 0x70)
{
/* Avoid memory underflows and multiplication overflows.
@@ -761,11 +897,29 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
if (length >= 2 &&
png_ptr->height < 16384 && png_ptr->width < 16384)
{
/* Compute the maximum possible length of the datastream */
/* Number of pixels, plus for each row a filter byte and possible
* and possibly a padding byte, so increase the maximum
* size to account for these.
*/
unsigned int z_cinfo;
unsigned int half_z_window_size;
png_uint_32 uncompressed_idat_size = png_ptr->height *
((png_ptr->width *
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
unsigned int z_cinfo = z_cmf >> 4;
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
/* If it's interlaced, each block of 8 rows is sent as up to
* 14 rows, i.e., 6 additional rows, each with a filter byte
* and possibly a padding byte
*/
if (png_ptr->interlaced)
uncompressed_idat_size += ((png_ptr->height + 7)/8) *
(png_ptr->bit_depth < 8 ? 12 : 6);
z_cinfo = z_cmf >> 4;
half_z_window_size = 1 << (z_cinfo + 7);
while (uncompressed_idat_size <= half_z_window_size &&
half_z_window_size >= 256)
{
@@ -918,7 +1072,10 @@ png_write_iCCP(png_structp png_ptr, png_const_charp name, int compression_type,
(png_size_t)(name_len + 2));
if (profile_len)
{
comp.input_len = profile_len;
png_write_compressed_data_out(png_ptr, &comp);
}
png_write_chunk_end(png_ptr);
png_free(png_ptr, new_name);
@@ -1499,6 +1656,7 @@ png_write_zTXt(png_structp png_ptr, png_const_charp key, png_const_charp text,
png_write_chunk_data(png_ptr, &buf, (png_size_t)1);
/* Write the compressed data */
comp.input_len = text_len;
png_write_compressed_data_out(png_ptr, &comp);
/* Close the chunk */

View File

@@ -1,7 +1,7 @@
VisualStudio instructions
libpng version 1.5.2rc02 - March 22, 2011
libpng version 1.5.3beta03 - April 17, 2011
Copyright (c) 1998-2010 Glenn Randers-Pehrson

View File

@@ -2,9 +2,9 @@
<!--
* zlib.props - location of zlib source
*
* libpng version 1.5.2rc02 - March 22, 2011
* libpng version 1.5.3beta03 - April 17, 2011
*
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -24,7 +24,11 @@
If you use a relative directory name (as below) then it must be
relative to the project directories; these are one level deepers than
the directories containing this file.
If the version of zlib you use does not match that used when the
distribution was built you will get warnings from pngtest that the zlib
versions do not match. The zlib version used in this build is recorded
below:
-->
<ZLibSrcDir>..\..\..\..\zlib-1.2.4</ZLibSrcDir>
<ZLibSrcDir>..\..\..\..\zlib-1.2.5</ZLibSrcDir>
</PropertyGroup>
</Project>

View File

@@ -1,9 +1,9 @@
Makefiles for libpng version 1.5.2rc02 - March 22, 2011
Makefiles for libpng version 1.5.3beta03 - April 17, 2011
pnglibconf.h.prebuilt => Stores configuration settings
makefile.linux => Linux/ELF makefile
(gcc, creates libpng15.so.15.1.5.2rc02)
(gcc, creates libpng15.so.15.1.5.3beta03)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
@@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.dec => DEC Alpha UNIX makefile
makefile.dj2 => DJGPP 2 makefile
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng15.so.15.1.5.2rc02)
(gcc, creates libpng15.so.15.1.5.3beta03)
makefile.freebsd => FreeBSD makefile
makefile.gcc => Generic gcc makefile
makefile.hpgcc => HPUX makefile using gcc
@@ -35,12 +35,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc,
creates libpng15.so.15.1.5.2rc02)
creates libpng15.so.15.1.5.3beta03)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng15.so.15.1.5.2rc02)
creates libpng15.so.15.1.5.3beta03)
makefile.so9 => Solaris 9 makefile (gcc,
creates libpng15.so.15.1.5.2rc02)
creates libpng15.so.15.1.5.3beta03)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile

View File

@@ -11,7 +11,7 @@
# Modeled after libxml-config.
version=1.5.2rc02
version=1.5.3beta03
prefix=""
libdir=""
libs=""

View File

@@ -5,6 +5,6 @@ includedir=@includedir@/libpng15
Name: libpng
Description: Loads and saves PNG files
Version: 1.5.2rc02
Version: 1.5.3beta03
Libs: -L${libdir} -lpng15
Cflags: -I${includedir}

View File

@@ -23,7 +23,7 @@
VERMAJ = 1
VERMIN = 5
VERMIC = 2
VERMIC = 3
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
NAME = libpng
PACKAGE = $(NAME)-$(VER)

View File

@@ -10,7 +10,7 @@
# Library name:
LIBNAME = libpng15
PNGMAJ = 15
RELEASE = 2
RELEASE = 3
# Shared library names:
LIBSO=$(LIBNAME).so

View File

@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15
LIB= png15
SHLIB_MAJOR= 0
SHLIB_MINOR= 1.5.2rc02
SHLIB_MINOR= 1.5.3beta03
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
LIB= png
SHLIB_MAJOR= 15
SHLIB_MINOR= 1.5.2rc02
SHLIB_MINOR= 1.5.3beta03
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 15
SHLIB_MINOR= 1.5.2rc02
SHLIB_MINOR= 1.5.3beta03
LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \

View File

@@ -386,6 +386,11 @@ option WRITE_FLUSH requires WRITE
option USER_TRANSFORM_PTR if READ_USER_TRANSFORM WRITE_USER_TRANSFORM
option USER_TRANSFORM_INFO if READ_USER_TRANSFORM WRITE_USER_TRANSFORM
# This enables API to set compression parameters for compressing
# non-IDAT chunks (zTXt, iTXt, iCCP, and unknown chunks). This feature
# was added at libpng-1.5.3.
option WRITE_CUSTOMIZE_ZTXT_COMPRESSION requires WRITE
# Any chunks you are not interested in, you can undef here. The
# ones that allocate memory may be expecially important (hIST,
# tEXt, zTXt, tRNS, pCAL). Others will just save time and make png_info
@@ -501,7 +506,7 @@ chunk cHRM
chunk gAMA
chunk hIST
chunk iCCP
chunk iTXt requires TEXT
chunk iTXt
chunk oFFs
chunk pCAL
chunk sCAL
@@ -512,7 +517,7 @@ chunk sRGB
chunk tEXt requires TEXT
chunk tIME
chunk tRNS
chunk zTXt requires TEXT
chunk zTXt
# This only affects support of the optional PLTE chunk in RGB and RGBA
# images. Notice that READ_ANCILLARY_CHUNKS therefore disables part
@@ -541,9 +546,19 @@ option SAVE_INT_32 requires WRITE
# png_save_int_32 is required by the ancillary chunks oFFs and pCAL
option READ_iCCP enables READ_COMPRESSED_TEXT
option READ_iTXt enables READ_COMPRESSED_TEXT
option READ_zTXt enables READ_COMPRESSED_TEXT
option READ_COMPRESSED_TEXT enables READ_TEXT
option WRITE_oFFs enables SAVE_INT_32
option WRITE_pCAL enables SAVE_INT_32
option WRITE_iCCP enables WRITE_COMPRESSED_TEXT
option WRITE_iTXt enables WRITE_COMPRESSED_TEXT
option WRITE_zTXt enables WRITE_COMPRESSED_TEXT
option WRITE_COMPRESSED_TEXT enables WRITE_TEXT
# Turn this off to disable png_read_png() and png_write_png() and
# leave the row_pointers member out of the info structure.

View File

@@ -113,6 +113,7 @@
#define PNG_READ_USER_CHUNKS_SUPPORTED
#define PNG_READ_USER_TRANSFORM_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
#define PNG_SAVE_INT_32_SUPPORTED
#define PNG_sBIT_SUPPORTED
#define PNG_sCAL_SUPPORTED
@@ -151,6 +152,7 @@
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_SUPPORTED
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION
#define PNG_WRITE_iTXt_SUPPORTED
#define PNG_WRITE_oFFs_SUPPORTED
#define PNG_WRITE_PACK_SUPPORTED
@@ -175,6 +177,7 @@
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_zTXt_SUPPORTED
#define PNG_zTXt_SUPPORTED
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
/*#undef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED*/
/* end of options */

View File

@@ -5,7 +5,7 @@
LIBRARY
EXPORTS
;Version 1.5.2rc02
;Version 1.5.3beta03
png_access_version_number @1
png_set_sig_bytes @2
png_sig_cmp @3
@@ -227,3 +227,8 @@ EXPORTS
png_process_data_pause @219
png_process_data_skip @220
png_set_expand_16 @221
png_set_text_compression_level @222
png_set_text_compression_mem_level @223
png_set_text_compression_strategy @224
png_set_text_compression_window_bits @225
png_set_text_compression_method @226