Imported from libpng-1.4.0beta51.tar

This commit is contained in:
Glenn Randers-Pehrson 2009-03-21 08:15:32 -05:00
parent 6917b51660
commit 8fb550cc3e
63 changed files with 480 additions and 263 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.0beta50 - March 9, 2009 Libpng 1.4.0beta51 - March 21, 2009
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,27 +9,27 @@ 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
1.4.0beta50.tar.gz 1.4.0beta51.tar.gz
1.4.0beta50.tar.bz2 1.4.0beta51.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
1.4.0beta50-no-config.tar.gz 1.4.0beta51-no-config.tar.gz
1.4.0beta50-no-config.tar.bz2 1.4.0beta51-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
lp140b50.zip lp140b51.zip
lp140b50.tar.bz2 lp140b51.tar.bz2
Other information: Other information:
1.4.0beta50-README.txt 1.4.0beta51-README.txt
1.4.0beta50-KNOWNBUGS.txt 1.4.0beta51-KNOWNBUGS.txt
1.4.0beta50-LICENSE.txt 1.4.0beta51-LICENSE.txt
1.4.0beta50-Y2K-compliance.txt 1.4.0beta51-Y2K-compliance.txt
Changes since the last public release (1.2.10): Changes since the last public release (1.2.10):
@ -343,7 +343,7 @@ version 1.4.0beta38 [November 22, 2008]
Added check for zero-area RGB cHRM triange in png_check_cHRM() and Added check for zero-area RGB cHRM triange in png_check_cHRM() and
png_check_cHRM_fixed(). png_check_cHRM_fixed().
version 1.4.0beta39 [March 9, 2009] version 1.4.0beta39 [March 21, 2009]
Revised png_warning() to write its message on standard output by default Revised png_warning() to write its message on standard output by default
when warning_fn is NULL. when warning_fn is NULL.
@ -392,9 +392,19 @@ version 1.4.0beta49 [February 28, 2009]
(bug introduced in libpng-1.2.34/1.4.0beta29). (bug introduced in libpng-1.2.34/1.4.0beta29).
Revised comments in png_set_read_fn() and png_set_write_fn(). Revised comments in png_set_read_fn() and png_set_write_fn().
version 1.4.0beta50 [March 9, 2009] version 1.4.0beta50 [March 21, 2009]
Use png_calloc() instead of png_malloc() to allocate big_row_buf when Use png_calloc() instead of png_malloc() to allocate big_row_buf when
reading an interlaced file, to avoid a possible UMR. reading an interlaced file, to avoid a possible UMR.
Undid recent revision of PNG_NO_STDIO version of png_write_flush(). Users
having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined
or supply their own flush_fn() replacement.
Revised libpng*.txt and png.h documentation about use of png_write_flush()
and png_set_write_fn().
Removed fflush() from pngtest.c.
Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
version 1.4.0beta51 [March 21, 2009]
Removed new png_fileno() macro from pngconf.h .
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

12
CHANGES
View File

@ -2068,9 +2068,19 @@ version 1.4.0beta49 [February 28, 2009]
(bug introduced in libpng-1.2.34/1.4.0beta29). (bug introduced in libpng-1.2.34/1.4.0beta29).
Revised comments in png_set_read_fn() and png_set_write_fn(). Revised comments in png_set_read_fn() and png_set_write_fn().
version 1.4.0beta50 [March 9, 2009] version 1.4.0beta50 [March 21, 2009]
Use png_calloc() instead of png_malloc() to allocate big_row_buf when Use png_calloc() instead of png_malloc() to allocate big_row_buf when
reading an interlaced file, to avoid a possible UMR. reading an interlaced file, to avoid a possible UMR.
Undid revision of PNG_NO_STDIO version of png_write_flush(). Users
having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined
or supply their own flush_fn() replacement.
Revised libpng*.txt and png.h documentation about use of png_write_flush()
and png_set_write_fn().
Removed fflush() from pngtest.c.
Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
version 1.4.0beta51 [March 21, 2009]
Removed new png_fileno() macro from pngconf.h .
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

18
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.4.0beta50 - March 9, 2009 Installing libpng version 1.4.0beta51 - March 21, 2009
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.4.0beta50" or "lpng109" and "zlib-1.2.1" might be called "libpng-1.4.0beta51" 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:
@ -95,14 +95,14 @@ 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 libpng14.so.14.1.4.0beta50) gcc, creates libpng14.so.14.1.4.0beta51)
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.0beta50) (gcc, creates libpng14.so.14.1.4.0beta51)
makefile.gcmmx => Linux/ELF makefile makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.0beta50, (gcc, creates libpng14.so.14.1.4.0beta51,
uses assembler code tuned for Intel MMX platform) uses assembler code tuned for Intel MMX platform)
makefile.nommx => Linux/ELF makefile makefile.nommx => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.0beta50 (gcc, creates libpng14.so.14.1.4.0beta51
does not use Intel MMX assembler code) does not use Intel MMX assembler code)
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
@ -125,12 +125,12 @@ 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 libpng14.so.14.1.4.0beta50) creates libpng14.so.14.1.4.0beta51)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng14.so.14.1.4.0beta50) creates libpng14.so.14.1.4.0beta51)
makefile.so9 => Solaris 9 makefile (gcc, makefile.so9 => Solaris 9 makefile (gcc,
creates libpng14.so.14.1.4.0beta50) creates libpng14.so.14.1.4.0beta51)
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.4.0beta50 Known bugs in libpng version 1.4.0beta51
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
reading interlaced PNG files, when assembler code is enabled but running reading interlaced PNG files, when assembler code is enabled but running

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.4.0beta50, March 9, 2009, are libpng versions 1.2.6, August 15, 2004, through 1.4.0beta51, March 21, 2009, are
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are Copyright (c) 2004, 2006-2007 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
March 9, 2009 March 21, 2009

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.4.0beta50.txt pngvcrd.c example.c libpng-1.4.0beta51.txt pngvcrd.c
CLEANFILES= pngout.png libpng14.pc libpng14-config libpng.vers \ CLEANFILES= pngout.png libpng14.pc libpng14-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.4.0beta50.txt pngvcrd.c example.c libpng-1.4.0beta51.txt pngvcrd.c
CLEANFILES = pngout.png libpng14.pc libpng14-config libpng.vers \ CLEANFILES = pngout.png libpng14.pc libpng14-config libpng.vers \
libpng.sym libpng.sym

14
README
View File

@ -1,4 +1,4 @@
README for libpng version 1.4.0beta50 - March 9, 2009 (shared library 14.0) README for libpng version 1.4.0beta51 - March 21, 2009 (shared library 14.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.
@ -184,11 +184,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 libpng14.so.14.1.4.0beta50) gcc, creates libpng14.so.14.1.4.0beta51)
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.0beta50) (gcc, creates libpng14.so.14.1.4.0beta51)
makefile.gcmmx => Linux/ELF makefile makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.0beta50, (gcc, creates libpng14.so.14.1.4.0beta51,
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
@ -210,12 +210,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 libpng14.so.14.1.4.0beta50) (gcc, creates libpng14.so.14.1.4.0beta51)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng14.so.14.1.4.0beta50) (gcc, creates libpng14.so.14.1.4.0beta51)
makefile.so9 => Solaris 9 makefile makefile.so9 => Solaris 9 makefile
(gcc, creates libpng14.so.14.1.4.0beta50) (gcc, creates libpng14.so.14.1.4.0beta51)
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

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.4.0beta50. # Generated by GNU Autoconf 2.62 for libpng 1.4.0beta51.
# #
# 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.4.0beta50' PACKAGE_VERSION='1.4.0beta51'
PACKAGE_STRING='libpng 1.4.0beta50' PACKAGE_STRING='libpng 1.4.0beta51'
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.4.0beta50 to adapt to many kinds of systems. \`configure' configures libpng 1.4.0beta51 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.4.0beta50:";; short | recursive ) echo "Configuration of libpng 1.4.0beta51:";;
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.4.0beta50 libpng configure 1.4.0beta51
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.4.0beta50, which was It was created by libpng $as_me 1.4.0beta51, 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.4.0beta50' VERSION='1.4.0beta51'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -2558,7 +2558,7 @@ fi
PNGLIB_VERSION=1.4.0beta50 PNGLIB_VERSION=1.4.0beta51
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=4 PNGLIB_MINOR=4
PNGLIB_RELEASE=0 PNGLIB_RELEASE=0
@ -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.4.0beta50, which was This file was extended by libpng $as_me 1.4.0beta51, 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.4.0beta50 libpng config.status 1.4.0beta51
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.4.0beta50], [png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng], [1.4.0beta51], [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.4.0beta50 PNGLIB_VERSION=1.4.0beta51
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=4 PNGLIB_MINOR=4
PNGLIB_RELEASE=0 PNGLIB_RELEASE=0

View File

@ -51,6 +51,7 @@
#define PNG_NO_WRITE_FILTER #define PNG_NO_WRITE_FILTER
#define PNG_NO_WRITE_WEIGHTED_FILTER #define PNG_NO_WRITE_WEIGHTED_FILTER
#define PNG_NO_WRITE_INTERLACING_SUPPORTED #define PNG_NO_WRITE_INTERLACING_SUPPORTED
#define PNG_NO_WRITE_FLUSH
#define PNG_NO_INFO_IMAGE #define PNG_NO_INFO_IMAGE
#define PNG_NO_USER_MEM #define PNG_NO_USER_MEM

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.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Maintained 1998-2009 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger) * Maintained 1996, 1997 Andreas Dilger)
@ -342,11 +342,13 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
/* The easiest way to read the image: */ /* The easiest way to read the image: */
png_bytep row_pointers[height]; png_bytep row_pointers[height];
/* Clear the pointer array */
for (row = 0; row < height; row++)
row_pointers[row] = NULL;
for (row = 0; row < height; row++) for (row = 0; row < height; row++)
{
row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr,
info_ptr)); info_ptr));
}
/* Now it's time to read the image. One of these methods is REQUIRED */ /* Now it's time to read the image. One of these methods is REQUIRED */
#ifdef entire /* Read the entire image in one go */ #ifdef entire /* Read the entire image in one go */
@ -597,7 +599,7 @@ void write_png(char *file_name /* , ... other image information ... */)
*/ */
if (setjmp(png_jmpbuf(png_ptr))) if (setjmp(png_jmpbuf(png_ptr)))
{ {
/* If we get here, we had a problem reading the file */ /* If we get here, we had a problem writing the file */
fclose(fp); fclose(fp);
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
return (ERROR); return (ERROR);
@ -692,7 +694,7 @@ void write_png(char *file_name /* , ... other image information ... */)
* write_my_chunk(); * write_my_chunk();
* png_write_info(png_ptr, info_ptr); * png_write_info(png_ptr, info_ptr);
* *
* However, given the level of known- and unknown-chunk support in 1.1.0 * However, given the level of known- and unknown-chunk support in 1.2.0
* and up, this should no longer be necessary. * and up, this should no longer be necessary.
*/ */
@ -771,10 +773,8 @@ void write_png(char *file_name /* , ... other image information ... */)
/* If you are only writing one row at a time, this works */ /* If you are only writing one row at a time, this works */
for (y = 0; y < height; y++) for (y = 0; y < height; y++)
{
png_write_rows(png_ptr, &row_pointers[y], 1); png_write_rows(png_ptr, &row_pointers[y], 1);
} }
}
#endif no_entire /* use only one output method */ #endif no_entire /* use only one output method */
/* You can write optional chunks like tEXt, zTXt, and tIME at the end /* You can write optional chunks like tEXt, zTXt, and tIME at the end

View File

@ -1,13 +1,17 @@
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.4.0beta50 - March 9, 2009 libpng version 1.4.0beta51 - March 21, 2009
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-2005 Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson
For conditions of distribution and use, see copyright For conditions of distribution and use, see copyright
notice in png.h. notice in png.h.
based on: Based on:
libpng versions 0.97, January 1998, through 1.4.0beta51 - March 21, 2009
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997 libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
@ -33,6 +37,10 @@ it is heavily commented and should include everything most people
will need. We assume that libpng is already installed; see the will need. We assume that libpng is already installed; see the
INSTALL file for instructions on how to install libpng. INSTALL file for instructions on how to install libpng.
For examples of libpng usage, see the files "example.c", "pngtest.c",
and the files in the "contrib" directory, all of which are included in the
libpng distribution.
Libpng was written as a companion to the PNG specification, as a way Libpng was written as a companion to the PNG specification, as a way
of reducing the amount of time and effort it takes to support the PNG of reducing the amount of time and effort it takes to support the PNG
file format in application programs. file format in application programs.
@ -43,12 +51,14 @@ a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at
The W3C and ISO documents have identical technical content. The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at The PNG-1.2 specification is available at
<http://www.libpng.org/pub/png/documents/> <http://www.libpng.org/pub/png/documents/>. It is technically equivalent
to the PNG specification (second edition) but has some additional material.
The PNG-1.0 specification is available The PNG-1.0 specification is available
as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a
W3C Recommendation <http://www.w3.org/TR/REC.png.html>. Some W3C Recommendation <http://www.w3.org/TR/REC.png.html>.
additional chunks are described in the special-purpose public chunks
Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/documents/>. documents at <http://www.libpng.org/pub/png/documents/>.
Other information Other information
@ -256,15 +266,19 @@ input stream. You must supply the function
png_unknown_chunkp chunk); png_unknown_chunkp chunk);
{ {
/* The unknown chunk structure contains your /* The unknown chunk structure contains your
chunk data: */ chunk data, along with similar data for any other
unknown chunks: */
png_byte name[5]; png_byte name[5];
png_byte *data; png_byte *data;
png_size_t size; png_size_t size;
/* Note that libpng has already taken care of /* Note that libpng has already taken care of
the CRC handling */ the CRC handling */
/* put your code here. Return one of the /* put your code here. Search for your chunk in the
following: */ unknown chunk structure, process it, and return one
of the following: */
return (-n); /* chunk had an error */ return (-n); /* chunk had an error */
return (0); /* did not recognize */ return (0); /* did not recognize */
@ -284,6 +298,11 @@ you can retrieve with
png_get_user_chunk_ptr(png_ptr); png_get_user_chunk_ptr(png_ptr);
If you call the png_set_read_user_chunk_fn() function, then all unknown
chunks will be saved when read, in case your callback function will need
one or more of them. This behavior can be changed with the
png_set_keep_unknown_chunks() function, described below.
At this point, you can set up a callback function that will be At this point, you can set up a callback function that will be
called after each row has been read, which you can use to control called after each row has been read, which you can use to control
a progress meter or the like. It's demonstrated in pngtest.c. a progress meter or the like. It's demonstrated in pngtest.c.
@ -300,18 +319,42 @@ You must supply a function
To inform libpng about your function, use To inform libpng about your function, use
png_set_read_status_fn(png_ptr, read_row_callback); png_set_read_status_fn(png_ptr, read_row_callback);
Width and height limits
The PNG specification allows the width and height of an image to be as
large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
Since very few applications really need to process such large images,
we have imposed an arbitrary 1-million limit on rows and columns.
Larger images will be rejected immediately with a png_error() call. If
you wish to override this limit, you can use
png_set_user_limits(png_ptr, width_max, height_max);
to set your own limits, or use width_max = height_max = 0x7fffffffL
to allow all valid dimensions (libpng may reject some very large images
anyway because of potential buffer overflow conditions).
You should put this statement after you create the PNG structure and
before calling png_read_info(), png_read_png(), or png_process_data().
If you need to retrieve the limits that are being applied, use
width_max = png_get_user_width_max(png_ptr);
height_max = png_get_user_height_max(png_ptr);
Unknown-chunk handling Unknown-chunk handling
Now you get to set the way the library processes unknown chunks in the Now you get to set the way the library processes unknown chunks in the
input PNG stream. Both known and unknown chunks will be read. Normal input PNG stream. Both known and unknown chunks will be read. Normal
behavior is that known chunks will be parsed into information in behavior is that known chunks will be parsed into information in
various info_ptr members; unknown chunks will be discarded. To change various info_ptr members while unknown chunks will be discarded. This
this, you can call: behavior can be wasteful if your application will never use some known
chunk types. To change this, you can call:
png_set_keep_unknown_chunks(png_ptr, keep, png_set_keep_unknown_chunks(png_ptr, keep,
chunk_list, num_chunks); chunk_list, num_chunks);
keep - 0: do not handle as unknown keep - 0: default unknown chunk handling
1: do not keep 1: ignore; do not keep
2: keep only if safe-to-copy 2: keep only if safe-to-copy
3: keep even if unsafe-to-copy 3: keep even if unsafe-to-copy
You can use these definitions: You can use these definitions:
@ -334,6 +377,36 @@ instances of png_set_keep_unknown_chunks(), the final instance will
take precedence. The IHDR and IEND chunks should not be named in take precedence. The IHDR and IEND chunks should not be named in
chunk_list; if they are, libpng will process them normally anyway. chunk_list; if they are, libpng will process them normally anyway.
Here is an example of the usage of png_set_keep_unknown_chunks(),
where the private "vpAg" chunk will later be processed by a user chunk
callback function:
png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'};
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
png_byte unused_chunks[]=
{
104, 73, 83, 84, (png_byte) '\0', /* hIST */
105, 84, 88, 116, (png_byte) '\0', /* iTXt */
112, 67, 65, 76, (png_byte) '\0', /* pCAL */
115, 67, 65, 76, (png_byte) '\0', /* sCAL */
115, 80, 76, 84, (png_byte) '\0', /* sPLT */
116, 73, 77, 69, (png_byte) '\0', /* tIME */
};
#endif
...
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
/* ignore all unknown chunks: */
png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0);
/* except for vpAg: */
png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1);
/* also ignore unused known chunks: */
png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks,
(int)sizeof(unused_chunks)/5);
#endif
User limits User limits
The PNG specification allows the width and height of an image to be as The PNG specification allows the width and height of an image to be as
@ -395,7 +468,7 @@ you want to do are limited to the following set:
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
(This excludes setting a background color, doing gamma transformation, (This excludes setting a background color, doing gamma transformation,
and setting filler.) If this is the case, simply do this: dithering, and setting filler.) If this is the case, simply do this:
png_read_png(png_ptr, info_ptr, png_transforms, NULL) png_read_png(png_ptr, info_ptr, png_transforms, NULL)
@ -422,14 +495,16 @@ where row_pointers is an array of pointers to the pixel data for each row:
If you know your image size and pixel size ahead of time, you can allocate If you know your image size and pixel size ahead of time, you can allocate
row_pointers prior to calling png_read_png() with row_pointers prior to calling png_read_png() with
if (height > PNG_UINT_32_MAX/sizeof(png_bytep)) if (height > PNG_UINT_32_MAX/png_sizeof(png_byte))
png_error (png_ptr, png_error (png_ptr,
"Image is too tall to process in memory"); "Image is too tall to process in memory");
if (width > PNG_UINT_32_MAX/pixel_size) if (width > PNG_UINT_32_MAX/pixel_size)
png_error (png_ptr, png_error (png_ptr,
"Image is too wide to process in memory"); "Image is too wide to process in memory");
row_pointers = png_malloc(png_ptr, row_pointers = png_malloc(png_ptr,
height*sizeof(png_bytep)); height*png_sizeof(png_bytep));
for (int i=0; i<height, i++)
row_pointers[i]=NULL; /* security precaution */
for (int i=0; i<height, i++) for (int i=0; i<height, i++)
row_pointers[i]=png_malloc(png_ptr, row_pointers[i]=png_malloc(png_ptr,
width*pixel_size); width*pixel_size);
@ -806,8 +881,43 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha. added. It expands the sample depth without changing tRNS to alpha.
%12%At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
%12%will be removed from a future version. As of libpng version 1.4.0beta51, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means
the tRNS chunk is present, A means an alpha channel is present, and O
means tRNS or alpha is present but all pixels in the image are opaque.
FROM 01 31 0 0T 0O 2 2T 2O 3 3T 3O 4A 4O 6A 6O
TO
01 -
31 -
0 1 -
0T -
0O -
2 GX -
2T -
2O -
3 1 -
3T -
3O -
4A T -
4O -
6A GX TX TX -
6O GX TX -
Within the matrix,
"-" means the transformation is not supported.
"X" means the transformation is obtained by png_set_expand().
"1" means the transformation is obtained by
png_set_expand_gray_1_2_4_to_8
"G" means the transformation is obtained by
png_set_gray_to_rgb().
"P" means the transformation is obtained by
png_set_expand_palette_to_rgb().
"T" means the transformation is obtained by
png_set_tRNS_to_alpha().
PNG can have files with 16 bits per channel. If you only can handle PNG can have files with 16 bits per channel. If you only can handle
8 bits per channel, this will strip the pixels down to 8 bit. 8 bits per channel, this will strip the pixels down to 8 bit.
@ -1041,7 +1151,6 @@ recommended that PNG viewers support gamma correction.
else else
png_set_gamma(png_ptr, screen_gamma, 0.45455); png_set_gamma(png_ptr, screen_gamma, 0.45455);
PNG files describe monochrome as black being zero and white being one. PNG files describe monochrome as black being zero and white being one.
The following code will reverse this (make black be one and white be The following code will reverse this (make black be one and white be
zero): zero):
@ -1724,6 +1833,11 @@ Some of the more important parts of the png_info are:
can also be can also be
PNG_INTRAPIXEL_DIFFERENCING) PNG_INTRAPIXEL_DIFFERENCING)
If you call png_set_IHDR(), the call must appear before any of the
other png_set_*() functions, which might require access to some of
the IHDR settings. The remaining png_set_*() functions can be called
in any order.
png_set_PLTE(png_ptr, info_ptr, palette, png_set_PLTE(png_ptr, info_ptr, palette,
num_palette); num_palette);
palette - the palette for the file palette - the palette for the file
@ -1995,7 +2109,6 @@ transformations are permitted, enabled by the following masks.
PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity
to transparency to transparency
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
PNG_TRANSFORM_STRIP_FILLER Strip out filler PNG_TRANSFORM_STRIP_FILLER Strip out filler
bytes (deprecated). bytes (deprecated).
PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading
@ -2340,17 +2453,13 @@ For a more compact example of writing a PNG image, see the file example.c.
V. Modifying/Customizing libpng: V. Modifying/Customizing libpng:
There are three issues here. The first is changing how libpng does There are two issues here. The first is changing how libpng does
standard things like memory allocation, input/output, and error handling. standard things like memory allocation, input/output, and error handling.
The second deals with more complicated things like adding new chunks, The second deals with more complicated things like adding new chunks,
adding new transformations, and generally changing how libpng works. adding new transformations, and generally changing how libpng works.
Both of those are compile-time issues; that is, they are generally Both of those are compile-time issues; that is, they are generally
determined at the time the code is written, and there is rarely a need determined at the time the code is written, and there is rarely a need
to provide the user with a means of changing them. The third is a to provide the user with a means of changing them.
run-time issue: choosing between and/or tuning one or more alternate
versions of computationally intensive routines; specifically, optimized
assembly-language (and therefore compiler- and platform-dependent)
versions.
Memory allocation, input/output, and error handling Memory allocation, input/output, and error handling
@ -2382,6 +2491,9 @@ Your malloc_fn() must return NULL in case of failure. The png_malloc()
function will normally call png_error() if it receives a NULL from the function will normally call png_error() if it receives a NULL from the
system memory allocator or from your replacement malloc_fn(). system memory allocator or from your replacement malloc_fn().
Your free_fn() will never be called with a NULL ptr, since libpng's
png_free() checks for NULL before calling free_fn().
Input/Output in libpng is done through png_read() and png_write(), Input/Output in libpng is done through png_read() and png_write(),
which currently just call fread() and fwrite(). The FILE * is stored in which currently just call fread() and fwrite(). The FILE * is stored in
png_struct and is initialized via png_init_io(). If you wish to change png_struct and is initialized via png_init_io(). If you wish to change
@ -2413,8 +2525,11 @@ The user_read_data() function is responsible for detecting and
handling end-of-data errors. handling end-of-data errors.
Supplying NULL for the read, write, or flush functions sets them back Supplying NULL for the read, write, or flush functions sets them back
to using the default C stream functions. It is an error to read from to using the default C stream functions, which expect the io_ptr to
a write stream, and vice versa. point to a standard *FILE structure. It is probably a mistake
to use NULL for one of write_data_fn and output_flush_fn but not both
of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined.
It is an error to read from a write stream, and vice versa.
Error handling in libpng is done through png_error() and png_warning(). Error handling in libpng is done through png_error() and png_warning().
Errors handled through png_error() are fatal, meaning that png_error() Errors handled through png_error() are fatal, meaning that png_error()
@ -2520,9 +2635,11 @@ you may also have to change the memory allocators (png_malloc, etc.).
Configuring for compiler xxx: Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it. The includes that or delete an include, this is the place to do it.
are not needed outside libpng are placed inside pngpriv.h, which is The includes that are not needed outside libpng are placed in pngpriv.h,
only used by the routines inside libpng itself. which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h.
Configuring zlib: Configuring zlib:
@ -2738,7 +2855,7 @@ or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at them. You may wish to consider using libmng (available at
http://www.libmng.com) instead. http://www.libmng.com) instead.
VIII. Changes to Libpng from version 0.88 VII. Changes to Libpng from version 0.88
It should be noted that versions of libpng later than 0.96 are not It should be noted that versions of libpng later than 0.96 are not
distributed by the original libpng author, Guy Schalnat, nor by distributed by the original libpng author, Guy Schalnat, nor by
@ -2787,15 +2904,15 @@ application:
png_uint_32 application_vn = PNG_LIBPNG_VER; png_uint_32 application_vn = PNG_LIBPNG_VER;
IX. Y2K Compliance in libpng VIII. Y2K Compliance in libpng
March 9, 2009 March 21, 2009
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.4.0beta50 are Y2K compliant. It is my belief that earlier upward through 1.4.0beta51 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

199
libpng.3
View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "March 9, 2009" .TH LIBPNG 3 "March 21, 2009"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta50 libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta51
.SH SYNOPSIS .SH SYNOPSIS
\fI\fB \fI\fB
@ -809,14 +809,18 @@ 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.4.0beta50 - March 9, 2009 libpng version 1.4.0beta51 - March 21, 2009
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-2005 Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson
For conditions of distribution and use, see copyright For conditions of distribution and use, see copyright
notice in png.h. notice in png.h.
based on: Based on:
libpng versions 0.97, January 1998, through 1.4.0beta51 - March 21, 2009
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson
libpng 1.0 beta 6 version 0.96 May 28, 1997 libpng 1.0 beta 6 version 0.96 May 28, 1997
Updated and distributed by Andreas Dilger Updated and distributed by Andreas Dilger
@ -842,6 +846,10 @@ it is heavily commented and should include everything most people
will need. We assume that libpng is already installed; see the will need. We assume that libpng is already installed; see the
INSTALL file for instructions on how to install libpng. INSTALL file for instructions on how to install libpng.
For examples of libpng usage, see the files "example.c", "pngtest.c",
and the files in the "contrib" directory, all of which are included in the
libpng distribution.
Libpng was written as a companion to the PNG specification, as a way Libpng was written as a companion to the PNG specification, as a way
of reducing the amount of time and effort it takes to support the PNG of reducing the amount of time and effort it takes to support the PNG
file format in application programs. file format in application programs.
@ -852,12 +860,14 @@ a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at
The W3C and ISO documents have identical technical content. The W3C and ISO documents have identical technical content.
The PNG-1.2 specification is available at The PNG-1.2 specification is available at
<http://www.libpng.org/pub/png/documents/> <http://www.libpng.org/pub/png/documents/>. It is technically equivalent
to the PNG specification (second edition) but has some additional material.
The PNG-1.0 specification is available The PNG-1.0 specification is available
as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a
W3C Recommendation <http://www.w3.org/TR/REC.png.html>. Some W3C Recommendation <http://www.w3.org/TR/REC.png.html>.
additional chunks are described in the special-purpose public chunks
Some additional chunks are described in the special-purpose public chunks
documents at <http://www.libpng.org/pub/png/documents/>. documents at <http://www.libpng.org/pub/png/documents/>.
Other information Other information
@ -1065,15 +1075,19 @@ input stream. You must supply the function
png_unknown_chunkp chunk); png_unknown_chunkp chunk);
{ {
/* The unknown chunk structure contains your /* The unknown chunk structure contains your
chunk data: */ chunk data, along with similar data for any other
unknown chunks: */
png_byte name[5]; png_byte name[5];
png_byte *data; png_byte *data;
png_size_t size; png_size_t size;
/* Note that libpng has already taken care of /* Note that libpng has already taken care of
the CRC handling */ the CRC handling */
/* put your code here. Return one of the /* put your code here. Search for your chunk in the
following: */ unknown chunk structure, process it, and return one
of the following: */
return (-n); /* chunk had an error */ return (-n); /* chunk had an error */
return (0); /* did not recognize */ return (0); /* did not recognize */
@ -1093,6 +1107,11 @@ you can retrieve with
png_get_user_chunk_ptr(png_ptr); png_get_user_chunk_ptr(png_ptr);
If you call the png_set_read_user_chunk_fn() function, then all unknown
chunks will be saved when read, in case your callback function will need
one or more of them. This behavior can be changed with the
png_set_keep_unknown_chunks() function, described below.
At this point, you can set up a callback function that will be At this point, you can set up a callback function that will be
called after each row has been read, which you can use to control called after each row has been read, which you can use to control
a progress meter or the like. It's demonstrated in pngtest.c. a progress meter or the like. It's demonstrated in pngtest.c.
@ -1109,18 +1128,42 @@ You must supply a function
To inform libpng about your function, use To inform libpng about your function, use
png_set_read_status_fn(png_ptr, read_row_callback); png_set_read_status_fn(png_ptr, read_row_callback);
.SS Width and height limits
The PNG specification allows the width and height of an image to be as
large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
Since very few applications really need to process such large images,
we have imposed an arbitrary 1-million limit on rows and columns.
Larger images will be rejected immediately with a png_error() call. If
you wish to override this limit, you can use
png_set_user_limits(png_ptr, width_max, height_max);
to set your own limits, or use width_max = height_max = 0x7fffffffL
to allow all valid dimensions (libpng may reject some very large images
anyway because of potential buffer overflow conditions).
You should put this statement after you create the PNG structure and
before calling png_read_info(), png_read_png(), or png_process_data().
If you need to retrieve the limits that are being applied, use
width_max = png_get_user_width_max(png_ptr);
height_max = png_get_user_height_max(png_ptr);
.SS Unknown-chunk handling .SS Unknown-chunk handling
Now you get to set the way the library processes unknown chunks in the Now you get to set the way the library processes unknown chunks in the
input PNG stream. Both known and unknown chunks will be read. Normal input PNG stream. Both known and unknown chunks will be read. Normal
behavior is that known chunks will be parsed into information in behavior is that known chunks will be parsed into information in
various info_ptr members; unknown chunks will be discarded. To change various info_ptr members while unknown chunks will be discarded. This
this, you can call: behavior can be wasteful if your application will never use some known
chunk types. To change this, you can call:
png_set_keep_unknown_chunks(png_ptr, keep, png_set_keep_unknown_chunks(png_ptr, keep,
chunk_list, num_chunks); chunk_list, num_chunks);
keep - 0: do not handle as unknown keep - 0: default unknown chunk handling
1: do not keep 1: ignore; do not keep
2: keep only if safe-to-copy 2: keep only if safe-to-copy
3: keep even if unsafe-to-copy 3: keep even if unsafe-to-copy
You can use these definitions: You can use these definitions:
@ -1143,6 +1186,36 @@ instances of png_set_keep_unknown_chunks(), the final instance will
take precedence. The IHDR and IEND chunks should not be named in take precedence. The IHDR and IEND chunks should not be named in
chunk_list; if they are, libpng will process them normally anyway. chunk_list; if they are, libpng will process them normally anyway.
Here is an example of the usage of png_set_keep_unknown_chunks(),
where the private "vpAg" chunk will later be processed by a user chunk
callback function:
png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'};
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
png_byte unused_chunks[]=
{
104, 73, 83, 84, (png_byte) '\0', /* hIST */
105, 84, 88, 116, (png_byte) '\0', /* iTXt */
112, 67, 65, 76, (png_byte) '\0', /* pCAL */
115, 67, 65, 76, (png_byte) '\0', /* sCAL */
115, 80, 76, 84, (png_byte) '\0', /* sPLT */
116, 73, 77, 69, (png_byte) '\0', /* tIME */
};
#endif
...
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
/* ignore all unknown chunks: */
png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0);
/* except for vpAg: */
png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1);
/* also ignore unused known chunks: */
png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks,
(int)sizeof(unused_chunks)/5);
#endif
.SS User limits .SS User limits
The PNG specification allows the width and height of an image to be as The PNG specification allows the width and height of an image to be as
@ -1204,7 +1277,7 @@ you want to do are limited to the following set:
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
(This excludes setting a background color, doing gamma transformation, (This excludes setting a background color, doing gamma transformation,
and setting filler.) If this is the case, simply do this: dithering, and setting filler.) If this is the case, simply do this:
png_read_png(png_ptr, info_ptr, png_transforms, NULL) png_read_png(png_ptr, info_ptr, png_transforms, NULL)
@ -1231,14 +1304,16 @@ where row_pointers is an array of pointers to the pixel data for each row:
If you know your image size and pixel size ahead of time, you can allocate If you know your image size and pixel size ahead of time, you can allocate
row_pointers prior to calling png_read_png() with row_pointers prior to calling png_read_png() with
if (height > PNG_UINT_32_MAX/sizeof(png_bytep)) if (height > PNG_UINT_32_MAX/png_sizeof(png_byte))
png_error (png_ptr, png_error (png_ptr,
"Image is too tall to process in memory"); "Image is too tall to process in memory");
if (width > PNG_UINT_32_MAX/pixel_size) if (width > PNG_UINT_32_MAX/pixel_size)
png_error (png_ptr, png_error (png_ptr,
"Image is too wide to process in memory"); "Image is too wide to process in memory");
row_pointers = png_malloc(png_ptr, row_pointers = png_malloc(png_ptr,
height*sizeof(png_bytep)); height*png_sizeof(png_bytep));
for (int i=0; i<height, i++)
row_pointers[i]=NULL; /* security precaution */
for (int i=0; i<height, i++) for (int i=0; i<height, i++)
row_pointers[i]=png_malloc(png_ptr, row_pointers[i]=png_malloc(png_ptr,
width*pixel_size); width*pixel_size);
@ -1615,8 +1690,43 @@ things.
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
added. It expands the sample depth without changing tRNS to alpha. added. It expands the sample depth without changing tRNS to alpha.
%12%At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
%12%will be removed from a future version. As of libpng version 1.4.0beta51, not all possible expansions are supported.
In the following table, the 01 means grayscale with depth<8, 31 means
indexed with depth<8, other numerals represent the color type, "T" means
the tRNS chunk is present, A means an alpha channel is present, and O
means tRNS or alpha is present but all pixels in the image are opaque.
FROM 01 31 0 0T 0O 2 2T 2O 3 3T 3O 4A 4O 6A 6O
TO
01 -
31 -
0 1 -
0T -
0O -
2 GX -
2T -
2O -
3 1 -
3T -
3O -
4A T -
4O -
6A GX TX TX -
6O GX TX -
Within the matrix,
"-" means the transformation is not supported.
"X" means the transformation is obtained by png_set_expand().
"1" means the transformation is obtained by
png_set_expand_gray_1_2_4_to_8
"G" means the transformation is obtained by
png_set_gray_to_rgb().
"P" means the transformation is obtained by
png_set_expand_palette_to_rgb().
"T" means the transformation is obtained by
png_set_tRNS_to_alpha().
PNG can have files with 16 bits per channel. If you only can handle PNG can have files with 16 bits per channel. If you only can handle
8 bits per channel, this will strip the pixels down to 8 bit. 8 bits per channel, this will strip the pixels down to 8 bit.
@ -1850,7 +1960,6 @@ recommended that PNG viewers support gamma correction.
else else
png_set_gamma(png_ptr, screen_gamma, 0.45455); png_set_gamma(png_ptr, screen_gamma, 0.45455);
PNG files describe monochrome as black being zero and white being one. PNG files describe monochrome as black being zero and white being one.
The following code will reverse this (make black be one and white be The following code will reverse this (make black be one and white be
zero): zero):
@ -2533,6 +2642,11 @@ Some of the more important parts of the png_info are:
can also be can also be
PNG_INTRAPIXEL_DIFFERENCING) PNG_INTRAPIXEL_DIFFERENCING)
If you call png_set_IHDR(), the call must appear before any of the
other png_set_*() functions, which might require access to some of
the IHDR settings. The remaining png_set_*() functions can be called
in any order.
png_set_PLTE(png_ptr, info_ptr, palette, png_set_PLTE(png_ptr, info_ptr, palette,
num_palette); num_palette);
palette - the palette for the file palette - the palette for the file
@ -2804,7 +2918,6 @@ transformations are permitted, enabled by the following masks.
PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity PNG_TRANSFORM_INVERT_ALPHA Change alpha from opacity
to transparency to transparency
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
PNG_TRANSFORM_STRIP_FILLER Strip out filler PNG_TRANSFORM_STRIP_FILLER Strip out filler
bytes (deprecated). bytes (deprecated).
PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading PNG_TRANSFORM_STRIP_FILLER_BEFORE Strip out leading
@ -3149,17 +3262,13 @@ For a more compact example of writing a PNG image, see the file example.c.
.SH V. Modifying/Customizing libpng: .SH V. Modifying/Customizing libpng:
There are three issues here. The first is changing how libpng does There are two issues here. The first is changing how libpng does
standard things like memory allocation, input/output, and error handling. standard things like memory allocation, input/output, and error handling.
The second deals with more complicated things like adding new chunks, The second deals with more complicated things like adding new chunks,
adding new transformations, and generally changing how libpng works. adding new transformations, and generally changing how libpng works.
Both of those are compile-time issues; that is, they are generally Both of those are compile-time issues; that is, they are generally
determined at the time the code is written, and there is rarely a need determined at the time the code is written, and there is rarely a need
to provide the user with a means of changing them. The third is a to provide the user with a means of changing them.
run-time issue: choosing between and/or tuning one or more alternate
versions of computationally intensive routines; specifically, optimized
assembly-language (and therefore compiler- and platform-dependent)
versions.
Memory allocation, input/output, and error handling Memory allocation, input/output, and error handling
@ -3191,6 +3300,9 @@ Your malloc_fn() must return NULL in case of failure. The png_malloc()
function will normally call png_error() if it receives a NULL from the function will normally call png_error() if it receives a NULL from the
system memory allocator or from your replacement malloc_fn(). system memory allocator or from your replacement malloc_fn().
Your free_fn() will never be called with a NULL ptr, since libpng's
png_free() checks for NULL before calling free_fn().
Input/Output in libpng is done through png_read() and png_write(), Input/Output in libpng is done through png_read() and png_write(),
which currently just call fread() and fwrite(). The FILE * is stored in which currently just call fread() and fwrite(). The FILE * is stored in
png_struct and is initialized via png_init_io(). If you wish to change png_struct and is initialized via png_init_io(). If you wish to change
@ -3222,8 +3334,11 @@ The user_read_data() function is responsible for detecting and
handling end-of-data errors. handling end-of-data errors.
Supplying NULL for the read, write, or flush functions sets them back Supplying NULL for the read, write, or flush functions sets them back
to using the default C stream functions. It is an error to read from to using the default C stream functions, which expect the io_ptr to
a write stream, and vice versa. point to a standard *FILE structure. It is probably a mistake
to use NULL for one of write_data_fn and output_flush_fn but not both
of them, unless you have built libpng with PNG_NO_WRITE_FLUSH defined.
It is an error to read from a write stream, and vice versa.
Error handling in libpng is done through png_error() and png_warning(). Error handling in libpng is done through png_error() and png_warning().
Errors handled through png_error() are fatal, meaning that png_error() Errors handled through png_error() are fatal, meaning that png_error()
@ -3329,9 +3444,11 @@ you may also have to change the memory allocators (png_malloc, etc.).
.SS Configuring for compiler xxx: .SS Configuring for compiler xxx:
All includes for libpng are in pngconf.h. If you need to add, change All includes for libpng are in pngconf.h. If you need to add, change
or delete an include, this is the place to do it. The includes that or delete an include, this is the place to do it.
are not needed outside libpng are placed inside pngpriv.h, which is The includes that are not needed outside libpng are placed in pngpriv.h,
only used by the routines inside libpng itself. which is only used by the routines inside libpng itself.
The files in libpng proper only include pngpriv.h and png.h, which
in turn includes pngconf.h.
.SS Configuring zlib: .SS Configuring zlib:
@ -3547,7 +3664,7 @@ or any other MNG chunks; your application must provide its own support for
them. You may wish to consider using libmng (available at them. You may wish to consider using libmng (available at
http://www.libmng.com) instead. http://www.libmng.com) instead.
.SH VIII. Changes to Libpng from version 0.88 .SH VII. Changes to Libpng from version 0.88
It should be noted that versions of libpng later than 0.96 are not It should be noted that versions of libpng later than 0.96 are not
distributed by the original libpng author, Guy Schalnat, nor by distributed by the original libpng author, Guy Schalnat, nor by
@ -3596,15 +3713,15 @@ application:
png_uint_32 application_vn = PNG_LIBPNG_VER; png_uint_32 application_vn = PNG_LIBPNG_VER;
.SH IX. Y2K Compliance in libpng .SH VIII. Y2K Compliance in libpng
March 9, 2009 March 21, 2009
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.4.0beta50 are Y2K compliant. It is my belief that earlier upward through 1.4.0beta51 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
@ -3772,7 +3889,7 @@ the first widely used release:
1.4.0beta9-14 14 10400 14.so.0.0[.0] 1.4.0beta9-14 14 10400 14.so.0.0[.0]
1.2.13 13 10213 12.so.0.13[.0] 1.2.13 13 10213 12.so.0.13[.0]
1.4.0beta15-36 14 10400 14.so.0.0[.0] 1.4.0beta15-36 14 10400 14.so.0.0[.0]
1.4.0beta37-50 14 10400 14.so.14.0[.0] 1.4.0beta37-51 14 10400 14.so.14.0[.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
@ -3828,7 +3945,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.4.0beta50 - March 9, 2009: Libpng version 1.4.0beta51 - March 21, 2009:
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).
@ -3849,7 +3966,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.4.0beta50, March 9, 2009, are libpng versions 1.2.6, August 15, 2004, through 1.4.0beta51, March 21, 2009, are
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are Copyright (c) 2004,2006-2007 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
@ -3948,7 +4065,7 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
March 9, 2009 March 21, 2009
.\" end of man page .\" end of man page

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "March 9, 2009" .TH LIBPNGPF 3 "March 21, 2009"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta50 libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta51
(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 "March 9, 2009" .TH PNG 5 "March 21, 2009"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION

8
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -13,7 +13,7 @@
#include "pngpriv.h" #include "pngpriv.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_4_0beta50 Your_png_h_is_not_version_1_4_0beta50; typedef version_1_4_0beta51 Your_png_h_is_not_version_1_4_0beta51;
/* 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. */
@ -641,13 +641,13 @@ png_get_copyright(png_structp png_ptr)
#else #else
#ifdef __STDC__ #ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \ return ((png_charp) PNG_STRING_NEWLINE \
"libpng version x 1.4.0beta50 - March 9, 2009" PNG_STRING_NEWLINE \ "libpng version x 1.4.0beta51 - March 21, 2009" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2009 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2009 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE); PNG_STRING_NEWLINE);
#else #else
return ((png_charp) "libpng version 1.4.0beta50 - March 9, 2009\ return ((png_charp) "libpng version 1.4.0beta51 - March 21, 2009\
Copyright (c) 1998-2009 Glenn Randers-Pehrson\ Copyright (c) 1998-2009 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");

26
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.4.0beta50 - March 9, 2009 * libpng version 1.4.0beta51 - March 21, 2009
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 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.)
@ -9,7 +9,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.4.0beta50 - March 9, 2009: Glenn * libpng versions 0.97, January 1998, through 1.4.0beta51 - March 21, 2009: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -127,7 +127,7 @@
* 1.4.0beta9-14 14 10400 14.so.0.0[.0] * 1.4.0beta9-14 14 10400 14.so.0.0[.0]
* 1.2.13 13 10213 12.so.0.10[.0] * 1.2.13 13 10213 12.so.0.10[.0]
* 1.4.0beta15-36 14 10400 14.so.0.0[.0] * 1.4.0beta15-36 14 10400 14.so.0.0[.0]
* 1.4.0beta37-50 14 10400 14.so.14.0[.0] * 1.4.0beta37-51 14 10400 14.so.14.0[.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
@ -157,7 +157,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.4.0beta50, March 9, 2009, are * libpng versions 1.2.6, August 15, 2004, through 1.4.0beta51, March 21, 2009, are
* Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are * Copyright (c) 2004, 2006-2007 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:
@ -275,7 +275,7 @@
* 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.4.0beta50 are Y2K compliant. It is my belief that earlier * upward through 1.4.0beta51 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
@ -331,9 +331,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.4.0beta50" #define PNG_LIBPNG_VER_STRING "1.4.0beta51"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.4.0beta50 - March 9, 2009\n" " libpng version 1.4.0beta51 - March 21, 2009\n"
#define PNG_LIBPNG_VER_SONUM 14 #define PNG_LIBPNG_VER_SONUM 14
#define PNG_LIBPNG_VER_DLLNUM 14 #define PNG_LIBPNG_VER_DLLNUM 14
@ -345,7 +345,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 50 #define PNG_LIBPNG_VER_BUILD 51
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@ -1356,7 +1356,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_4_0beta50; typedef png_structp version_1_4_0beta51;
typedef png_struct FAR * FAR * png_structpp; typedef png_struct FAR * FAR * png_structpp;
@ -1524,7 +1524,8 @@ extern PNG_EXPORT(void,png_set_invert_alpha) PNGARG((png_structp png_ptr));
#endif #endif
#if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED) #if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED)
extern PNG_EXPORT(void,png_set_premultiply_alpha) PNGARG((png_structp png_ptr)); extern PNG_EXPORT(void,png_set_premultiply_alpha)
PNGARG((png_structp png_ptr));
#endif #endif
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
@ -1835,6 +1836,11 @@ extern PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr));
* If buffered output is not used, then output_flush_fn can be set to NULL. * If buffered output is not used, then output_flush_fn can be set to NULL.
* If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time
* output_flush_fn will be ignored (and thus can be NULL). * output_flush_fn will be ignored (and thus can be NULL).
* It is probably a mistake to use NULL for output_flush_fn if
* write_data_fn is not also NULL unless you have built libpng with
* PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's
* default flush function, which uses the standard *FILE structure, will
* be used.
*/ */
extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr, extern PNG_EXPORT(void,png_set_write_fn) PNGARG((png_structp png_ptr,
png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn));

View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.4.0beta50 - March 9, 2009 * libpng version 1.4.0beta51 - March 21, 2009
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -1339,7 +1339,6 @@ typedef char FAR * FAR * FAR * png_charppp;
# define NOCHECK 0 # define NOCHECK 0
# define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK)) # define CVT_PTR(ptr) (png_far_to_near(png_ptr,ptr,CHECK))
# define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK)) # define CVT_PTR_NOCHECK(ptr) (png_far_to_near(png_ptr,ptr,NOCHECK))
# define png_fileno _fileno /* Added to v 1.4.0 */
# define png_strcpy _fstrcpy # define png_strcpy _fstrcpy
# define png_strncpy _fstrncpy /* Added to v 1.2.6 */ # define png_strncpy _fstrncpy /* Added to v 1.2.6 */
# define png_strlen _fstrlen # define png_strlen _fstrlen
@ -1351,7 +1350,6 @@ typedef char FAR * FAR * FAR * png_charppp;
# if defined(_WINDOWS_) /* favor Windows over C runtime fns */ # if defined(_WINDOWS_) /* favor Windows over C runtime fns */
# define CVT_PTR(ptr) (ptr) # define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_fileno fileno
# define png_strcpy lstrcpyA # define png_strcpy lstrcpyA
# define png_strncpy lstrcpynA # define png_strncpy lstrcpynA
# define png_strlen lstrlenA # define png_strlen lstrlenA
@ -1362,7 +1360,6 @@ typedef char FAR * FAR * FAR * png_charppp;
# else # else
# define CVT_PTR(ptr) (ptr) # define CVT_PTR(ptr) (ptr)
# define CVT_PTR_NOCHECK(ptr) (ptr) # define CVT_PTR_NOCHECK(ptr) (ptr)
# define png_fileno fileno /* Added to v 1.4.0 */
# define png_strcpy strcpy # define png_strcpy strcpy
# define png_strncpy strncpy /* Added to v 1.2.6 */ # define png_strncpy strncpy /* Added to v 1.2.6 */
# define png_strlen strlen # define png_strlen strlen

View File

@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation /* pngerror.c - stub functions for i/o and memory allocation
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -45,39 +45,18 @@ png_error(png_structp png_ptr, png_const_charp error_message)
if (*error_message == PNG_LITERAL_SHARP) if (*error_message == PNG_LITERAL_SHARP)
{ {
/* Strip "#nnnn " from beginning of error message. */ /* Strip "#nnnn " from beginning of error message. */
/*
* 012345678901234567890
* error_message: #nnnn text\0
* error_number: nnnn\0
* msg: : nnnn \0
* offset points to the first blank after nnnn
* In this example, offset is 5.
*/
int offset; int offset;
for (offset = 1; offset<15; offset++) for (offset = 1; offset<15; offset++)
if (error_message[offset] == ' ') if (error_message[offset] == ' ')
break; break;
/* it is 5 because the loop iterations saw
* offset==1, error_message[1]=="n"; offset++.
* offset==2, error_message[2]=="n"; offset++.
* offset==3, error_message[3]=="n"; offset++.
* offset==4, error_message[4]=="n"; offset++.
* offset==5, error_message[5]==" "; break.
*/
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
{ {
int i; int i;
/* Copy the "nnnn" or however many there are, plus the
* blank to the beginning of "msg" string.
*/
for (i = 0; i < offset - 1; i++) for (i = 0; i < offset - 1; i++)
msg[i] = error_message[i + 1]; msg[i] = error_message[i + 1];
/* In the example, "i" ends up being 5.
*/
msg[i - 1] = '\0'; msg[i - 1] = '\0';
error_message = msg; error_message = msg;
} }
/* msg, and error_message, now contain "nnnn \0". */
else else
error_message += offset; error_message += offset;
} }
@ -261,14 +240,6 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
if (*error_message == PNG_LITERAL_SHARP) if (*error_message == PNG_LITERAL_SHARP)
{ {
/* Strip "#nnnn " from beginning of error message. */ /* Strip "#nnnn " from beginning of error message. */
/*
* 012345678901234567890
* error_message: #nnnn text\0
* error_number: nnnn\0
* offset points to the first blank after nnnn
* In this example, offset is 5, and we want to
* insert a terminating NULL at error_number[4].
*/
int offset; int offset;
char error_number[16]; char error_number[16];
for (offset = 0; offset<15; offset++) for (offset = 0; offset<15; offset++)
@ -277,21 +248,9 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
if (error_message[offset] == ' ') if (error_message[offset] == ' ')
break; break;
} }
/* This is unnecessarily slightly different from above, but
* offset is still 5 because the loop iterations saw
* offset==0, error_message[0]=="#"; error_number[0]="n";offset++.
* offset==1, error_message[1]=="n"; error_number[1]="n";offset++
* offset==2, error_message[2]=="n"; error_number[2]="n";offset++
* offset==3, error_message[3]=="n"; error_number[3]="n";offset++
* offset==4, error_message[4]=="n"; error_number[4]=" ";offset++.
* offset==5, error_message[5]==" "; break.
*/
if ((offset > 1) && (offset < 15)) if ((offset > 1) && (offset < 15))
{ {
/* Replace the " " with a string-terminating NULL */
error_number[offset - 1] = '\0'; error_number[offset - 1] = '\0';
/* GRR: this should be [offset + 1] */
/* should we update "offset" to point to the beginning of the text? */
fprintf(stderr, "libpng error no. %s: %s", fprintf(stderr, "libpng error no. %s: %s",
error_number, error_message + offset + 1); error_number, error_message + offset + 1);
fprintf(stderr, PNG_STRING_NEWLINE); fprintf(stderr, PNG_STRING_NEWLINE);

View File

@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct /* pngget.c - retrieval of values from info struct
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngmem.c - stub functions for memory allocation /* pngmem.c - stub functions for memory allocation
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode /* pngpread.c - read a png file in push mode
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngpriv.h - private declarations for use inside libpng /* pngpriv.h - private declarations for use inside libpng
* *
* libpng version 1.4.0beta50 - March 9, 2009 * libpng version 1.4.0beta51 - March 21, 2009
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -123,7 +123,8 @@
/* 0x800000L Unused */ /* 0x800000L Unused */
#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */ #define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */
#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */ #define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */
#define PNG_PREMULTIPLY_ALPHA 0x4000000L /* Added to libpng-1.4.0 by volker */ #define PNG_PREMULTIPLY_ALPHA 0x4000000L /* Added to libpng-1.4.0 */
/* by volker */
/* 0x8000000L unused */ /* 0x8000000L unused */
/* 0x10000000L unused */ /* 0x10000000L unused */
/* 0x20000000L unused */ /* 0x20000000L unused */
@ -583,17 +584,17 @@ PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
png_bytep row)); png_bytep row));
#endif #endif
#if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED)
PNG_EXTERN void png_do_read_premultiply_alpha PNGARG((png_row_infop row_info,
png_bytep row));
#endif
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \ #if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED) defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info, PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
png_bytep row, png_uint_32 flags)); png_bytep row, png_uint_32 flags));
#endif #endif
#if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED)
PNG_EXTERN void png_do_read_premultiply_alpha
PNGARG((png_row_infop row_info, png_bytep row));
#endif
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row)); PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
#endif #endif

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file /* pngread.c - read a PNG file
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -1383,18 +1383,16 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
#else #else
info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
info_ptr->height * png_sizeof(png_bytep)); info_ptr->height * png_sizeof(png_bytep));
png_memset(info_ptr->row_pointers, 0, png_memset(info_ptr->row_pointers, 0, info_ptr->height
info_ptr->height * png_sizeof(png_bytep)); * png_sizeof(png_bytep));
#endif #endif
#ifdef PNG_FREE_ME_SUPPORTED #ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_ROWS; info_ptr->free_me |= PNG_FREE_ROWS;
#endif #endif
for (row = 0; row < (int)info_ptr->height; row++) for (row = 0; row < (int)info_ptr->height; row++)
{
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
png_get_rowbytes(png_ptr, info_ptr)); png_get_rowbytes(png_ptr, info_ptr));
} }
}
png_read_image(png_ptr, info_ptr->row_pointers); png_read_image(png_ptr, info_ptr->row_pointers);
info_ptr->valid |= PNG_INFO_IDAT; info_ptr->valid |= PNG_INFO_IDAT;

View File

@ -1,7 +1,7 @@
/* pngrio.c - functions for data input /* pngrio.c - functions for data input
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers /* pngrtran.c - transforms the data in a row for PNG readers
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -1465,7 +1465,8 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
#if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED) #if defined(PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED)
if (png_ptr->transformations & PNG_PREMULTIPLY_ALPHA) if (png_ptr->transformations & PNG_PREMULTIPLY_ALPHA)
png_do_read_premultiply_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); png_do_read_premultiply_alpha(&(png_ptr->row_info),
png_ptr->row_buf + 1);
#endif #endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)

View File

@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -3252,11 +3252,11 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
{ {
png_free(png_ptr, png_ptr->big_row_buf); png_free(png_ptr, png_ptr->big_row_buf);
if (png_ptr->interlaced) if (png_ptr->interlaced)
png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, row_bytes+64); png_ptr->big_row_buf = (png_bytep)png_calloc(png_ptr, row_bytes + 64);
else else
png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes+64); png_ptr->big_row_buf = (png_bytep)png_malloc(png_ptr, row_bytes + 64);
png_ptr->row_buf = png_ptr->big_row_buf+32; png_ptr->row_buf = png_ptr->big_row_buf + 32;
png_ptr->old_big_row_buf_size = row_bytes+64; png_ptr->old_big_row_buf_size = row_bytes + 64;
} }
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K

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.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng /* pngtest.c - a simple test program to test libpng
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -318,10 +318,8 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
static void static void
pngtest_flush(png_structp png_ptr) pngtest_flush(png_structp png_ptr)
{ {
png_FILE_p io_ptr; /* Do nothing; fflush() is said to be just a waste of energy. */
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); png_ptr = png_ptr; /* stifle compiler warning */
if (io_ptr != NULL)
fflush(io_ptr);
} }
#endif #endif
@ -1613,4 +1611,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_4_0beta50 your_png_h_is_not_version_1_4_0beta50; typedef version_1_4_0beta51 your_png_h_is_not_version_1_4_0beta51;

View File

@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers) /* pngtrans.c - transforms the data in a row (used by both readers and writers)
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngwio.c - functions for data output /* pngwio.c - functions for data output
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -119,7 +119,6 @@ png_default_flush(png_structp png_ptr)
png_FILE_p io_ptr; png_FILE_p io_ptr;
if (png_ptr == NULL) return; if (png_ptr == NULL) return;
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
if (io_ptr != NULL && png_fileno(io_ptr) != -1)
fflush(io_ptr); fflush(io_ptr);
} }
#endif #endif
@ -149,7 +148,10 @@ png_default_flush(png_structp png_ptr)
PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile
time, output_flush_fn will be ignored, although it must be time, output_flush_fn will be ignored, although it must be
supplied for compatibility. May be NULL, in which case supplied for compatibility. May be NULL, in which case
libpng's default function will be used. */ libpng's default function will be used, if
PNG_WRITE_FLUSH_SUPPORTED is defined. This is not
a good idea if io_ptr does not point to a standard
*FILE structure. */
void PNGAPI void PNGAPI
png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn) png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file /* pngwrite.c - general routines to write a PNG file
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngwtran.c - transforms the data in a row for PNG writers /* pngwtran.c - transforms the data in a row for PNG writers
* *
* Last changed in libpng 1.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

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.4.0 [March 9, 2009] * Last changed in libpng 1.4.0 [March 21, 2009]
* 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-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -178,7 +178,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.4.0beta50 # VERSION 0.${PNGLIB_RELEASE}.1.4.0beta51
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.4.0beta50 version=1.4.0beta51
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
Name: libpng Name: libpng
Description: Loads and saves PNG files Description: Loads and saves PNG files
Version: 1.4.0beta50 Version: 1.4.0beta51
Libs: -L${libdir} -lpng14 Libs: -L${libdir} -lpng14
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -20,7 +20,7 @@ LN_SF = ln -f -s
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
prefix=/usr/local prefix=/usr/local

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -65,7 +65,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
CYGDLL = 14 CYGDLL = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
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 = libpng14 LIBNAME = libpng14
PNGMAJ = 12 PNGMAJ = 12
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -5,7 +5,7 @@
# Library name: # Library name:
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng14 LIBNAME = libpng14

View File

@ -12,7 +12,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -16,7 +16,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
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 = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
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 = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -6,7 +6,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -81,7 +81,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
MINGDLL = 14 MINGDLL = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
SHAREDLIB=libpng$(MINGDLL).dll SHAREDLIB=libpng$(MINGDLL).dll

View File

@ -14,7 +14,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
LIB= png14 LIB= png14
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.4.0beta50 SHLIB_MINOR= 1.4.0beta51
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= pnggccrd.c 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

@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
LIB= png LIB= png
SHLIB_MAJOR= 3 SHLIB_MAJOR= 3
SHLIB_MINOR= 1.4.0beta50 SHLIB_MINOR= 1.4.0beta51
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= pnggccrd.c 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

@ -16,7 +16,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
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.4.0beta50 SHLIB_MINOR= 1.4.0beta51
LIB= png LIB= png
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \

View File

@ -9,7 +9,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -6,7 +6,7 @@
# Library name: # Library name:
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -6,7 +6,7 @@
# Library name: # Library name:
LIBNAME=libpng14 LIBNAME=libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# Shared library names: # Shared library names:

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
LIBNAME = libpng14 LIBNAME = libpng14

View File

@ -8,7 +8,7 @@
# Library name: # Library name:
LIBNAME = libpng14 LIBNAME = libpng14
PNGMAJ = 14 PNGMAJ = 14
PNGMIN = 1.4.0beta50 PNGMIN = 1.4.0beta51
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.4.0beta50 ; Version 1.4.0beta51
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.4.0beta50 ;Version 1.4.0beta51
png_build_grayscale_palette png_build_grayscale_palette
png_chunk_error png_chunk_error
png_chunk_warning png_chunk_warning