Imported from libpng-1.2.34beta03.tar

This commit is contained in:
Glenn Randers-Pehrson 2008-12-01 08:58:57 -06:00
parent 6b90023764
commit 87c2acdeae
60 changed files with 421 additions and 360 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.2.34beta02 - November 28, 2008 Libpng 1.2.34beta03 - December 1, 2008
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.
@ -9,37 +9,37 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
libpng-1.2.34beta02.tar.gz libpng-1.2.34beta03.tar.gz
libpng-1.2.34beta02.tar.lzma libpng-1.2.34beta03.tar.lzma
(Get the lzma codec from <http://tukaani.org/lzma>). (Get the lzma codec from <http://tukaani.org/lzma>).
libpng-1.2.34beta02.tar.bz2 libpng-1.2.34beta03.tar.bz2
Source files with LF line endings (for Unix/Linux) without the Source files with LF line endings (for Unix/Linux) without the
"configure" script "configure" script
libpng-1.2.34beta02-no-config.tar.gz libpng-1.2.34beta03-no-config.tar.gz
libpng-1.2.34beta02-no-config.tar.lzma libpng-1.2.34beta03-no-config.tar.lzma
libpng-1.2.34beta02-no-config.tar.bz2 libpng-1.2.34beta03-no-config.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp1234b02.zip lp1234b03.zip
lp1234b02.7z lp1234b03.7z
lp1234b02.tar.bz2 lp1234b03.tar.bz2
Project files Project files
libpng-1.2.34beta02-project-netware.zip libpng-1.2.34beta03-project-netware.zip
libpng-1.2.34beta02-project-wince.zip libpng-1.2.34beta03-project-wince.zip
Other information: Other information:
libpng-1.2.34beta02-README.txt libpng-1.2.34beta03-README.txt
libpng-1.2.34beta02-KNOWNBUGS.txt libpng-1.2.34beta03-KNOWNBUGS.txt
libpng-1.2.34beta02-LICENSE.txt libpng-1.2.34beta03-LICENSE.txt
libpng-1.2.34beta02-Y2K-compliance.txt libpng-1.2.34beta03-Y2K-compliance.txt
libpng-1.2.34beta02-[previous version]-diff.txt libpng-1.2.34beta03-[previous version]-diff.txt
Changes since the last public release (1.2.32): Changes since the last public release (1.2.32):
@ -74,6 +74,10 @@ version 1.2.34beta02 [November 28, 2008]
Corrected off-by-one error in bKGD validity check in png_write_bKGD() Corrected off-by-one error in bKGD validity check in png_write_bKGD()
and in png_handle_bKGD(). and in png_handle_bKGD().
version 1.2.34beta02 [December 1, 2008]
Revised bKGD validity check to use >= x instead of > x + 1
Merged with png_debug from libpng-1.4.0 to remove newlines.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -2186,7 +2186,7 @@ version 1.2.30beta03 [July 6, 2008]
version 1.2.30beta04 [July 10, 2008] version 1.2.30beta04 [July 10, 2008]
Merged more cosmetic whitespace changes from libpng-1.4.0beta19. Merged more cosmetic whitespace changes from libpng-1.4.0beta19.
version 1.0.38rc01, 1.2.30rc01 [November 28, 2008] version 1.0.38rc01, 1.2.30rc01 [December 1, 2008]
No changes. No changes.
version 1.0.38rc02, 1.2.30rc02 [July 21, 2008] version 1.0.38rc02, 1.2.30rc02 [July 21, 2008]
@ -2280,6 +2280,10 @@ version 1.2.34beta02 [November 28, 2008]
Corrected off-by-one error in bKGD validity check in png_write_bKGD() Corrected off-by-one error in bKGD validity check in png_write_bKGD()
and in png_handle_bKGD(). and in png_handle_bKGD().
version 1.2.34beta02 [December 1, 2008]
Revised bKGD validity check to use >= x instead of > x + 1
Merged with png_debug from libpng-1.4.0 to remove newlines.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement

16
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.2.34beta02 - November 28, 2008 Installing libpng version 1.2.34beta03 - December 1, 2008
On Unix/Linux and similar systems, you can simply type On Unix/Linux and similar systems, you can simply type
@ -44,7 +44,7 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed. correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they You can rename the directories that you downloaded (they
might be called "libpng-1.2.34beta02" or "lpng109" and "zlib-1.2.1" might be called "libpng-1.2.34beta03" or "lpng109" and "zlib-1.2.1"
or "zlib121") so that you have directories called "zlib" and "libpng". or "zlib121") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this: Your directory structure should look like this:
@ -101,9 +101,9 @@ include
CMakeLists.txt => "cmake" script CMakeLists.txt => "cmake" script
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning, makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.34beta02) gcc, creates libpng12.so.0.1.2.34beta03)
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34beta02) (gcc, creates libpng12.so.0.1.2.34beta03)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
@ -125,14 +125,14 @@ include
makefile.openbsd => OpenBSD makefile makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, makefile.sggcc => Silicon Graphics (gcc,
creates libpng12.so.0.1.2.34beta02) creates libpng12.so.0.1.2.34beta03)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng12.so.0.1.2.34beta02) creates libpng12.so.0.1.2.34beta03)
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc, makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
creates libpng12.so.0.1.2.34beta02) creates libpng12.so.0.1.2.34beta03)
makefile.so9 => Solaris 9 makefile (gcc, makefile.so9 => Solaris 9 makefile (gcc,
creates libpng12.so.0.1.2.34beta02) creates libpng12.so.0.1.2.34beta03)
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc

View File

@ -1,5 +1,5 @@
Known bugs in libpng version 1.2.34beta02 Known bugs in libpng version 1.2.34beta03
1. February 23, 2006: The custom makefiles don't build libpng with -lz. 1. February 23, 2006: The custom makefiles don't build libpng with -lz.

View File

@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following If you modify libpng you may insert additional notices immediately following
this sentence. this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.34beta02, November 28, 2008, are libpng versions 1.2.6, August 15, 2004, through 1.2.34beta03, December 1, 2008, are
Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5 distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors with the following individual added to the list of Contributing Authors
@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
November 28, 2008 December 1, 2008

View File

@ -86,7 +86,7 @@ EXTRA_DIST= \
${srcdir}/contrib/pngsuite/* \ ${srcdir}/contrib/pngsuite/* \
${srcdir}/contrib/visupng/* \ ${srcdir}/contrib/visupng/* \
$(TESTS) \ $(TESTS) \
example.c libpng-1.2.34beta02.txt pngvcrd.c example.c libpng-1.2.34beta03.txt pngvcrd.c
CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \ CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \
libpng.sym libpng.sym

View File

@ -331,7 +331,7 @@ EXTRA_DIST = \
${srcdir}/contrib/pngsuite/* \ ${srcdir}/contrib/pngsuite/* \
${srcdir}/contrib/visupng/* \ ${srcdir}/contrib/visupng/* \
$(TESTS) \ $(TESTS) \
example.c libpng-1.2.34beta02.txt pngvcrd.c example.c libpng-1.2.34beta03.txt pngvcrd.c
CLEANFILES = pngout.png libpng12.pc libpng12-config libpng.vers \ CLEANFILES = pngout.png libpng12.pc libpng12-config libpng.vers \
libpng.sym libpng.sym

14
README
View File

@ -1,4 +1,4 @@
README for libpng version 1.2.34beta02 - November 28, 2008 (shared library 12.0) README for libpng version 1.2.34beta03 - December 1, 2008 (shared library 12.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
@ -194,11 +194,11 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning, makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.34beta02) gcc, creates libpng12.so.0.1.2.34beta03)
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34beta02) (gcc, creates libpng12.so.0.1.2.34beta03)
makefile.gcmmx => Linux/ELF makefile makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34beta02, (gcc, creates libpng12.so.0.1.2.34beta03,
uses assembler code tuned for Intel MMX platform) uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
@ -220,12 +220,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics makefile.sggcc => Silicon Graphics
(gcc, creates libpng12.so.0.1.2.34beta02) (gcc, creates libpng12.so.0.1.2.34beta03)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng12.so.0.1.2.34beta02) (gcc, creates libpng12.so.0.1.2.34beta03)
makefile.so9 => Solaris 9 makefile makefile.so9 => Solaris 9 makefile
(gcc, creates libpng12.so.0.1.2.34beta02) (gcc, creates libpng12.so.0.1.2.34beta03)
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc

View File

@ -1,13 +1,13 @@
Y2K compliance in libpng: Y2K compliance in libpng:
========================= =========================
November 28, 2008 December 1, 2008
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.34beta02 are Y2K compliant. It is my belief that earlier upward through 1.2.34beta03 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer Libpng only has three year fields. One is a 2-byte unsigned integer

22
configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.62 for libpng 1.2.34beta02. # Generated by GNU Autoconf 2.62 for libpng 1.2.34beta03.
# #
# Report bugs to <png-mng-implement@lists.sourceforge.net>. # Report bugs to <png-mng-implement@lists.sourceforge.net>.
# #
@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package. # Identity of this package.
PACKAGE_NAME='libpng' PACKAGE_NAME='libpng'
PACKAGE_TARNAME='libpng' PACKAGE_TARNAME='libpng'
PACKAGE_VERSION='1.2.34beta02' PACKAGE_VERSION='1.2.34beta03'
PACKAGE_STRING='libpng 1.2.34beta02' PACKAGE_STRING='libpng 1.2.34beta03'
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net' PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
ac_unique_file="pngget.c" ac_unique_file="pngget.c"
@ -1484,7 +1484,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures libpng 1.2.34beta02 to adapt to many kinds of systems. \`configure' configures libpng 1.2.34beta03 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1554,7 +1554,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of libpng 1.2.34beta02:";; short | recursive ) echo "Configuration of libpng 1.2.34beta03:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1661,7 +1661,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
libpng configure 1.2.34beta02 libpng configure 1.2.34beta03
generated by GNU Autoconf 2.62 generated by GNU Autoconf 2.62
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@ -1675,7 +1675,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by libpng $as_me 1.2.34beta02, which was It was created by libpng $as_me 1.2.34beta03, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
$ $0 $@ $ $0 $@
@ -2389,7 +2389,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='libpng' PACKAGE='libpng'
VERSION='1.2.34beta02' VERSION='1.2.34beta03'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -2558,7 +2558,7 @@ fi
PNGLIB_VERSION=1.2.34beta02 PNGLIB_VERSION=1.2.34beta03
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=2 PNGLIB_MINOR=2
PNGLIB_RELEASE=34 PNGLIB_RELEASE=34
@ -13125,7 +13125,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by libpng $as_me 1.2.34beta02, which was This file was extended by libpng $as_me 1.2.34beta03, which was
generated by GNU Autoconf 2.62. Invocation command line was generated by GNU Autoconf 2.62. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -13178,7 +13178,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\ ac_cs_version="\\
libpng config.status 1.2.34beta02 libpng config.status 1.2.34beta03
configured by $0, generated by GNU Autoconf 2.62, configured by $0, generated by GNU Autoconf 2.62,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -18,12 +18,12 @@ AC_PREREQ(2.59)
dnl Version number stuff here: dnl Version number stuff here:
AC_INIT([libpng], [1.2.34beta02], [png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng], [1.2.34beta03], [png-mng-implement@lists.sourceforge.net])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
dnl stop configure from automagically running automake dnl stop configure from automagically running automake
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
PNGLIB_VERSION=1.2.34beta02 PNGLIB_VERSION=1.2.34beta03
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=2 PNGLIB_MINOR=2
PNGLIB_RELEASE=34 PNGLIB_RELEASE=34

View File

@ -2,7 +2,7 @@
#if 0 /* in case someone actually tries to compile this */ #if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng /* example.c - an example of using libpng
* Last changed in libpng 1.2.33 [November 28, 2008] * Last changed in libpng 1.2.33 [December 1, 2008]
* This file has been placed in the public domain by the authors. * This file has been placed in the public domain by the authors.
* Maintained 1998-2008 Glenn Randers-Pehrson * Maintained 1998-2008 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger) * Maintained 1996, 1997 Andreas Dilger)

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.2.34beta02 - November 28, 2008 libpng version 1.2.34beta03 - December 1, 2008
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2008 Glenn Randers-Pehrson Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -9,7 +9,7 @@ libpng.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.2.34beta02 - November 28, 2008 libpng versions 0.97, January 1998, through 1.2.34beta03 - December 1, 2008
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -2852,13 +2852,13 @@ application:
IX. Y2K Compliance in libpng IX. Y2K Compliance in libpng
November 28, 2008 December 1, 2008
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.34beta02 are Y2K compliant. It is my belief that earlier upward through 1.2.34beta03 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "November 28, 2008" .TH LIBPNG 3 "December 1, 2008"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.34beta02 libpng \- Portable Network Graphics (PNG) Reference Library 1.2.34beta03
.SH SYNOPSIS .SH SYNOPSIS
\fI\fB \fI\fB
@ -821,7 +821,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.2.34beta02 - November 28, 2008 libpng version 1.2.34beta03 - December 1, 2008
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2008 Glenn Randers-Pehrson Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -830,7 +830,7 @@ libpng.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.2.34beta02 - November 28, 2008 libpng versions 0.97, January 1998, through 1.2.34beta03 - December 1, 2008
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -3673,13 +3673,13 @@ application:
.SH IX. Y2K Compliance in libpng .SH IX. Y2K Compliance in libpng
November 28, 2008 December 1, 2008
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.34beta02 are Y2K compliant. It is my belief that earlier upward through 1.2.34beta03 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that Libpng only has three year fields. One is a 2-byte unsigned integer that
@ -3931,7 +3931,7 @@ the first widely used release:
1.0.41rc01 10 10041 10.so.0.41[.0] 1.0.41rc01 10 10041 10.so.0.41[.0]
1.2.33 13 10233 12.so.0.33[.0] 1.2.33 13 10233 12.so.0.33[.0]
1.0.41 10 10041 10.so.0.41[.0] 1.0.41 10 10041 10.so.0.41[.0]
1.2.34beta01-02 13 10234 12.so.0.34[.0] 1.2.34beta01-03 13 10234 12.so.0.34[.0]
Henceforth the source version will match the shared-library minor Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be and patch numbers; the shared-library major version number will be
@ -3987,7 +3987,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation. Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.2.34beta02 - November 28, 2008: Libpng version 1.2.34beta03 - December 1, 2008:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@ -4008,7 +4008,7 @@ included in the libpng distribution, the latter shall prevail.)
If you modify libpng you may insert additional notices immediately following If you modify libpng you may insert additional notices immediately following
this sentence. this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.34beta02, November 28, 2008, are libpng versions 1.2.6, August 15, 2004, through 1.2.34beta03, December 1, 2008, are
Copyright (c) 2004,2006-2008 Glenn Randers-Pehrson, and are Copyright (c) 2004,2006-2008 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5 distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors with the following individual added to the list of Contributing Authors
@ -4107,7 +4107,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
November 28, 2008 December 1, 2008
.\" end of man page .\" end of man page

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "November 28, 2008" .TH LIBPNGPF 3 "December 1, 2008"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.34beta02 libpng \- Portable Network Graphics (PNG) Reference Library 1.2.34beta03
(private functions) (private functions)
.SH SYNOPSIS .SH SYNOPSIS
\fB#include <png.h>\fP \fB#include <png.h>\fP

2
png.5
View File

@ -1,4 +1,4 @@
.TH PNG 5 "November 28, 2008" .TH PNG 5 "December 1, 2008"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION

20
png.c
View File

@ -13,7 +13,7 @@
#include "png.h" #include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_34beta02 Your_png_h_is_not_version_1_2_34beta02; typedef version_1_2_34beta03 Your_png_h_is_not_version_1_2_34beta03;
/* Version information for C files. This had better match the version /* Version information for C files. This had better match the version
* string defined in png.h. */ * string defined in png.h. */
@ -93,7 +93,7 @@ void PNGAPI
png_set_sig_bytes(png_structp png_ptr, int num_bytes) png_set_sig_bytes(png_structp png_ptr, int num_bytes)
{ {
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_debug(1, "in png_set_sig_bytes\n"); png_debug(1, "in png_set_sig_bytes");
if (num_bytes > 8) if (num_bytes > 8)
png_error(png_ptr, "Too many bytes for PNG signature."); png_error(png_ptr, "Too many bytes for PNG signature.");
@ -240,7 +240,7 @@ png_create_info_struct(png_structp png_ptr)
{ {
png_infop info_ptr; png_infop info_ptr;
png_debug(1, "in png_create_info_struct\n"); png_debug(1, "in png_create_info_struct");
if (png_ptr == NULL) return (NULL); if (png_ptr == NULL) return (NULL);
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO, info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO,
@ -265,7 +265,7 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
png_infop info_ptr = NULL; png_infop info_ptr = NULL;
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_debug(1, "in png_destroy_info_struct\n"); png_debug(1, "in png_destroy_info_struct");
if (info_ptr_ptr != NULL) if (info_ptr_ptr != NULL)
info_ptr = *info_ptr_ptr; info_ptr = *info_ptr_ptr;
@ -304,7 +304,7 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
if (info_ptr == NULL) return; if (info_ptr == NULL) return;
png_debug(1, "in png_info_init_3\n"); png_debug(1, "in png_info_init_3");
if (png_sizeof(png_info) > png_info_struct_size) if (png_sizeof(png_info) > png_info_struct_size)
{ {
@ -322,7 +322,7 @@ void PNGAPI
png_data_freer(png_structp png_ptr, png_infop info_ptr, png_data_freer(png_structp png_ptr, png_infop info_ptr,
int freer, png_uint_32 mask) int freer, png_uint_32 mask)
{ {
png_debug(1, "in png_data_freer\n"); png_debug(1, "in png_data_freer");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
if (freer == PNG_DESTROY_WILL_FREE_DATA) if (freer == PNG_DESTROY_WILL_FREE_DATA)
@ -339,7 +339,7 @@ void PNGAPI
png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
int num) int num)
{ {
png_debug(1, "in png_free_data\n"); png_debug(1, "in png_free_data");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -593,7 +593,7 @@ if (mask & PNG_FREE_ROWS)
void /* PRIVATE */ void /* PRIVATE */
png_info_destroy(png_structp png_ptr, png_infop info_ptr) png_info_destroy(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_info_destroy\n"); png_debug(1, "in png_info_destroy");
png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1);
@ -632,7 +632,7 @@ png_get_io_ptr(png_structp png_ptr)
void PNGAPI void PNGAPI
png_init_io(png_structp png_ptr, png_FILE_p fp) png_init_io(png_structp png_ptr, png_FILE_p fp)
{ {
png_debug(1, "in png_init_io\n"); png_debug(1, "in png_init_io");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->io_ptr = (png_voidp)fp; png_ptr->io_ptr = (png_voidp)fp;
} }
@ -694,7 +694,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr) png_get_copyright(png_structp png_ptr)
{ {
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.34beta02 - November 28, 2008\n\ return ((png_charp) "\n libpng version 1.2.34beta03 - December 1, 2008\n\
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\ Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1996-1997 Andreas Dilger\n\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");

79
png.h
View File

@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.2.34beta02 - November 28, 2008 * libpng version 1.2.34beta03 - December 1, 2008
* Copyright (c) 1998-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 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.)
@ -8,7 +8,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * 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.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.2.34beta02 - November 28, 2008: Glenn * libpng versions 0.97, January 1998, through 1.2.34beta03 - December 1, 2008: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -212,7 +212,7 @@
* 1.0.41rc01 10 10041 10.so.0.41[.0] * 1.0.41rc01 10 10041 10.so.0.41[.0]
* 1.2.33 13 10233 12.so.0.33[.0] * 1.2.33 13 10233 12.so.0.33[.0]
* 1.0.41 10 10041 10.so.0.41[.0] * 1.0.41 10 10041 10.so.0.41[.0]
* 1.2.34beta01-02 13 10234 12.so.0.34[.0] * 1.2.34beta01-03 13 10234 12.so.0.34[.0]
* *
* Henceforth the source version will match the shared-library major * Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be * and minor numbers; the shared-library major version number will be
@ -242,7 +242,7 @@
* If you modify libpng you may insert additional notices immediately following * If you modify libpng you may insert additional notices immediately following
* this sentence. * this sentence.
* *
* libpng versions 1.2.6, August 15, 2004, through 1.2.34beta02, November 28, 2008, are * libpng versions 1.2.6, August 15, 2004, through 1.2.34beta03, December 1, 2008, are
* Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5 * distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors: * with the following individual added to the list of Contributing Authors:
@ -354,13 +354,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* November 28, 2008 * December 1, 2008
* *
* Since the PNG Development group is an ad-hoc body, we can't make * Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration. * an official declaration.
* *
* This is your unofficial assurance that libpng from version 0.71 and * This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.2.34beta02 are Y2K compliant. It is my belief that earlier * upward through 1.2.34beta03 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant. * versions were also Y2K compliant.
* *
* Libpng only has three year fields. One is a 2-byte unsigned integer * Libpng only has three year fields. One is a 2-byte unsigned integer
@ -416,9 +416,9 @@
*/ */
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.34beta02" #define PNG_LIBPNG_VER_STRING "1.2.34beta03"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.34beta02 - November 28, 2008\n" " libpng version 1.2.34beta03 - December 1, 2008\n"
#define PNG_LIBPNG_VER_SONUM 0 #define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13 #define PNG_LIBPNG_VER_DLLNUM 13
@ -430,7 +430,7 @@
/* This should match the numeric part of the final component of /* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */ * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
#define PNG_LIBPNG_VER_BUILD 02 #define PNG_LIBPNG_VER_BUILD 03
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@ -1475,7 +1475,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h /* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number. * do not agree upon the version number.
*/ */
typedef png_structp version_1_2_34beta02; typedef png_structp version_1_2_34beta03;
typedef png_struct FAR * FAR * png_structpp; typedef png_struct FAR * FAR * png_structpp;
@ -2527,33 +2527,80 @@ extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) #if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
#include <crtdbg.h> #include <crtdbg.h>
#if (PNG_DEBUG > 1) #if (PNG_DEBUG > 1)
#define png_debug(l,m) _RPT0(_CRT_WARN,m) #ifndef _DEBUG
#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) # define _DEBUG
#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) #endif
#ifndef png_debug
#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
#endif
#ifndef png_debug1
#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
#endif
#ifndef png_debug2
#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
#endif
#endif #endif
#else /* PNG_DEBUG_FILE || !_MSC_VER */ #else /* PNG_DEBUG_FILE || !_MSC_VER */
#ifndef PNG_DEBUG_FILE #ifndef PNG_DEBUG_FILE
#define PNG_DEBUG_FILE stderr #define PNG_DEBUG_FILE stderr
#endif /* PNG_DEBUG_FILE */ #endif /* PNG_DEBUG_FILE */
#if (PNG_DEBUG > 1) #if (PNG_DEBUG > 1)
#ifndef png_debug
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
* non-ISO compilers */
#ifdef __STDC__
#define png_debug(l,m) \ #define png_debug(l,m) \
{ \ { \
int num_tabs=l; \ int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
} }
#endif
#ifndef png_debug1
#define png_debug1(l,m,p1) \ #define png_debug1(l,m,p1) \
{ \ { \
int num_tabs=l; \ int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
} }
#endif
#ifndef png_debug2
#define png_debug2(l,m,p1,p2) \ #define png_debug2(l,m,p1,p2) \
{ \ { \
int num_tabs=l; \ int num_tabs=l; \
fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
} }
#endif
#else /* __STDC __ */
#ifndef png_debug
#define png_debug(l,m) \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format);
#endif
#ifndef png_debug1
#define png_debug1(l,m,p1) \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1);
#endif
#ifndef png_debug2
#define png_debug2(l,m,p1,p2) \
int num_tabs=l; \
char format[256]; \
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
m,PNG_STRING_NEWLINE); \
fprintf(PNG_DEBUG_FILE,format,p1,p2);
#endif
#endif /* __STDC __ */
#endif /* (PNG_DEBUG > 1) */ #endif /* (PNG_DEBUG > 1) */
#endif /* _MSC_VER */ #endif /* _MSC_VER */
#endif /* (PNG_DEBUG > 0) */ #endif /* (PNG_DEBUG > 0) */

View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.2.34beta02 - November 28, 2008 * libpng version 1.2.34beta03 - December 1, 2008
* 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-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -798,6 +798,12 @@
# define PNG_USER_HEIGHT_MAX 1000000L # define PNG_USER_HEIGHT_MAX 1000000L
#endif #endif
/* Added at libpng-1.2.34 and 1.4.0 */
#ifndef PNG_STRING_NEWLINE
#define PNG_STRING_NEWLINE "\n"
#endif
/* These are currently experimental features, define them if you want */ /* These are currently experimental features, define them if you want */
/* very little testing */ /* very little testing */

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.2.34 [November 28, 2008] * Last changed in libpng 1.2.34 [December 1, 2008]
* 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-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -120,7 +120,7 @@ png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_pHYs_SUPPORTED) #if defined(PNG_pHYs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_pHYs) if (info_ptr->valid & PNG_INFO_pHYs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter"); png_debug1(1, "in %s retrieval function", "png_get_x_pixels_per_meter");
if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
return (0); return (0);
else return (info_ptr->x_pixels_per_unit); else return (info_ptr->x_pixels_per_unit);
@ -138,7 +138,7 @@ png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_pHYs_SUPPORTED) #if defined(PNG_pHYs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_pHYs) if (info_ptr->valid & PNG_INFO_pHYs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter"); png_debug1(1, "in %s retrieval function", "png_get_y_pixels_per_meter");
if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER)
return (0); return (0);
else return (info_ptr->y_pixels_per_unit); else return (info_ptr->y_pixels_per_unit);
@ -156,7 +156,7 @@ png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_pHYs_SUPPORTED) #if defined(PNG_pHYs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_pHYs) if (info_ptr->valid & PNG_INFO_pHYs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter"); png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter");
if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER || if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER ||
info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit)
return (0); return (0);
@ -176,7 +176,7 @@ png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_pHYs_SUPPORTED) #if defined(PNG_pHYs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_pHYs) if (info_ptr->valid & PNG_INFO_pHYs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio"); png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio");
if (info_ptr->x_pixels_per_unit == 0) if (info_ptr->x_pixels_per_unit == 0)
return ((float)0.0); return ((float)0.0);
else else
@ -197,7 +197,7 @@ png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_oFFs_SUPPORTED) #if defined(PNG_oFFs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_oFFs) if (info_ptr->valid & PNG_INFO_oFFs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns");
if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
return (0); return (0);
else return (info_ptr->x_offset); else return (info_ptr->x_offset);
@ -215,7 +215,7 @@ png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_oFFs_SUPPORTED) #if defined(PNG_oFFs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_oFFs) if (info_ptr->valid & PNG_INFO_oFFs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns");
if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER)
return (0); return (0);
else return (info_ptr->y_offset); else return (info_ptr->y_offset);
@ -233,7 +233,7 @@ png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_oFFs_SUPPORTED) #if defined(PNG_oFFs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_oFFs) if (info_ptr->valid & PNG_INFO_oFFs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns");
if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
return (0); return (0);
else return (info_ptr->x_offset); else return (info_ptr->x_offset);
@ -251,7 +251,7 @@ png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
#if defined(PNG_oFFs_SUPPORTED) #if defined(PNG_oFFs_SUPPORTED)
if (info_ptr->valid & PNG_INFO_oFFs) if (info_ptr->valid & PNG_INFO_oFFs)
{ {
png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns");
if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL)
return (0); return (0);
else return (info_ptr->y_offset); else return (info_ptr->y_offset);
@ -307,7 +307,7 @@ png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs))
{ {
png_debug1(1, "in %s retrieval function\n", "pHYs"); png_debug1(1, "in %s retrieval function", "pHYs");
if (res_x != NULL) if (res_x != NULL)
{ {
*res_x = info_ptr->x_pixels_per_unit; *res_x = info_ptr->x_pixels_per_unit;
@ -364,7 +364,7 @@ png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
&& background != NULL) && background != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "bKGD"); png_debug1(1, "in %s retrieval function", "bKGD");
*background = &(info_ptr->background); *background = &(info_ptr->background);
return (PNG_INFO_bKGD); return (PNG_INFO_bKGD);
} }
@ -381,7 +381,7 @@ png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
{ {
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
{ {
png_debug1(1, "in %s retrieval function\n", "cHRM"); png_debug1(1, "in %s retrieval function", "cHRM");
if (white_x != NULL) if (white_x != NULL)
*white_x = (double)info_ptr->x_white; *white_x = (double)info_ptr->x_white;
if (white_y != NULL) if (white_y != NULL)
@ -412,7 +412,7 @@ png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
{ {
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM))
{ {
png_debug1(1, "in %s retrieval function\n", "cHRM"); png_debug1(1, "in %s retrieval function", "cHRM");
if (white_x != NULL) if (white_x != NULL)
*white_x = info_ptr->int_x_white; *white_x = info_ptr->int_x_white;
if (white_y != NULL) if (white_y != NULL)
@ -444,7 +444,7 @@ png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
&& file_gamma != NULL) && file_gamma != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "gAMA"); png_debug1(1, "in %s retrieval function", "gAMA");
*file_gamma = (double)info_ptr->gamma; *file_gamma = (double)info_ptr->gamma;
return (PNG_INFO_gAMA); return (PNG_INFO_gAMA);
} }
@ -459,7 +459,7 @@ png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
&& int_file_gamma != NULL) && int_file_gamma != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "gAMA"); png_debug1(1, "in %s retrieval function", "gAMA");
*int_file_gamma = info_ptr->int_gamma; *int_file_gamma = info_ptr->int_gamma;
return (PNG_INFO_gAMA); return (PNG_INFO_gAMA);
} }
@ -475,7 +475,7 @@ png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB)
&& file_srgb_intent != NULL) && file_srgb_intent != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "sRGB"); png_debug1(1, "in %s retrieval function", "sRGB");
*file_srgb_intent = (int)info_ptr->srgb_intent; *file_srgb_intent = (int)info_ptr->srgb_intent;
return (PNG_INFO_sRGB); return (PNG_INFO_sRGB);
} }
@ -492,7 +492,7 @@ png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)
&& name != NULL && profile != NULL && proflen != NULL) && name != NULL && profile != NULL && proflen != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "iCCP"); png_debug1(1, "in %s retrieval function", "iCCP");
*name = info_ptr->iccp_name; *name = info_ptr->iccp_name;
*profile = info_ptr->iccp_profile; *profile = info_ptr->iccp_profile;
/* compression_type is a dummy so the API won't have to change /* compression_type is a dummy so the API won't have to change
@ -526,7 +526,7 @@ png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST)
&& hist != NULL) && hist != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "hIST"); png_debug1(1, "in %s retrieval function", "hIST");
*hist = info_ptr->hist; *hist = info_ptr->hist;
return (PNG_INFO_hIST); return (PNG_INFO_hIST);
} }
@ -544,7 +544,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&
bit_depth != NULL && color_type != NULL) bit_depth != NULL && color_type != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "IHDR"); png_debug1(1, "in %s retrieval function", "IHDR");
*width = info_ptr->width; *width = info_ptr->width;
*height = info_ptr->height; *height = info_ptr->height;
*bit_depth = info_ptr->bit_depth; *bit_depth = info_ptr->bit_depth;
@ -588,7 +588,7 @@ png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs)
&& offset_x != NULL && offset_y != NULL && unit_type != NULL) && offset_x != NULL && offset_y != NULL && unit_type != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "oFFs"); png_debug1(1, "in %s retrieval function", "oFFs");
*offset_x = info_ptr->x_offset; *offset_x = info_ptr->x_offset;
*offset_y = info_ptr->y_offset; *offset_y = info_ptr->y_offset;
*unit_type = (int)info_ptr->offset_unit_type; *unit_type = (int)info_ptr->offset_unit_type;
@ -608,7 +608,7 @@ png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
&& purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL &&
nparams != NULL && units != NULL && params != NULL) nparams != NULL && units != NULL && params != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "pCAL"); png_debug1(1, "in %s retrieval function", "pCAL");
*purpose = info_ptr->pcal_purpose; *purpose = info_ptr->pcal_purpose;
*X0 = info_ptr->pcal_X0; *X0 = info_ptr->pcal_X0;
*X1 = info_ptr->pcal_X1; *X1 = info_ptr->pcal_X1;
@ -668,7 +668,7 @@ png_get_pHYs(png_structp png_ptr, png_infop info_ptr,
if (png_ptr != NULL && info_ptr != NULL && if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs)) (info_ptr->valid & PNG_INFO_pHYs))
{ {
png_debug1(1, "in %s retrieval function\n", "pHYs"); png_debug1(1, "in %s retrieval function", "pHYs");
if (res_x != NULL) if (res_x != NULL)
{ {
*res_x = info_ptr->x_pixels_per_unit; *res_x = info_ptr->x_pixels_per_unit;
@ -696,10 +696,10 @@ png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE)
&& palette != NULL) && palette != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "PLTE"); png_debug1(1, "in %s retrieval function", "PLTE");
*palette = info_ptr->palette; *palette = info_ptr->palette;
*num_palette = info_ptr->num_palette; *num_palette = info_ptr->num_palette;
png_debug1(3, "num_palette = %d\n", *num_palette); png_debug1(3, "num_palette = %d", *num_palette);
return (PNG_INFO_PLTE); return (PNG_INFO_PLTE);
} }
return (0); return (0);
@ -712,7 +712,7 @@ png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT)
&& sig_bit != NULL) && sig_bit != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "sBIT"); png_debug1(1, "in %s retrieval function", "sBIT");
*sig_bit = &(info_ptr->sig_bit); *sig_bit = &(info_ptr->sig_bit);
return (PNG_INFO_sBIT); return (PNG_INFO_sBIT);
} }
@ -727,7 +727,7 @@ png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
{ {
if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
{ {
png_debug1(1, "in %s retrieval function\n", png_debug1(1, "in %s retrieval function",
(png_ptr->chunk_name[0] == '\0' ? "text" (png_ptr->chunk_name[0] == '\0' ? "text"
: (png_const_charp)png_ptr->chunk_name)); : (png_const_charp)png_ptr->chunk_name));
if (text_ptr != NULL) if (text_ptr != NULL)
@ -749,7 +749,7 @@ png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME)
&& mod_time != NULL) && mod_time != NULL)
{ {
png_debug1(1, "in %s retrieval function\n", "tIME"); png_debug1(1, "in %s retrieval function", "tIME");
*mod_time = &(info_ptr->mod_time); *mod_time = &(info_ptr->mod_time);
return (PNG_INFO_tIME); return (PNG_INFO_tIME);
} }
@ -765,7 +765,7 @@ png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
png_uint_32 retval = 0; png_uint_32 retval = 0;
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
{ {
png_debug1(1, "in %s retrieval function\n", "tRNS"); png_debug1(1, "in %s retrieval function", "tRNS");
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{ {
if (trans != NULL) if (trans != NULL)

View File

@ -47,7 +47,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
int i; int i;
png_debug(1, "in png_create_read_struct\n"); png_debug(1, "in png_create_read_struct");
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
@ -263,7 +263,7 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
} }
} while (png_libpng_ver[i++]); } while (png_libpng_ver[i++]);
png_debug(1, "in png_read_init_3\n"); png_debug(1, "in png_read_init_3");
#ifdef PNG_SETJMP_SUPPORTED #ifdef PNG_SETJMP_SUPPORTED
/* save jump buffer and error functions */ /* save jump buffer and error functions */
@ -327,7 +327,7 @@ void PNGAPI
png_read_info(png_structp png_ptr, png_infop info_ptr) png_read_info(png_structp png_ptr, png_infop info_ptr)
{ {
if (png_ptr == NULL || info_ptr == NULL) return; if (png_ptr == NULL || info_ptr == NULL) return;
png_debug(1, "in png_read_info\n"); png_debug(1, "in png_read_info");
/* If we haven't checked all of the PNG signature bytes, do so now. */ /* If we haven't checked all of the PNG signature bytes, do so now. */
if (png_ptr->sig_bytes < 8) if (png_ptr->sig_bytes < 8)
{ {
@ -533,7 +533,7 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
void PNGAPI void PNGAPI
png_read_update_info(png_structp png_ptr, png_infop info_ptr) png_read_update_info(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_read_update_info\n"); png_debug(1, "in png_read_update_info");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
png_read_start_row(png_ptr); png_read_start_row(png_ptr);
@ -552,7 +552,7 @@ png_read_update_info(png_structp png_ptr, png_infop info_ptr)
void PNGAPI void PNGAPI
png_start_read_image(png_structp png_ptr) png_start_read_image(png_structp png_ptr)
{ {
png_debug(1, "in png_start_read_image\n"); png_debug(1, "in png_start_read_image");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
png_read_start_row(png_ptr); png_read_start_row(png_ptr);
@ -571,7 +571,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
#endif #endif
int ret; int ret;
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_debug2(1, "in png_read_row (row %lu, pass %d)\n", png_debug2(1, "in png_read_row (row %lu, pass %d)",
png_ptr->row_number, png_ptr->pass); png_ptr->row_number, png_ptr->pass);
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
png_read_start_row(png_ptr); png_read_start_row(png_ptr);
@ -822,7 +822,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
png_bytepp rp; png_bytepp rp;
png_bytepp dp; png_bytepp dp;
png_debug(1, "in png_read_rows\n"); png_debug(1, "in png_read_rows");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
rp = row; rp = row;
dp = display_row; dp = display_row;
@ -871,7 +871,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
int pass, j; int pass, j;
png_bytepp rp; png_bytepp rp;
png_debug(1, "in png_read_image\n"); png_debug(1, "in png_read_image");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
#ifdef PNG_READ_INTERLACING_SUPPORTED #ifdef PNG_READ_INTERLACING_SUPPORTED
@ -907,7 +907,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
void PNGAPI void PNGAPI
png_read_end(png_structp png_ptr, png_infop info_ptr) png_read_end(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_read_end\n"); png_debug(1, "in png_read_end");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
@ -1087,7 +1087,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
png_voidp mem_ptr = NULL; png_voidp mem_ptr = NULL;
#endif #endif
png_debug(1, "in png_destroy_read_struct\n"); png_debug(1, "in png_destroy_read_struct");
if (png_ptr_ptr != NULL) if (png_ptr_ptr != NULL)
png_ptr = *png_ptr_ptr; png_ptr = *png_ptr_ptr;
if (png_ptr == NULL) if (png_ptr == NULL)
@ -1161,7 +1161,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
png_free_ptr free_fn; png_free_ptr free_fn;
#endif #endif
png_debug(1, "in png_read_destroy\n"); png_debug(1, "in png_read_destroy");
if (info_ptr != NULL) if (info_ptr != NULL)
png_info_destroy(png_ptr, info_ptr); png_info_destroy(png_ptr, info_ptr);

View File

@ -27,7 +27,7 @@
void /* PRIVATE */ void /* PRIVATE */
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{ {
png_debug1(4, "reading %d bytes\n", (int)length); png_debug1(4, "reading %d bytes", (int)length);
if (png_ptr->read_data_fn != NULL) if (png_ptr->read_data_fn != NULL)
(*(png_ptr->read_data_fn))(png_ptr, data, length); (*(png_ptr->read_data_fn))(png_ptr, data, length);
else else

View File

@ -21,7 +21,7 @@
void PNGAPI void PNGAPI
png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
{ {
png_debug(1, "in png_set_crc_action\n"); png_debug(1, "in png_set_crc_action");
/* Tell libpng how we react to CRC errors in critical chunks */ /* Tell libpng how we react to CRC errors in critical chunks */
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
switch (crit_action) switch (crit_action)
@ -80,7 +80,7 @@ png_set_background(png_structp png_ptr,
png_color_16p background_color, int background_gamma_code, png_color_16p background_color, int background_gamma_code,
int need_expand, double background_gamma) int need_expand, double background_gamma)
{ {
png_debug(1, "in png_set_background\n"); png_debug(1, "in png_set_background");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
{ {
@ -102,7 +102,7 @@ png_set_background(png_structp png_ptr,
void PNGAPI void PNGAPI
png_set_strip_16(png_structp png_ptr) png_set_strip_16(png_structp png_ptr)
{ {
png_debug(1, "in png_set_strip_16\n"); png_debug(1, "in png_set_strip_16");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_16_TO_8; png_ptr->transformations |= PNG_16_TO_8;
} }
@ -112,7 +112,7 @@ png_set_strip_16(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_strip_alpha(png_structp png_ptr) png_set_strip_alpha(png_structp png_ptr)
{ {
png_debug(1, "in png_set_strip_alpha\n"); png_debug(1, "in png_set_strip_alpha");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
} }
@ -142,7 +142,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
int num_palette, int maximum_colors, png_uint_16p histogram, int num_palette, int maximum_colors, png_uint_16p histogram,
int full_dither) int full_dither)
{ {
png_debug(1, "in png_set_dither\n"); png_debug(1, "in png_set_dither");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_DITHER; png_ptr->transformations |= PNG_DITHER;
@ -526,7 +526,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
void PNGAPI void PNGAPI
png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
{ {
png_debug(1, "in png_set_gamma\n"); png_debug(1, "in png_set_gamma");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) ||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) ||
@ -545,7 +545,7 @@ png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma)
void PNGAPI void PNGAPI
png_set_expand(png_structp png_ptr) png_set_expand(png_structp png_ptr)
{ {
png_debug(1, "in png_set_expand\n"); png_debug(1, "in png_set_expand");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
png_ptr->flags &= ~PNG_FLAG_ROW_INIT; png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
@ -572,7 +572,7 @@ png_set_expand(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_palette_to_rgb(png_structp png_ptr) png_set_palette_to_rgb(png_structp png_ptr)
{ {
png_debug(1, "in png_set_palette_to_rgb\n"); png_debug(1, "in png_set_palette_to_rgb");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
png_ptr->flags &= ~PNG_FLAG_ROW_INIT; png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
@ -583,7 +583,7 @@ png_set_palette_to_rgb(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_expand_gray_1_2_4_to_8(png_structp png_ptr) png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
{ {
png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n"); png_debug(1, "in png_set_expand_gray_1_2_4_to_8");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_EXPAND; png_ptr->transformations |= PNG_EXPAND;
png_ptr->flags &= ~PNG_FLAG_ROW_INIT; png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
@ -596,7 +596,7 @@ png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_gray_1_2_4_to_8(png_structp png_ptr) png_set_gray_1_2_4_to_8(png_structp png_ptr)
{ {
png_debug(1, "in png_set_gray_1_2_4_to_8\n"); png_debug(1, "in png_set_gray_1_2_4_to_8");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
} }
@ -607,7 +607,7 @@ png_set_gray_1_2_4_to_8(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_tRNS_to_alpha(png_structp png_ptr) png_set_tRNS_to_alpha(png_structp png_ptr)
{ {
png_debug(1, "in png_set_tRNS_to_alpha\n"); png_debug(1, "in png_set_tRNS_to_alpha");
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
png_ptr->flags &= ~PNG_FLAG_ROW_INIT; png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
} }
@ -617,7 +617,7 @@ png_set_tRNS_to_alpha(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_gray_to_rgb(png_structp png_ptr) png_set_gray_to_rgb(png_structp png_ptr)
{ {
png_debug(1, "in png_set_gray_to_rgb\n"); png_debug(1, "in png_set_gray_to_rgb");
png_ptr->transformations |= PNG_GRAY_TO_RGB; png_ptr->transformations |= PNG_GRAY_TO_RGB;
png_ptr->flags &= ~PNG_FLAG_ROW_INIT; png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
} }
@ -644,7 +644,7 @@ void PNGAPI
png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
png_fixed_point red, png_fixed_point green) png_fixed_point red, png_fixed_point green)
{ {
png_debug(1, "in png_set_rgb_to_gray\n"); png_debug(1, "in png_set_rgb_to_gray");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
switch(error_action) switch(error_action)
{ {
@ -697,7 +697,7 @@ void PNGAPI
png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
read_user_transform_fn) read_user_transform_fn)
{ {
png_debug(1, "in png_set_read_user_transform_fn\n"); png_debug(1, "in png_set_read_user_transform_fn");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
png_ptr->transformations |= PNG_USER_TRANSFORM; png_ptr->transformations |= PNG_USER_TRANSFORM;
@ -717,7 +717,7 @@ png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
void /* PRIVATE */ void /* PRIVATE */
png_init_read_transformations(png_structp png_ptr) png_init_read_transformations(png_structp png_ptr)
{ {
png_debug(1, "in png_init_read_transformations\n"); png_debug(1, "in png_init_read_transformations");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (png_ptr != NULL) if (png_ptr != NULL)
#endif #endif
@ -1124,7 +1124,7 @@ png_init_read_transformations(png_structp png_ptr)
void /* PRIVATE */ void /* PRIVATE */
png_read_transform_info(png_structp png_ptr, png_infop info_ptr) png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_read_transform_info\n"); png_debug(1, "in png_read_transform_info");
#if defined(PNG_READ_EXPAND_SUPPORTED) #if defined(PNG_READ_EXPAND_SUPPORTED)
if (png_ptr->transformations & PNG_EXPAND) if (png_ptr->transformations & PNG_EXPAND)
{ {
@ -1268,7 +1268,7 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
void /* PRIVATE */ void /* PRIVATE */
png_do_read_transformations(png_structp png_ptr) png_do_read_transformations(png_structp png_ptr)
{ {
png_debug(1, "in png_do_read_transformations\n"); png_debug(1, "in png_do_read_transformations");
if (png_ptr->row_buf == NULL) if (png_ptr->row_buf == NULL)
{ {
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
@ -1514,7 +1514,7 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
void /* PRIVATE */ void /* PRIVATE */
png_do_unpack(png_row_infop row_info, png_bytep row) png_do_unpack(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_unpack\n"); png_debug(1, "in png_do_unpack");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL && row_info->bit_depth < 8) if (row != NULL && row_info != NULL && row_info->bit_depth < 8)
#else #else
@ -1604,7 +1604,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
{ {
png_debug(1, "in png_do_unshift\n"); png_debug(1, "in png_do_unshift");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && sig_bits != NULL && row != NULL && row_info != NULL && sig_bits != NULL &&
@ -1710,7 +1710,7 @@ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
void /* PRIVATE */ void /* PRIVATE */
png_do_chop(png_row_infop row_info, png_bytep row) png_do_chop(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_chop\n"); png_debug(1, "in png_do_chop");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL && row_info->bit_depth == 16) if (row != NULL && row_info != NULL && row_info->bit_depth == 16)
#else #else
@ -1764,7 +1764,7 @@ png_do_chop(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_read_swap_alpha\n"); png_debug(1, "in png_do_read_swap_alpha");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -1856,7 +1856,7 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_read_invert_alpha\n"); png_debug(1, "in png_do_read_invert_alpha");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -1962,7 +1962,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
png_byte hi_filler = (png_byte)((filler>>8) & 0xff); png_byte hi_filler = (png_byte)((filler>>8) & 0xff);
png_byte lo_filler = (png_byte)(filler & 0xff); png_byte lo_filler = (png_byte)(filler & 0xff);
png_debug(1, "in png_do_read_filler\n"); png_debug(1, "in png_do_read_filler");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -2134,7 +2134,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
png_uint_32 i; png_uint_32 i;
png_uint_32 row_width = row_info->width; png_uint_32 row_width = row_info->width;
png_debug(1, "in png_do_gray_to_rgb\n"); png_debug(1, "in png_do_gray_to_rgb");
if (row_info->bit_depth >= 8 && if (row_info->bit_depth >= 8 &&
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -2240,7 +2240,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
png_uint_32 row_width = row_info->width; png_uint_32 row_width = row_info->width;
int rgb_error = 0; int rgb_error = 0;
png_debug(1, "in png_do_rgb_to_gray\n"); png_debug(1, "in png_do_rgb_to_gray");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -2478,7 +2478,7 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
int i; int i;
int v; int v;
png_debug(1, "in png_do_build_grayscale_palette\n"); png_debug(1, "in png_do_build_grayscale_palette");
if (palette == NULL) if (palette == NULL)
return; return;
@ -2520,7 +2520,7 @@ void /* PRIVATE */
png_correct_palette(png_structp png_ptr, png_colorp palette, png_correct_palette(png_structp png_ptr, png_colorp palette,
int num_palette) int num_palette)
{ {
png_debug(1, "in png_correct_palette\n"); png_debug(1, "in png_correct_palette");
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ #if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
@ -2717,7 +2717,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
png_uint_32 row_width=row_info->width; png_uint_32 row_width=row_info->width;
int shift; int shift;
png_debug(1, "in png_do_background\n"); png_debug(1, "in png_do_background");
if (background != NULL && if (background != NULL &&
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -3399,7 +3399,7 @@ png_do_gamma(png_row_infop row_info, png_bytep row,
png_uint_32 i; png_uint_32 i;
png_uint_32 row_width=row_info->width; png_uint_32 row_width=row_info->width;
png_debug(1, "in png_do_gamma\n"); png_debug(1, "in png_do_gamma");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -3581,7 +3581,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
png_uint_32 i; png_uint_32 i;
png_uint_32 row_width=row_info->width; png_uint_32 row_width=row_info->width;
png_debug(1, "in png_do_expand_palette\n"); png_debug(1, "in png_do_expand_palette");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -3724,7 +3724,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
png_uint_32 i; png_uint_32 i;
png_uint_32 row_width=row_info->width; png_uint_32 row_width=row_info->width;
png_debug(1, "in png_do_expand\n"); png_debug(1, "in png_do_expand");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -3930,7 +3930,7 @@ png_do_dither(png_row_infop row_info, png_bytep row,
png_uint_32 i; png_uint_32 i;
png_uint_32 row_width=row_info->width; png_uint_32 row_width=row_info->width;
png_debug(1, "in png_do_dither\n"); png_debug(1, "in png_do_dither");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -4025,7 +4025,7 @@ static PNG_CONST int png_gamma_shift[] =
void /* PRIVATE */ void /* PRIVATE */
png_build_gamma_table(png_structp png_ptr) png_build_gamma_table(png_structp png_ptr)
{ {
png_debug(1, "in png_build_gamma_table\n"); png_debug(1, "in png_build_gamma_table");
if (png_ptr->bit_depth <= 8) if (png_ptr->bit_depth <= 8)
{ {
@ -4238,7 +4238,7 @@ png_build_gamma_table(png_structp png_ptr)
void /* PRIVATE */ void /* PRIVATE */
png_do_read_intrapixel(png_row_infop row_info, png_bytep row) png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_read_intrapixel\n"); png_debug(1, "in png_do_read_intrapixel");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&

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.2.34 [November 28, 2008] * Last changed in libpng 1.2.34 [December 1, 2008]
* 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-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -1399,7 +1399,7 @@ png_handle_bKGD(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_ptr->background.index = buf[0]; png_ptr->background.index = buf[0];
if (info_ptr && info_ptr->num_palette) if (info_ptr && info_ptr->num_palette)
{ {
if (buf[0] > info_ptr->num_palette - 1) if (buf[0] >= info_ptr->num_palette)
{ {
png_warning(png_ptr, "Incorrect bKGD chunk index value"); png_warning(png_ptr, "Incorrect bKGD chunk index value");
return; return;

View File

@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct /* pngset.c - storage of image information into info struct
* *
* Last changed in libpng 1.2.34 [November 28, 2008] * Last changed in libpng 1.2.34 [December 1, 2008]
* 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-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -21,7 +21,7 @@
void PNGAPI void PNGAPI
png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background)
{ {
png_debug1(1, "in %s storage function\n", "bKGD"); png_debug1(1, "in %s storage function", "bKGD");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -37,7 +37,7 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
double white_x, double white_y, double red_x, double red_y, double white_x, double white_y, double red_x, double red_y,
double green_x, double green_y, double blue_x, double blue_y) double green_x, double green_y, double blue_x, double blue_y)
{ {
png_debug1(1, "in %s storage function\n", "cHRM"); png_debug1(1, "in %s storage function", "cHRM");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -69,7 +69,7 @@ png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y,
png_fixed_point blue_x, png_fixed_point blue_y) png_fixed_point blue_x, png_fixed_point blue_y)
{ {
png_debug1(1, "in %s storage function\n", "cHRM fixed"); png_debug1(1, "in %s storage function", "cHRM fixed");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -108,7 +108,7 @@ void PNGAPI
png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma)
{ {
double gamma; double gamma;
png_debug1(1, "in %s storage function\n", "gAMA"); png_debug1(1, "in %s storage function", "gAMA");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -135,7 +135,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point
{ {
png_fixed_point gamma; png_fixed_point gamma;
png_debug1(1, "in %s storage function\n", "gAMA"); png_debug1(1, "in %s storage function", "gAMA");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -172,7 +172,7 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
{ {
int i; int i;
png_debug1(1, "in %s storage function\n", "hIST"); png_debug1(1, "in %s storage function", "hIST");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
if (info_ptr->num_palette == 0 || info_ptr->num_palette if (info_ptr->num_palette == 0 || info_ptr->num_palette
@ -215,7 +215,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
int color_type, int interlace_type, int compression_type, int color_type, int interlace_type, int compression_type,
int filter_type) int filter_type)
{ {
png_debug1(1, "in %s storage function\n", "IHDR"); png_debug1(1, "in %s storage function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -322,7 +322,7 @@ void PNGAPI
png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_set_oFFs(png_structp png_ptr, png_infop info_ptr,
png_int_32 offset_x, png_int_32 offset_y, int unit_type) png_int_32 offset_x, png_int_32 offset_y, int unit_type)
{ {
png_debug1(1, "in %s storage function\n", "oFFs"); png_debug1(1, "in %s storage function", "oFFs");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -342,12 +342,12 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
png_uint_32 length; png_uint_32 length;
int i; int i;
png_debug1(1, "in %s storage function\n", "pCAL"); png_debug1(1, "in %s storage function", "pCAL");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
length = png_strlen(purpose) + 1; length = png_strlen(purpose) + 1;
png_debug1(3, "allocating purpose for info (%lu bytes)\n", png_debug1(3, "allocating purpose for info (%lu bytes)",
(unsigned long)length); (unsigned long)length);
info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_purpose == NULL) if (info_ptr->pcal_purpose == NULL)
@ -357,14 +357,14 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
} }
png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
png_debug(3, "storing X0, X1, type, and nparams in info\n"); png_debug(3, "storing X0, X1, type, and nparams in info");
info_ptr->pcal_X0 = X0; info_ptr->pcal_X0 = X0;
info_ptr->pcal_X1 = X1; info_ptr->pcal_X1 = X1;
info_ptr->pcal_type = (png_byte)type; info_ptr->pcal_type = (png_byte)type;
info_ptr->pcal_nparams = (png_byte)nparams; info_ptr->pcal_nparams = (png_byte)nparams;
length = png_strlen(units) + 1; length = png_strlen(units) + 1;
png_debug1(3, "allocating units for info (%lu bytes)\n", png_debug1(3, "allocating units for info (%lu bytes)",
(unsigned long)length); (unsigned long)length);
info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_units == NULL) if (info_ptr->pcal_units == NULL)
@ -387,7 +387,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
for (i = 0; i < nparams; i++) for (i = 0; i < nparams; i++)
{ {
length = png_strlen(params[i]) + 1; length = png_strlen(params[i]) + 1;
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, png_debug2(3, "allocating parameter %d for info (%lu bytes)", i,
(unsigned long)length); (unsigned long)length);
info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->pcal_params[i] == NULL) if (info_ptr->pcal_params[i] == NULL)
@ -411,7 +411,7 @@ void PNGAPI
png_set_sCAL(png_structp png_ptr, png_infop info_ptr, png_set_sCAL(png_structp png_ptr, png_infop info_ptr,
int unit, double width, double height) int unit, double width, double height)
{ {
png_debug1(1, "in %s storage function\n", "sCAL"); png_debug1(1, "in %s storage function", "sCAL");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -429,14 +429,14 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
{ {
png_uint_32 length; png_uint_32 length;
png_debug1(1, "in %s storage function\n", "sCAL"); png_debug1(1, "in %s storage function", "sCAL");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
info_ptr->scal_unit = (png_byte)unit; info_ptr->scal_unit = (png_byte)unit;
length = png_strlen(swidth) + 1; length = png_strlen(swidth) + 1;
png_debug1(3, "allocating unit for info (%u bytes)\n", png_debug1(3, "allocating unit for info (%u bytes)",
(unsigned int)length); (unsigned int)length);
info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length); info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->scal_s_width == NULL) if (info_ptr->scal_s_width == NULL)
@ -448,7 +448,7 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length);
length = png_strlen(sheight) + 1; length = png_strlen(sheight) + 1;
png_debug1(3, "allocating unit for info (%u bytes)\n", png_debug1(3, "allocating unit for info (%u bytes)",
(unsigned int)length); (unsigned int)length);
info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length); info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length);
if (info_ptr->scal_s_height == NULL) if (info_ptr->scal_s_height == NULL)
@ -474,7 +474,7 @@ void PNGAPI
png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_set_pHYs(png_structp png_ptr, png_infop info_ptr,
png_uint_32 res_x, png_uint_32 res_y, int unit_type) png_uint_32 res_x, png_uint_32 res_y, int unit_type)
{ {
png_debug1(1, "in %s storage function\n", "pHYs"); png_debug1(1, "in %s storage function", "pHYs");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -490,7 +490,7 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
png_colorp palette, int num_palette) png_colorp palette, int num_palette)
{ {
png_debug1(1, "in %s storage function\n", "PLTE"); png_debug1(1, "in %s storage function", "PLTE");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -539,7 +539,7 @@ void PNGAPI
png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
png_color_8p sig_bit) png_color_8p sig_bit)
{ {
png_debug1(1, "in %s storage function\n", "sBIT"); png_debug1(1, "in %s storage function", "sBIT");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -552,7 +552,7 @@ png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
void PNGAPI void PNGAPI
png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent)
{ {
png_debug1(1, "in %s storage function\n", "sRGB"); png_debug1(1, "in %s storage function", "sRGB");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -579,7 +579,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
int_green_y, int_blue_x, int_blue_y; int_green_y, int_blue_x, int_blue_y;
#endif #endif
png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM\n"); png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -648,7 +648,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
png_charp new_iccp_profile; png_charp new_iccp_profile;
png_uint_32 length; png_uint_32 length;
png_debug1(1, "in %s storage function\n", "iCCP"); png_debug1(1, "in %s storage function", "iCCP");
if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
return; return;
@ -702,7 +702,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
{ {
int i; int i;
png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ? png_debug1(1, "in %s storage function", (png_ptr->chunk_name[0] == '\0' ?
"text" : (png_const_charp)png_ptr->chunk_name)); "text" : (png_const_charp)png_ptr->chunk_name));
if (png_ptr == NULL || info_ptr == NULL || num_text == 0) if (png_ptr == NULL || info_ptr == NULL || num_text == 0)
@ -744,7 +744,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
info_ptr->free_me |= PNG_FREE_TEXT; info_ptr->free_me |= PNG_FREE_TEXT;
#endif #endif
} }
png_debug1(3, "allocated %d entries for info_ptr->text\n", png_debug1(3, "allocated %d entries for info_ptr->text",
info_ptr->max_text); info_ptr->max_text);
} }
for (i = 0; i < num_text; i++) for (i = 0; i < num_text; i++)
@ -804,7 +804,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
(key_len + text_length + lang_len + lang_key_len + 4)); (key_len + text_length + lang_len + lang_key_len + 4));
if (textp->key == NULL) if (textp->key == NULL)
return(1); return(1);
png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n", png_debug2(2, "Allocated %lu bytes at %x in png_set_text",
(png_uint_32) (png_uint_32)
(key_len + lang_len + lang_key_len + text_length + 4), (key_len + lang_len + lang_key_len + text_length + 4),
(int)textp->key); (int)textp->key);
@ -852,7 +852,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
#endif #endif
} }
info_ptr->num_text++; info_ptr->num_text++;
png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); png_debug1(3, "transferred text chunk %d", info_ptr->num_text);
} }
return(0); return(0);
} }
@ -862,7 +862,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
void PNGAPI void PNGAPI
png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
{ {
png_debug1(1, "in %s storage function\n", "tIME"); png_debug1(1, "in %s storage function", "tIME");
if (png_ptr == NULL || info_ptr == NULL || if (png_ptr == NULL || info_ptr == NULL ||
(png_ptr->mode & PNG_WROTE_tIME)) (png_ptr->mode & PNG_WROTE_tIME))
return; return;
@ -877,7 +877,7 @@ void PNGAPI
png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
png_bytep trans, int num_trans, png_color_16p trans_values) png_bytep trans, int num_trans, png_color_16p trans_values)
{ {
png_debug1(1, "in %s storage function\n", "tRNS"); png_debug1(1, "in %s storage function", "tRNS");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -1082,7 +1082,7 @@ png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
{ {
/* This function is deprecated in favor of png_permit_mng_features() /* This function is deprecated in favor of png_permit_mng_features()
and will be removed from libpng-1.3.0 */ and will be removed from libpng-1.3.0 */
png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); png_debug(1, "in png_permit_empty_plte, DEPRECATED.");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->mng_features_permitted = (png_byte) png_ptr->mng_features_permitted = (png_byte)
@ -1096,7 +1096,7 @@ png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
{ {
png_debug(1, "in png_permit_mng_features\n"); png_debug(1, "in png_permit_mng_features");
if (png_ptr == NULL) if (png_ptr == NULL)
return (png_uint_32)0; return (png_uint_32)0;
png_ptr->mng_features_permitted = png_ptr->mng_features_permitted =
@ -1157,7 +1157,7 @@ void PNGAPI
png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
png_user_chunk_ptr read_user_chunk_fn) png_user_chunk_ptr read_user_chunk_fn)
{ {
png_debug(1, "in png_set_read_user_chunk_fn\n"); png_debug(1, "in png_set_read_user_chunk_fn");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->read_user_chunk_fn = read_user_chunk_fn; png_ptr->read_user_chunk_fn = read_user_chunk_fn;
@ -1169,7 +1169,7 @@ png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr,
void PNGAPI void PNGAPI
png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
{ {
png_debug1(1, "in %s storage function\n", "rows"); png_debug1(1, "in %s storage function", "rows");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;

View File

@ -717,7 +717,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
return (1); return (1);
} }
png_debug(0, "Allocating read and write structures\n"); png_debug(0, "Allocating read and write structures");
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
read_ptr = read_ptr =
png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL, png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
@ -758,7 +758,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
pngtest_warning); pngtest_warning);
#endif #endif
#endif #endif
png_debug(0, "Allocating read_info, write_info and end_info structures\n"); png_debug(0, "Allocating read_info, write_info and end_info structures");
read_info_ptr = png_create_info_struct(read_ptr); read_info_ptr = png_create_info_struct(read_ptr);
end_info_ptr = png_create_info_struct(read_ptr); end_info_ptr = png_create_info_struct(read_ptr);
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED
@ -767,7 +767,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#ifdef PNG_SETJMP_SUPPORTED #ifdef PNG_SETJMP_SUPPORTED
png_debug(0, "Setting jmpbuf for read struct\n"); png_debug(0, "Setting jmpbuf for read struct");
#ifdef USE_FAR_KEYWORD #ifdef USE_FAR_KEYWORD
if (setjmp(jmpbuf)) if (setjmp(jmpbuf))
#else #else
@ -791,7 +791,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED
png_debug(0, "Setting jmpbuf for write struct\n"); png_debug(0, "Setting jmpbuf for write struct");
#ifdef USE_FAR_KEYWORD #ifdef USE_FAR_KEYWORD
if (setjmp(jmpbuf)) if (setjmp(jmpbuf))
#else #else
@ -814,7 +814,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#endif #endif
png_debug(0, "Initializing input and output streams\n"); png_debug(0, "Initializing input and output streams");
#if !defined(PNG_NO_STDIO) #if !defined(PNG_NO_STDIO)
png_init_io(read_ptr, fpin); png_init_io(read_ptr, fpin);
# ifdef PNG_WRITE_SUPPORTED # ifdef PNG_WRITE_SUPPORTED
@ -874,10 +874,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_bytep_NULL, 0); png_bytep_NULL, 0);
#endif #endif
png_debug(0, "Reading info struct\n"); png_debug(0, "Reading info struct");
png_read_info(read_ptr, read_info_ptr); png_read_info(read_ptr, read_info_ptr);
png_debug(0, "Transferring info struct\n"); png_debug(0, "Transferring info struct");
{ {
int interlace_type, compression_type, filter_type; int interlace_type, compression_type, filter_type;
@ -1077,7 +1077,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0) if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0)
{ {
png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text);
png_set_text(write_ptr, write_info_ptr, text_ptr, num_text); png_set_text(write_ptr, write_info_ptr, text_ptr, num_text);
} }
} }
@ -1145,7 +1145,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED
png_debug(0, "\nWriting info struct\n"); png_debug(0, "Writing info struct");
/* If we wanted, we could write info in two steps: /* If we wanted, we could write info in two steps:
png_write_info_before_PLTE(write_ptr, write_info_ptr); png_write_info_before_PLTE(write_ptr, write_info_ptr);
@ -1188,12 +1188,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
#ifdef SINGLE_ROWBUF_ALLOC #ifdef SINGLE_ROWBUF_ALLOC
png_debug(0, "\nAllocating row buffer..."); png_debug(0, "Allocating row buffer...");
row_buf = (png_bytep)png_malloc(read_ptr, row_buf = (png_bytep)png_malloc(read_ptr,
png_get_rowbytes(read_ptr, read_info_ptr)); png_get_rowbytes(read_ptr, read_info_ptr));
png_debug1(0, "0x%08lx\n\n", (unsigned long)row_buf); png_debug1(0, "0x%08lx", (unsigned long)row_buf);
#endif /* SINGLE_ROWBUF_ALLOC */ #endif /* SINGLE_ROWBUF_ALLOC */
png_debug(0, "Writing row data\n"); png_debug(0, "Writing row data");
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \ #if defined(PNG_READ_INTERLACING_SUPPORTED) || \
defined(PNG_WRITE_INTERLACING_SUPPORTED) defined(PNG_WRITE_INTERLACING_SUPPORTED)
@ -1212,14 +1212,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif #endif
for (pass = 0; pass < num_pass; pass++) for (pass = 0; pass < num_pass; pass++)
{ {
png_debug1(0, "Writing row data for pass %d\n", pass); png_debug1(0, "Writing row data for pass %d", pass);
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
{ {
#ifndef SINGLE_ROWBUF_ALLOC #ifndef SINGLE_ROWBUF_ALLOC
png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass, y); png_debug2(0, "\nAllocating row buffer (pass %d, y = %ld)...", pass, y);
row_buf = (png_bytep)png_malloc(read_ptr, row_buf = (png_bytep)png_malloc(read_ptr,
png_get_rowbytes(read_ptr, read_info_ptr)); png_get_rowbytes(read_ptr, read_info_ptr));
png_debug2(0, "0x%08lx (%ld bytes)\n", (unsigned long)row_buf, png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf,
png_get_rowbytes(read_ptr, read_info_ptr)); png_get_rowbytes(read_ptr, read_info_ptr));
#endif /* !SINGLE_ROWBUF_ALLOC */ #endif /* !SINGLE_ROWBUF_ALLOC */
png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1); png_read_rows(read_ptr, (png_bytepp)&row_buf, png_bytepp_NULL, 1);
@ -1239,7 +1239,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
#endif /* PNG_WRITE_SUPPORTED */ #endif /* PNG_WRITE_SUPPORTED */
#ifndef SINGLE_ROWBUF_ALLOC #ifndef SINGLE_ROWBUF_ALLOC
png_debug2(0, "Freeing row buffer (pass %d, y = %ld)\n\n", pass, y); png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y);
png_free(read_ptr, row_buf); png_free(read_ptr, row_buf);
row_buf = NULL; row_buf = NULL;
#endif /* !SINGLE_ROWBUF_ALLOC */ #endif /* !SINGLE_ROWBUF_ALLOC */
@ -1253,7 +1253,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1); png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1);
#endif #endif
png_debug(0, "Reading and writing end_info data\n"); png_debug(0, "Reading and writing end_info data");
png_read_end(read_ptr, end_info_ptr); png_read_end(read_ptr, end_info_ptr);
#if defined(PNG_TEXT_SUPPORTED) #if defined(PNG_TEXT_SUPPORTED)
@ -1263,7 +1263,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0) if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0)
{ {
png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks\n", num_text); png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text);
png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text); png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text);
} }
} }
@ -1323,26 +1323,26 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
} }
#endif #endif
png_debug(0, "Destroying data structs\n"); png_debug(0, "Destroying data structs");
#ifdef SINGLE_ROWBUF_ALLOC #ifdef SINGLE_ROWBUF_ALLOC
png_debug(1, "destroying row_buf for read_ptr\n"); png_debug(1, "destroying row_buf for read_ptr");
png_free(read_ptr, row_buf); png_free(read_ptr, row_buf);
row_buf = NULL; row_buf = NULL;
#endif /* SINGLE_ROWBUF_ALLOC */ #endif /* SINGLE_ROWBUF_ALLOC */
png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr\n"); png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr");
png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED
png_debug(1, "destroying write_end_info_ptr\n"); png_debug(1, "destroying write_end_info_ptr");
png_destroy_info_struct(write_ptr, &write_end_info_ptr); png_destroy_info_struct(write_ptr, &write_end_info_ptr);
png_debug(1, "destroying write_ptr, write_info_ptr\n"); png_debug(1, "destroying write_ptr, write_info_ptr");
png_destroy_write_struct(&write_ptr, &write_info_ptr); png_destroy_write_struct(&write_ptr, &write_info_ptr);
#endif #endif
png_debug(0, "Destruction complete.\n"); png_debug(0, "Destruction complete.");
FCLOSE(fpin); FCLOSE(fpin);
FCLOSE(fpout); FCLOSE(fpout);
png_debug(0, "Opening files for comparison\n"); png_debug(0, "Opening files for comparison");
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH); MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE) if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
@ -1685,4 +1685,4 @@ main(int argc, char *argv[])
} }
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_34beta02 your_png_h_is_not_version_1_2_34beta02; typedef version_1_2_34beta03 your_png_h_is_not_version_1_2_34beta03;

View File

@ -17,7 +17,7 @@
void PNGAPI void PNGAPI
png_set_bgr(png_structp png_ptr) png_set_bgr(png_structp png_ptr)
{ {
png_debug(1, "in png_set_bgr\n"); png_debug(1, "in png_set_bgr");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_BGR; png_ptr->transformations |= PNG_BGR;
} }
@ -28,7 +28,7 @@ png_set_bgr(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_swap(png_structp png_ptr) png_set_swap(png_structp png_ptr)
{ {
png_debug(1, "in png_set_swap\n"); png_debug(1, "in png_set_swap");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (png_ptr->bit_depth == 16) if (png_ptr->bit_depth == 16)
png_ptr->transformations |= PNG_SWAP_BYTES; png_ptr->transformations |= PNG_SWAP_BYTES;
@ -40,7 +40,7 @@ png_set_swap(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_packing(png_structp png_ptr) png_set_packing(png_structp png_ptr)
{ {
png_debug(1, "in png_set_packing\n"); png_debug(1, "in png_set_packing");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (png_ptr->bit_depth < 8) if (png_ptr->bit_depth < 8)
{ {
@ -55,7 +55,7 @@ png_set_packing(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_packswap(png_structp png_ptr) png_set_packswap(png_structp png_ptr)
{ {
png_debug(1, "in png_set_packswap\n"); png_debug(1, "in png_set_packswap");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
if (png_ptr->bit_depth < 8) if (png_ptr->bit_depth < 8)
png_ptr->transformations |= PNG_PACKSWAP; png_ptr->transformations |= PNG_PACKSWAP;
@ -66,7 +66,7 @@ png_set_packswap(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_shift(png_structp png_ptr, png_color_8p true_bits) png_set_shift(png_structp png_ptr, png_color_8p true_bits)
{ {
png_debug(1, "in png_set_shift\n"); png_debug(1, "in png_set_shift");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_SHIFT; png_ptr->transformations |= PNG_SHIFT;
png_ptr->shift = *true_bits; png_ptr->shift = *true_bits;
@ -78,7 +78,7 @@ png_set_shift(png_structp png_ptr, png_color_8p true_bits)
int PNGAPI int PNGAPI
png_set_interlace_handling(png_structp png_ptr) png_set_interlace_handling(png_structp png_ptr)
{ {
png_debug(1, "in png_set_interlace handling\n"); png_debug(1, "in png_set_interlace handling");
if (png_ptr && png_ptr->interlaced) if (png_ptr && png_ptr->interlaced)
{ {
png_ptr->transformations |= PNG_INTERLACE; png_ptr->transformations |= PNG_INTERLACE;
@ -98,7 +98,7 @@ png_set_interlace_handling(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
{ {
png_debug(1, "in png_set_filler\n"); png_debug(1, "in png_set_filler");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_FILLER; png_ptr->transformations |= PNG_FILLER;
png_ptr->filler = (png_byte)filler; png_ptr->filler = (png_byte)filler;
@ -131,7 +131,7 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
void PNGAPI void PNGAPI
png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
{ {
png_debug(1, "in png_set_add_alpha\n"); png_debug(1, "in png_set_add_alpha");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_set_filler(png_ptr, filler, filler_loc); png_set_filler(png_ptr, filler, filler_loc);
png_ptr->transformations |= PNG_ADD_ALPHA; png_ptr->transformations |= PNG_ADD_ALPHA;
@ -145,7 +145,7 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
void PNGAPI void PNGAPI
png_set_swap_alpha(png_structp png_ptr) png_set_swap_alpha(png_structp png_ptr)
{ {
png_debug(1, "in png_set_swap_alpha\n"); png_debug(1, "in png_set_swap_alpha");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_SWAP_ALPHA; png_ptr->transformations |= PNG_SWAP_ALPHA;
} }
@ -156,7 +156,7 @@ png_set_swap_alpha(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_invert_alpha(png_structp png_ptr) png_set_invert_alpha(png_structp png_ptr)
{ {
png_debug(1, "in png_set_invert_alpha\n"); png_debug(1, "in png_set_invert_alpha");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_INVERT_ALPHA; png_ptr->transformations |= PNG_INVERT_ALPHA;
} }
@ -166,7 +166,7 @@ png_set_invert_alpha(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_invert_mono(png_structp png_ptr) png_set_invert_mono(png_structp png_ptr)
{ {
png_debug(1, "in png_set_invert_mono\n"); png_debug(1, "in png_set_invert_mono");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
png_ptr->transformations |= PNG_INVERT_MONO; png_ptr->transformations |= PNG_INVERT_MONO;
} }
@ -175,7 +175,7 @@ png_set_invert_mono(png_structp png_ptr)
void /* PRIVATE */ void /* PRIVATE */
png_do_invert(png_row_infop row_info, png_bytep row) png_do_invert(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_invert\n"); png_debug(1, "in png_do_invert");
/* This test removed from libpng version 1.0.13 and 1.2.0: /* This test removed from libpng version 1.0.13 and 1.2.0:
* if (row_info->bit_depth == 1 && * if (row_info->bit_depth == 1 &&
*/ */
@ -230,7 +230,7 @@ png_do_invert(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_swap(png_row_infop row_info, png_bytep row) png_do_swap(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_swap\n"); png_debug(1, "in png_do_swap");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -361,7 +361,7 @@ static PNG_CONST png_byte fourbppswaptable[256] = {
void /* PRIVATE */ void /* PRIVATE */
png_do_packswap(png_row_infop row_info, png_bytep row) png_do_packswap(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_packswap\n"); png_debug(1, "in png_do_packswap");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -393,7 +393,7 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
{ {
png_debug(1, "in png_do_strip_filler\n"); png_debug(1, "in png_do_strip_filler");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -551,7 +551,7 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
void /* PRIVATE */ void /* PRIVATE */
png_do_bgr(png_row_infop row_info, png_bytep row) png_do_bgr(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_bgr\n"); png_debug(1, "in png_do_bgr");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -630,7 +630,7 @@ void PNGAPI
png_set_user_transform_info(png_structp png_ptr, png_voidp png_set_user_transform_info(png_structp png_ptr, png_voidp
user_transform_ptr, int user_transform_depth, int user_transform_channels) user_transform_ptr, int user_transform_depth, int user_transform_channels)
{ {
png_debug(1, "in png_set_user_transform_info\n"); png_debug(1, "in png_set_user_transform_info");
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
png_ptr->user_transform_ptr = user_transform_ptr; png_ptr->user_transform_ptr = user_transform_ptr;

View File

@ -25,7 +25,7 @@
void PNGAPI void PNGAPI
png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_write_info_before_PLTE\n"); png_debug(1, "in png_write_info_before_PLTE");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
@ -99,7 +99,7 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
{ {
png_unknown_chunk *up; png_unknown_chunk *up;
png_debug(5, "writing extra chunks\n"); png_debug(5, "writing extra chunks");
for (up = info_ptr->unknown_chunks; for (up = info_ptr->unknown_chunks;
up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
@ -130,7 +130,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
int i; int i;
#endif #endif
png_debug(1, "in png_write_info\n"); png_debug(1, "in png_write_info");
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -215,7 +215,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
/* Check to see if we need to write text chunks */ /* Check to see if we need to write text chunks */
for (i = 0; i < info_ptr->num_text; i++) for (i = 0; i < info_ptr->num_text; i++)
{ {
png_debug2(2, "Writing header text chunk %d, type %d\n", i, png_debug2(2, "Writing header text chunk %d, type %d", i,
info_ptr->text[i].compression); info_ptr->text[i].compression);
/* an internationalized chunk? */ /* an internationalized chunk? */
if (info_ptr->text[i].compression > 0) if (info_ptr->text[i].compression > 0)
@ -268,7 +268,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
{ {
png_unknown_chunk *up; png_unknown_chunk *up;
png_debug(5, "writing extra chunks\n"); png_debug(5, "writing extra chunks");
for (up = info_ptr->unknown_chunks; for (up = info_ptr->unknown_chunks;
up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
@ -296,7 +296,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
void PNGAPI void PNGAPI
png_write_end(png_structp png_ptr, png_infop info_ptr) png_write_end(png_structp png_ptr, png_infop info_ptr)
{ {
png_debug(1, "in png_write_end\n"); png_debug(1, "in png_write_end");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
if (!(png_ptr->mode & PNG_HAVE_IDAT)) if (!(png_ptr->mode & PNG_HAVE_IDAT))
@ -318,7 +318,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
/* loop through comment chunks */ /* loop through comment chunks */
for (i = 0; i < info_ptr->num_text; i++) for (i = 0; i < info_ptr->num_text; i++)
{ {
png_debug2(2, "Writing trailer text chunk %d, type %d\n", i, png_debug2(2, "Writing trailer text chunk %d, type %d", i,
info_ptr->text[i].compression); info_ptr->text[i].compression);
/* an internationalized chunk? */ /* an internationalized chunk? */
if (info_ptr->text[i].compression > 0) if (info_ptr->text[i].compression > 0)
@ -370,7 +370,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
{ {
png_unknown_chunk *up; png_unknown_chunk *up;
png_debug(5, "writing extra chunks\n"); png_debug(5, "writing extra chunks");
for (up = info_ptr->unknown_chunks; for (up = info_ptr->unknown_chunks;
up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num;
@ -413,7 +413,7 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
void PNGAPI void PNGAPI
png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime)
{ {
png_debug(1, "in png_convert_from_struct_tm\n"); png_debug(1, "in png_convert_from_struct_tm");
ptime->year = (png_uint_16)(1900 + ttime->tm_year); ptime->year = (png_uint_16)(1900 + ttime->tm_year);
ptime->month = (png_byte)(ttime->tm_mon + 1); ptime->month = (png_byte)(ttime->tm_mon + 1);
ptime->day = (png_byte)ttime->tm_mday; ptime->day = (png_byte)ttime->tm_mday;
@ -427,7 +427,7 @@ png_convert_from_time_t(png_timep ptime, time_t ttime)
{ {
struct tm *tbuf; struct tm *tbuf;
png_debug(1, "in png_convert_from_time_t\n"); png_debug(1, "in png_convert_from_time_t");
tbuf = gmtime(&ttime); tbuf = gmtime(&ttime);
png_convert_from_struct_tm(ptime, tbuf); png_convert_from_struct_tm(ptime, tbuf);
} }
@ -461,7 +461,7 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
#endif #endif
#endif #endif
int i; int i;
png_debug(1, "in png_create_write_struct\n"); png_debug(1, "in png_create_write_struct");
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
@ -659,7 +659,7 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
} }
} while (png_libpng_ver[i++]); } while (png_libpng_ver[i++]);
png_debug(1, "in png_write_init_3\n"); png_debug(1, "in png_write_init_3");
#ifdef PNG_SETJMP_SUPPORTED #ifdef PNG_SETJMP_SUPPORTED
/* save jump buffer and error functions */ /* save jump buffer and error functions */
@ -713,7 +713,7 @@ png_write_rows(png_structp png_ptr, png_bytepp row,
png_uint_32 i; /* row counter */ png_uint_32 i; /* row counter */
png_bytepp rp; /* row pointer */ png_bytepp rp; /* row pointer */
png_debug(1, "in png_write_rows\n"); png_debug(1, "in png_write_rows");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
@ -738,7 +738,7 @@ png_write_image(png_structp png_ptr, png_bytepp image)
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_debug(1, "in png_write_image\n"); png_debug(1, "in png_write_image");
#if defined(PNG_WRITE_INTERLACING_SUPPORTED) #if defined(PNG_WRITE_INTERLACING_SUPPORTED)
/* intialize interlace handling. If image is not interlaced, /* intialize interlace handling. If image is not interlaced,
this will set pass to 1 */ this will set pass to 1 */
@ -763,7 +763,7 @@ png_write_row(png_structp png_ptr, png_bytep row)
{ {
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_debug2(1, "in png_write_row (row %ld, pass %d)\n", png_debug2(1, "in png_write_row (row %ld, pass %d)",
png_ptr->row_number, png_ptr->pass); png_ptr->row_number, png_ptr->pass);
/* initialize transformations and other stuff if first time */ /* initialize transformations and other stuff if first time */
@ -877,12 +877,12 @@ png_write_row(png_structp png_ptr, png_bytep row)
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
png_ptr->row_info.width); png_ptr->row_info.width);
png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type); png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type);
png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width); png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width);
png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels); png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels);
png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth); png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth);
png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth); png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth);
png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes); png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes);
/* Copy user's row into buffer, leaving room for filter byte. */ /* Copy user's row into buffer, leaving room for filter byte. */
png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row,
@ -938,7 +938,7 @@ png_write_row(png_structp png_ptr, png_bytep row)
void PNGAPI void PNGAPI
png_set_flush(png_structp png_ptr, int nrows) png_set_flush(png_structp png_ptr, int nrows)
{ {
png_debug(1, "in png_set_flush\n"); png_debug(1, "in png_set_flush");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); png_ptr->flush_dist = (nrows < 0 ? 0 : nrows);
@ -950,7 +950,7 @@ png_write_flush(png_structp png_ptr)
{ {
int wrote_IDAT; int wrote_IDAT;
png_debug(1, "in png_write_flush\n"); png_debug(1, "in png_write_flush");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
/* We have already written out all of the data */ /* We have already written out all of the data */
@ -1010,7 +1010,7 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
png_voidp mem_ptr = NULL; png_voidp mem_ptr = NULL;
#endif #endif
png_debug(1, "in png_destroy_write_struct\n"); png_debug(1, "in png_destroy_write_struct");
if (png_ptr_ptr != NULL) if (png_ptr_ptr != NULL)
{ {
png_ptr = *png_ptr_ptr; png_ptr = *png_ptr_ptr;
@ -1084,7 +1084,7 @@ png_write_destroy(png_structp png_ptr)
png_free_ptr free_fn; png_free_ptr free_fn;
#endif #endif
png_debug(1, "in png_write_destroy\n"); png_debug(1, "in png_write_destroy");
/* free any memory zlib uses */ /* free any memory zlib uses */
deflateEnd(&png_ptr->zstream); deflateEnd(&png_ptr->zstream);
@ -1141,7 +1141,7 @@ png_write_destroy(png_structp png_ptr)
void PNGAPI void PNGAPI
png_set_filter(png_structp png_ptr, int method, int filters) png_set_filter(png_structp png_ptr, int method, int filters)
{ {
png_debug(1, "in png_set_filter\n"); png_debug(1, "in png_set_filter");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
#if defined(PNG_MNG_FEATURES_SUPPORTED) #if defined(PNG_MNG_FEATURES_SUPPORTED)
@ -1264,7 +1264,7 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
{ {
int i; int i;
png_debug(1, "in png_set_filter_heuristics\n"); png_debug(1, "in png_set_filter_heuristics");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST)
@ -1378,7 +1378,7 @@ png_set_filter_heuristics(png_structp png_ptr, int heuristic_method,
void PNGAPI void PNGAPI
png_set_compression_level(png_structp png_ptr, int level) png_set_compression_level(png_structp png_ptr, int level)
{ {
png_debug(1, "in png_set_compression_level\n"); png_debug(1, "in png_set_compression_level");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL;
@ -1388,7 +1388,7 @@ png_set_compression_level(png_structp png_ptr, int level)
void PNGAPI void PNGAPI
png_set_compression_mem_level(png_structp png_ptr, int mem_level) png_set_compression_mem_level(png_structp png_ptr, int mem_level)
{ {
png_debug(1, "in png_set_compression_mem_level\n"); png_debug(1, "in png_set_compression_mem_level");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL;
@ -1398,7 +1398,7 @@ png_set_compression_mem_level(png_structp png_ptr, int mem_level)
void PNGAPI void PNGAPI
png_set_compression_strategy(png_structp png_ptr, int strategy) png_set_compression_strategy(png_structp png_ptr, int strategy)
{ {
png_debug(1, "in png_set_compression_strategy\n"); png_debug(1, "in png_set_compression_strategy");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY;
@ -1429,7 +1429,7 @@ png_set_compression_window_bits(png_structp png_ptr, int window_bits)
void PNGAPI void PNGAPI
png_set_compression_method(png_structp png_ptr, int method) png_set_compression_method(png_structp png_ptr, int method)
{ {
png_debug(1, "in png_set_compression_method\n"); png_debug(1, "in png_set_compression_method");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
if (method != 8) if (method != 8)
@ -1451,7 +1451,7 @@ void PNGAPI
png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
write_user_transform_fn) write_user_transform_fn)
{ {
png_debug(1, "in png_set_write_user_transform_fn\n"); png_debug(1, "in png_set_write_user_transform_fn");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
png_ptr->transformations |= PNG_USER_TRANSFORM; png_ptr->transformations |= PNG_USER_TRANSFORM;

View File

@ -18,7 +18,7 @@
void /* PRIVATE */ void /* PRIVATE */
png_do_write_transformations(png_structp png_ptr) png_do_write_transformations(png_structp png_ptr)
{ {
png_debug(1, "in png_do_write_transformations\n"); png_debug(1, "in png_do_write_transformations");
if (png_ptr == NULL) if (png_ptr == NULL)
return; return;
@ -86,7 +86,7 @@ png_do_write_transformations(png_structp png_ptr)
void /* PRIVATE */ void /* PRIVATE */
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
{ {
png_debug(1, "in png_do_pack\n"); png_debug(1, "in png_do_pack");
if (row_info->bit_depth == 8 && if (row_info->bit_depth == 8 &&
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&
@ -212,7 +212,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
void /* PRIVATE */ void /* PRIVATE */
png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth)
{ {
png_debug(1, "in png_do_shift\n"); png_debug(1, "in png_do_shift");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL && if (row != NULL && row_info != NULL &&
#else #else
@ -336,7 +336,7 @@ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth)
void /* PRIVATE */ void /* PRIVATE */
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_write_swap_alpha\n"); png_debug(1, "in png_do_write_swap_alpha");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -424,7 +424,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_write_invert_alpha\n"); png_debug(1, "in png_do_write_invert_alpha");
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
#endif #endif
@ -514,7 +514,7 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
void /* PRIVATE */ void /* PRIVATE */
png_do_write_intrapixel(png_row_infop row_info, png_bytep row) png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
{ {
png_debug(1, "in png_do_write_intrapixel\n"); png_debug(1, "in png_do_write_intrapixel");
if ( if (
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
row != NULL && row_info != NULL && row != NULL && row_info != NULL &&

View File

@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file /* pngwutil.c - utilities to write a PNG file
* *
* Last changed in libpng 1.2.34 [November 28, 2008] * Last changed in libpng 1.2.34 [December 1, 2008]
* 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-2008 Glenn Randers-Pehrson * Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -96,7 +96,7 @@ png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
{ {
png_byte buf[8]; png_byte buf[8];
png_debug2(0, "Writing %s chunk, length = %lu\n", chunk_name, png_debug2(0, "Writing %s chunk, length = %lu", chunk_name,
(unsigned long)length); (unsigned long)length);
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
@ -392,7 +392,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
png_byte buf[13]; /* buffer to store the IHDR info */ png_byte buf[13]; /* buffer to store the IHDR info */
png_debug(1, "in png_write_IHDR\n"); png_debug(1, "in png_write_IHDR");
/* Check that we have valid input data from the application info */ /* Check that we have valid input data from the application info */
switch (color_type) switch (color_type)
{ {
@ -569,7 +569,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
png_colorp pal_ptr; png_colorp pal_ptr;
png_byte buf[3]; png_byte buf[3];
png_debug(1, "in png_write_PLTE\n"); png_debug(1, "in png_write_PLTE");
if (( if ((
#if defined(PNG_MNG_FEATURES_SUPPORTED) #if defined(PNG_MNG_FEATURES_SUPPORTED)
!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) &&
@ -595,7 +595,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
} }
png_ptr->num_palette = (png_uint_16)num_pal; png_ptr->num_palette = (png_uint_16)num_pal;
png_debug1(3, "num_palette = %d\n", png_ptr->num_palette); png_debug1(3, "num_palette = %d", png_ptr->num_palette);
png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
(png_uint_32)(num_pal * 3)); (png_uint_32)(num_pal * 3));
@ -629,7 +629,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
#ifdef PNG_USE_LOCAL_ARRAYS #ifdef PNG_USE_LOCAL_ARRAYS
PNG_IDAT; PNG_IDAT;
#endif #endif
png_debug(1, "in png_write_IDAT\n"); png_debug(1, "in png_write_IDAT");
/* Optimize the CMF field in the zlib stream. */ /* Optimize the CMF field in the zlib stream. */
/* This hack of the zlib stream is compliant to the stream specification. */ /* This hack of the zlib stream is compliant to the stream specification. */
@ -681,7 +681,7 @@ png_write_IEND(png_structp png_ptr)
#ifdef PNG_USE_LOCAL_ARRAYS #ifdef PNG_USE_LOCAL_ARRAYS
PNG_IEND; PNG_IEND;
#endif #endif
png_debug(1, "in png_write_IEND\n"); png_debug(1, "in png_write_IEND");
png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,
(png_size_t)0); (png_size_t)0);
png_ptr->mode |= PNG_HAVE_IEND; png_ptr->mode |= PNG_HAVE_IEND;
@ -699,7 +699,7 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
png_uint_32 igamma; png_uint_32 igamma;
png_byte buf[4]; png_byte buf[4];
png_debug(1, "in png_write_gAMA\n"); png_debug(1, "in png_write_gAMA");
/* file_gamma is saved in 1/100,000ths */ /* file_gamma is saved in 1/100,000ths */
igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
png_save_uint_32(buf, igamma); png_save_uint_32(buf, igamma);
@ -715,7 +715,7 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
#endif #endif
png_byte buf[4]; png_byte buf[4];
png_debug(1, "in png_write_gAMA\n"); png_debug(1, "in png_write_gAMA");
/* file_gamma is saved in 1/100,000ths */ /* file_gamma is saved in 1/100,000ths */
png_save_uint_32(buf, (png_uint_32)file_gamma); png_save_uint_32(buf, (png_uint_32)file_gamma);
png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
@ -733,7 +733,7 @@ png_write_sRGB(png_structp png_ptr, int srgb_intent)
#endif #endif
png_byte buf[1]; png_byte buf[1];
png_debug(1, "in png_write_sRGB\n"); png_debug(1, "in png_write_sRGB");
if (srgb_intent >= PNG_sRGB_INTENT_LAST) if (srgb_intent >= PNG_sRGB_INTENT_LAST)
png_warning(png_ptr, png_warning(png_ptr,
"Invalid sRGB rendering intent specified"); "Invalid sRGB rendering intent specified");
@ -756,7 +756,7 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
compression_state comp; compression_state comp;
int embedded_profile_len = 0; int embedded_profile_len = 0;
png_debug(1, "in png_write_iCCP\n"); png_debug(1, "in png_write_iCCP");
comp.num_output_ptr = 0; comp.num_output_ptr = 0;
comp.max_output_ptr = 0; comp.max_output_ptr = 0;
@ -835,7 +835,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
int i; int i;
#endif #endif
png_debug(1, "in png_write_sPLT\n"); png_debug(1, "in png_write_sPLT");
if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr, if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr,
spalette->name, &new_name))==0) spalette->name, &new_name))==0)
{ {
@ -912,7 +912,7 @@ png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
png_byte buf[4]; png_byte buf[4];
png_size_t size; png_size_t size;
png_debug(1, "in png_write_sBIT\n"); png_debug(1, "in png_write_sBIT");
/* make sure we don't depend upon the order of PNG_COLOR_8 */ /* make sure we don't depend upon the order of PNG_COLOR_8 */
if (color_type & PNG_COLOR_MASK_COLOR) if (color_type & PNG_COLOR_MASK_COLOR)
{ {
@ -1019,7 +1019,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
#endif #endif
png_byte buf[32]; png_byte buf[32];
png_debug(1, "in png_write_cHRM\n"); png_debug(1, "in png_write_cHRM");
/* each value is saved in 1/100,000ths */ /* each value is saved in 1/100,000ths */
#if !defined(PNG_NO_CHECK_cHRM) #if !defined(PNG_NO_CHECK_cHRM)
if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y, if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y,
@ -1055,7 +1055,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
#endif #endif
png_byte buf[6]; png_byte buf[6];
png_debug(1, "in png_write_tRNS\n"); png_debug(1, "in png_write_tRNS");
if (color_type == PNG_COLOR_TYPE_PALETTE) if (color_type == PNG_COLOR_TYPE_PALETTE)
{ {
if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette)
@ -1110,7 +1110,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
#endif #endif
png_byte buf[6]; png_byte buf[6];
png_debug(1, "in png_write_bKGD\n"); png_debug(1, "in png_write_bKGD");
if (color_type == PNG_COLOR_TYPE_PALETTE) if (color_type == PNG_COLOR_TYPE_PALETTE)
{ {
if ( if (
@ -1118,7 +1118,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
(png_ptr->num_palette || (png_ptr->num_palette ||
(!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) &&
#endif #endif
back->index > png_ptr->num_palette - 1) back->index >= png_ptr->num_palette)
{ {
png_warning(png_ptr, "Invalid background palette index"); png_warning(png_ptr, "Invalid background palette index");
return; return;
@ -1164,10 +1164,10 @@ png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
int i; int i;
png_byte buf[3]; png_byte buf[3];
png_debug(1, "in png_write_hIST\n"); png_debug(1, "in png_write_hIST");
if (num_hist > (int)png_ptr->num_palette) if (num_hist > (int)png_ptr->num_palette)
{ {
png_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist, png_debug2(3, "num_hist = %d, num_palette = %d", num_hist,
png_ptr->num_palette); png_ptr->num_palette);
png_warning(png_ptr, "Invalid number of histogram entries specified"); png_warning(png_ptr, "Invalid number of histogram entries specified");
return; return;
@ -1204,7 +1204,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
int kflag; int kflag;
int kwarn=0; int kwarn=0;
png_debug(1, "in png_check_keyword\n"); png_debug(1, "in png_check_keyword");
*new_key = NULL; *new_key = NULL;
if (key == NULL || (key_len = png_strlen(key)) == 0) if (key == NULL || (key_len = png_strlen(key)) == 0)
@ -1213,7 +1213,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
return ((png_size_t)0); return ((png_size_t)0);
} }
png_debug1(2, "Keyword to be checked is '%s'\n", key); png_debug1(2, "Keyword to be checked is '%s'", key);
*new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2)); *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2));
if (*new_key == NULL) if (*new_key == NULL)
@ -1272,7 +1272,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
} }
} }
png_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp); png_debug1(2, "Checking for multiple internal spaces in '%s'", kp);
/* Remove multiple internal spaces. */ /* Remove multiple internal spaces. */
for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) for (kflag = 0, dp = *new_key; *kp != '\0'; kp++)
@ -1327,7 +1327,7 @@ png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,
png_size_t key_len; png_size_t key_len;
png_charp new_key; png_charp new_key;
png_debug(1, "in png_write_tEXt\n"); png_debug(1, "in png_write_tEXt");
if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)
{ {
png_warning(png_ptr, "Empty keyword in tEXt chunk"); png_warning(png_ptr, "Empty keyword in tEXt chunk");
@ -1372,7 +1372,7 @@ png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
png_charp new_key; png_charp new_key;
compression_state comp; compression_state comp;
png_debug(1, "in png_write_zTXt\n"); png_debug(1, "in png_write_zTXt");
comp.num_output_ptr = 0; comp.num_output_ptr = 0;
comp.max_output_ptr = 0; comp.max_output_ptr = 0;
@ -1433,7 +1433,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
png_byte cbuf[2]; png_byte cbuf[2];
compression_state comp; compression_state comp;
png_debug(1, "in png_write_iTXt\n"); png_debug(1, "in png_write_iTXt");
comp.num_output_ptr = 0; comp.num_output_ptr = 0;
comp.max_output_ptr = 0; comp.max_output_ptr = 0;
@ -1521,7 +1521,7 @@ png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
#endif #endif
png_byte buf[9]; png_byte buf[9];
png_debug(1, "in png_write_oFFs\n"); png_debug(1, "in png_write_oFFs");
if (unit_type >= PNG_OFFSET_LAST) if (unit_type >= PNG_OFFSET_LAST)
png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); png_warning(png_ptr, "Unrecognized unit type for oFFs chunk");
@ -1547,14 +1547,14 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
png_charp new_purpose; png_charp new_purpose;
int i; int i;
png_debug1(1, "in png_write_pCAL (%d parameters)\n", nparams); png_debug1(1, "in png_write_pCAL (%d parameters)", nparams);
if (type >= PNG_EQUATION_LAST) if (type >= PNG_EQUATION_LAST)
png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); png_warning(png_ptr, "Unrecognized equation type for pCAL chunk");
purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1;
png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len); png_debug1(3, "pCAL purpose length = %d", (int)purpose_len);
units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); units_len = png_strlen(units) + (nparams == 0 ? 0 : 1);
png_debug1(3, "pCAL units length = %d\n", (int)units_len); png_debug1(3, "pCAL units length = %d", (int)units_len);
total_len = purpose_len + units_len + 10; total_len = purpose_len + units_len + 10;
params_len = (png_uint_32p)png_malloc(png_ptr, params_len = (png_uint_32p)png_malloc(png_ptr,
@ -1565,12 +1565,12 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
for (i = 0; i < nparams; i++) for (i = 0; i < nparams; i++)
{ {
params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1);
png_debug2(3, "pCAL parameter %d length = %lu\n", i, png_debug2(3, "pCAL parameter %d length = %lu", i,
(unsigned long) params_len[i]); (unsigned long) params_len[i]);
total_len += (png_size_t)params_len[i]; total_len += (png_size_t)params_len[i];
} }
png_debug1(3, "pCAL total length = %d\n", (int)total_len); png_debug1(3, "pCAL total length = %d", (int)total_len);
png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len);
png_write_chunk_data(png_ptr, (png_bytep)new_purpose, png_write_chunk_data(png_ptr, (png_bytep)new_purpose,
(png_size_t)purpose_len); (png_size_t)purpose_len);
@ -1606,7 +1606,7 @@ png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
char buf[64]; char buf[64];
png_size_t total_len; png_size_t total_len;
png_debug(1, "in png_write_sCAL\n"); png_debug(1, "in png_write_sCAL");
buf[0] = (char)unit; buf[0] = (char)unit;
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
@ -1631,7 +1631,7 @@ png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
total_len += png_strlen(buf + total_len); total_len += png_strlen(buf + total_len);
#endif #endif
png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); png_debug1(3, "sCAL total length = %u", (unsigned int)total_len);
png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len);
} }
#else #else
@ -1646,7 +1646,7 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,
png_byte buf[64]; png_byte buf[64];
png_size_t wlen, hlen, total_len; png_size_t wlen, hlen, total_len;
png_debug(1, "in png_write_sCAL_s\n"); png_debug(1, "in png_write_sCAL_s");
wlen = png_strlen(width); wlen = png_strlen(width);
hlen = png_strlen(height); hlen = png_strlen(height);
@ -1661,7 +1661,7 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,
png_memcpy(buf + 1, width, wlen + 1); /* append the '\0' here */ png_memcpy(buf + 1, width, wlen + 1); /* append the '\0' here */
png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */ png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */
png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); png_debug1(3, "sCAL total length = %u", (unsigned int)total_len);
png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len);
} }
#endif #endif
@ -1680,7 +1680,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
#endif #endif
png_byte buf[9]; png_byte buf[9];
png_debug(1, "in png_write_pHYs\n"); png_debug(1, "in png_write_pHYs");
if (unit_type >= PNG_RESOLUTION_LAST) if (unit_type >= PNG_RESOLUTION_LAST)
png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); png_warning(png_ptr, "Unrecognized unit type for pHYs chunk");
@ -1704,7 +1704,7 @@ png_write_tIME(png_structp png_ptr, png_timep mod_time)
#endif #endif
png_byte buf[7]; png_byte buf[7];
png_debug(1, "in png_write_tIME\n"); png_debug(1, "in png_write_tIME");
if (mod_time->month > 12 || mod_time->month < 1 || if (mod_time->month > 12 || mod_time->month < 1 ||
mod_time->day > 31 || mod_time->day < 1 || mod_time->day > 31 || mod_time->day < 1 ||
mod_time->hour > 23 || mod_time->second > 60) mod_time->hour > 23 || mod_time->second > 60)
@ -1748,7 +1748,7 @@ png_write_start_row(png_structp png_ptr)
png_size_t buf_size; png_size_t buf_size;
png_debug(1, "in png_write_start_row\n"); png_debug(1, "in png_write_start_row");
buf_size = (png_size_t)(PNG_ROWBYTES( buf_size = (png_size_t)(PNG_ROWBYTES(
png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1); png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1);
@ -1848,7 +1848,7 @@ png_write_finish_row(png_structp png_ptr)
int ret; int ret;
png_debug(1, "in png_write_finish_row\n"); png_debug(1, "in png_write_finish_row");
/* next row */ /* next row */
png_ptr->row_number++; png_ptr->row_number++;
@ -1957,7 +1957,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
#endif #endif
png_debug(1, "in png_do_write_interlace\n"); png_debug(1, "in png_do_write_interlace");
/* we don't have to do anything on the last pass (6) */ /* we don't have to do anything on the last pass (6) */
#if defined(PNG_USELESS_TESTS_SUPPORTED) #if defined(PNG_USELESS_TESTS_SUPPORTED)
if (row != NULL && row_info != NULL && pass < 6) if (row != NULL && row_info != NULL && pass < 6)
@ -2128,7 +2128,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
int num_p_filters = (int)png_ptr->num_prev_filters; int num_p_filters = (int)png_ptr->num_prev_filters;
#endif #endif
png_debug(1, "in png_write_find_filter\n"); png_debug(1, "in png_write_find_filter");
/* find out how many bytes offset each pixel is */ /* find out how many bytes offset each pixel is */
bpp = (row_info->pixel_depth + 7) >> 3; bpp = (row_info->pixel_depth + 7) >> 3;
@ -2737,8 +2737,8 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
void /* PRIVATE */ void /* PRIVATE */
png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row)
{ {
png_debug(1, "in png_write_filtered_row\n"); png_debug(1, "in png_write_filtered_row");
png_debug1(2, "filter = %d\n", filtered_row[0]); png_debug1(2, "filter = %d", filtered_row[0]);
/* set up the zlib input buffer */ /* set up the zlib input buffer */
png_ptr->zstream.next_in = filtered_row; png_ptr->zstream.next_in = filtered_row;

View File

@ -169,7 +169,7 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
# SET UP LINKS # SET UP LINKS
set_target_properties(${PNG_LIB_NAME} PROPERTIES set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 0.${PNGLIB_RELEASE}.1.2.34beta02 # VERSION 0.${PNGLIB_RELEASE}.1.2.34beta03
VERSION 0.${PNGLIB_RELEASE}.0 VERSION 0.${PNGLIB_RELEASE}.0
SOVERSION 0 SOVERSION 0
CLEAN_DIRECT_OUTPUT 1) CLEAN_DIRECT_OUTPUT 1)

View File

@ -8,7 +8,7 @@
# Modeled after libxml-config. # Modeled after libxml-config.
version=1.2.34beta02 version=1.2.34beta03
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng12
Name: libpng Name: libpng
Description: Loads and saves PNG files Description: Loads and saves PNG files
Version: 1.2.34beta02 Version: 1.2.34beta03
Libs: -L${libdir} -lpng12 Libs: -L${libdir} -lpng12
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -20,7 +20,7 @@ LN_SF = ln -f -s
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
prefix=/usr/local prefix=/usr/local

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -74,7 +74,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
CYGDLL = 12 CYGDLL = 12
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
SHAREDLIB=cygpng$(CYGDLL).dll SHAREDLIB=cygpng$(CYGDLL).dll

View File

@ -19,7 +19,7 @@ ZLIBINC=../zlib
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 12 PNGMAJ = 12
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -5,7 +5,7 @@
# Library name: # Library name:
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng12 LIBNAME = libpng12

View File

@ -13,7 +13,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -14,7 +14,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -18,7 +18,7 @@ ZLIBINC=/opt/zlib/include
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -7,7 +7,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -74,7 +74,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
MINGDLL = 12 MINGDLL = 12
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
SHAREDLIB=libpng$(MINGDLL).dll SHAREDLIB=libpng$(MINGDLL).dll

View File

@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng12
LIB= png12 LIB= png12
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.2.34beta02 SHLIB_MINOR= 1.2.34beta03
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng
LIB= png LIB= png
SHLIB_MAJOR= 3 SHLIB_MAJOR= 3
SHLIB_MINOR= 1.2.34beta02 SHLIB_MINOR= 1.2.34beta03
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@ -7,7 +7,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.2.34beta02 SHLIB_MINOR= 1.2.34beta03
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \

View File

@ -9,7 +9,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -6,7 +6,7 @@
# Library name: # Library name:
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -6,7 +6,7 @@
# Library name: # Library name:
LIBNAME=libpng12 LIBNAME=libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng12 LIBNAME = libpng12

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME = libpng12 LIBNAME = libpng12
PNGMAJ = 0 PNGMAJ = 0
PNGMIN = 1.2.34beta02 PNGMIN = 1.2.34beta03
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -2,7 +2,7 @@
; PNG.LIB module definition file for OS/2 ; PNG.LIB module definition file for OS/2
;---------------------------------------- ;----------------------------------------
; Version 1.2.34beta02 ; Version 1.2.34beta03
LIBRARY PNG LIBRARY PNG
DESCRIPTION "PNG image compression library for OS/2" DESCRIPTION "PNG image compression library for OS/2"

View File

@ -5,7 +5,7 @@
LIBRARY LIBRARY
EXPORTS EXPORTS
;Version 1.2.34beta02 ;Version 1.2.34beta03
png_build_grayscale_palette @1 png_build_grayscale_palette @1
png_check_sig @2 png_check_sig @2
png_chunk_error @3 png_chunk_error @3