Imported from libpng-1.0.7beta12.tar

This commit is contained in:
Glenn Randers-Pehrson 2000-05-12 06:19:53 -05:00
parent 752945701e
commit 1ef65b6742
41 changed files with 390 additions and 272 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.0.7beta11 - May 6, 2000 Libpng 1.0.7beta12 - May 12, 2000
This is a public release of libpng, intended for use in production codes. This is a public release of libpng, intended for use in production codes.
@ -57,9 +57,14 @@ Changes since the last public release (1.0.6):
Overloaded png_read_init() and png_write_init() with macros that convert Overloaded png_read_init() and png_write_init() with macros that convert
calls to png_read_init_2() or png_write_init_2() that check the version calls to png_read_init_2() or png_write_init_2() that check the version
and structure sizes. and structure sizes.
In png_set_text, check if old application had allocated the png_text structure; Made PNG_NO_ITXT_SUPPORTED the default setting, to avoid memory overrun
if so, only allow one text chunk to be processed to avoid memory overrun. when old applications fill the info_ptr->text structure directly.
Added PNGAPI macro, and added it to the definitions of all exported functions. Added PNGAPI macro, and added it to the definitions of all exported functions.
Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined.
Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined.
Added png_access_version_number() function.
Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data().
Expanded libpng.3/libpng.txt information about png_data_freer().
Send comments/corrections/commendations to Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

14
CHANGES
View File

@ -729,14 +729,22 @@ version 1.0.6j [May 3, 2000]
Overloaded png_read_init() and png_write_init() with macros that convert Overloaded png_read_init() and png_write_init() with macros that convert
calls to png_read_init_2() or png_write_init_2() that check the version calls to png_read_init_2() or png_write_init_2() that check the version
and structure sizes. and structure sizes.
version 1.0.7beta11 [May 6, 2000] version 1.0.7beta11 [May 7, 2000]
Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
which are no longer used. which are no longer used.
Eliminated the three new members of png_text when PNG_NO_iTXt_SUPPORTED Eliminated the three new members of png_text when PNG_NO_iTXt_SUPPORTED
or PNG_LEGACY_SUPPORTED is defined. or PNG_LEGACY_SUPPORTED is defined.
In png_set_text, check if old application had allocated the png_text structure; Made PNG_NO_ITXT_SUPPORTED the default setting, to avoid memory overrun
if so, only allow one text chunk to be processed to avoid memory overrun. when old applications fill the info_ptr->text structure directly.
Added PNGAPI macro, and added it to the definitions of all exported functions. Added PNGAPI macro, and added it to the definitions of all exported functions.
version 1.0.7beta12 [May 12, 2000]
Revised pngset.c to avoid a problem with expanding the png_debug macro.
Deleted some extraneous defines from pngconf.h
Made PNG_NO_CONSOLE_IO the default condition when PNG_BUILD_DLL is defined.
Use MSC _RPTn debugging instead of fprintf if _MSC_VER is defined.
Added png_access_version_number() function.
Check for mask&PNG_FREE_CHNK (for TEXT, SCAL, PCAL) in png_free_data().
Expanded libpng.3/libpng.txt information about png_data_freer().
Send comments/corrections/commendations to Send comments/corrections/commendations to
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu

12
INSTALL
View File

@ -1,5 +1,5 @@
Installing libpng version 1.0.7beta11 - May 6, 2000 Installing libpng version 1.0.7beta12 - May 12, 2000
Before installing libpng, you must first install zlib. zlib Before installing libpng, you must first install zlib. zlib
can usually be found wherever you got libpng. zlib can be can usually be found wherever you got libpng. zlib can be
@ -10,7 +10,7 @@ zlib.h and zconf.h include files that correspond to the
version of zlib that's installed. 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.0.7beta11" or "lpng106" and "zlib-1.1.3" might be called "libpng-1.0.7beta12" or "lpng106" and "zlib-1.1.3"
or "zlib113") so that you have directories called "zlib" and "libpng". or "zlib113") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this: Your directory structure should look like this:
@ -47,8 +47,8 @@ The files that are presently available in the scripts directory
include include
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta11) makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta12)
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta11, makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.7beta12,
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
@ -59,9 +59,9 @@ include
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
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, creates libpng.so.2.1.0.7beta11) makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta12)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta11) makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.7beta12)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile makefile.acorn => Acorn makefile

View File

@ -5,7 +5,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.90, December 1996, through 0.96, May 1997) (libpng versions 0.90, December 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000) (libpng versions 0.97, January 1998, through 1.0.7beta12, May 12, 2000)
For the purposes of this copyright and license, "Contributing Authors" For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals: is defined as the following set of individuals:
@ -68,4 +68,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson Glenn Randers-Pehrson
randeg@alum.rpi.edu randeg@alum.rpi.edu
May 6, 2000 May 12, 2000

10
README
View File

@ -1,4 +1,4 @@
README for libpng 1.0.7beta11 - May 6, 2000 (shared library 2.1) README for libpng 1.0.7beta12 - May 12, 2000 (shared library 2.1)
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.
@ -172,9 +172,9 @@ 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.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng.so.2.1.0.7beta11) (gcc, creates libpng.so.2.1.0.7beta12)
makefile.gcmmx => Linux/ELF makefile (gcc, creates makefile.gcmmx => Linux/ELF makefile (gcc, creates
libpng.so.2.1.0.7beta11, uses assembler code libpng.so.2.1.0.7beta12, uses assembler code
tuned for Intel MMX platform) 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
@ -185,10 +185,10 @@ Files in this distribution:
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static) makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta11) makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.7beta12)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng.so.2.1.0.7beta11) (gcc, creates libpng.so.2.1.0.7beta12)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile makefile.acorn => Acorn makefile

View File

@ -1,13 +1,13 @@
Y2K compliance in libpng: Y2K compliance in libpng:
========================= =========================
May 6, 2000 May 12, 2000
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.0.7beta11 are Y2K compliant. It is my belief that earlier upward through 1.0.7beta12 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

2
configure vendored
View File

@ -1,5 +1,5 @@
echo " echo "
There is no \"configure\" script for Libpng-1.0.7beta11. Instead, please There is no \"configure\" script for Libpng-1.0.7beta12. Instead, please
copy the appropriate makefile for your system from the \"scripts\" copy the appropriate makefile for your system from the \"scripts\"
directory. Read the INSTALL file for more details. directory. Read the INSTALL file for more details.
" "

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "May 6, 2000" .TH LIBPNG 3 "May 12, 2000"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta11 libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta12
.SH SYNOPSIS .SH SYNOPSIS
\fI\fB \fI\fB
@ -8,6 +8,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta11
\fI\fB \fI\fB
\fBpng_uint_32 png_access_version_number \fI(void\fP\fB);\fP
\fI\fB
\fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP \fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP
\fI\fB \fI\fB
@ -739,7 +743,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.0.7beta11 - May 6, 2000 libpng version 1.0.7beta12 - May 12, 2000
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu> <randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -1291,7 +1295,7 @@ into the info_ptr is returned for any complex types.
text_ptr[i].key - keyword for comment. Must contain text_ptr[i].key - keyword for comment. Must contain
1-79 characters. 1-79 characters.
text_ptr[i].text - text comments for current text_ptr[i].text - text comments for current
keyword. Can empty. keyword. Can be empty.
text_ptr[i].text_length - length of text string, text_ptr[i].text_length - length of text string,
after decompression, 0 for iTXt after decompression, 0 for iTXt
text_ptr[i].itxt_length - length of itxt string, text_ptr[i].itxt_length - length of itxt string,
@ -1922,10 +1926,12 @@ point to libpng-allocated storage with the following functions:
png_free_data(png_ptr, info_ptr, mask, n) png_free_data(png_ptr, info_ptr, mask, n)
mask - identifies data to be freed, a mask mask - identifies data to be freed, a mask
containing the logical OR of one or more of containing the logical OR of one or
more of
PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_PLTE, PNG_FREE_TRNS,
PNG_FREE_HIST, PNG_FREE_ICCP, PNG_FREE_HIST, PNG_FREE_ICCP,
PNG_FREE_SPLT, PNG_FREE_ROWS, PNG_FREE_PCAL, PNG_FREE_ROWS,
PNG_FREE_SCAL, PNG_FREE_SPLT,
PNG_FREE_TEXT, PNG_FREE_UNKN, PNG_FREE_TEXT, PNG_FREE_UNKN,
or simply PNG_FREE_ALL or simply PNG_FREE_ALL
n - sequence number of item to be freed n - sequence number of item to be freed
@ -1959,13 +1965,23 @@ function is responsible for freeing any existing data that might be present,
and again after the png_set_*() functions to control whether the user and again after the png_set_*() functions to control whether the user
or png_destroy_*() is supposed to free the data. When the user assumes or png_destroy_*() is supposed to free the data. When the user assumes
responsibility for libpng-allocated data, the application must use responsibility for libpng-allocated data, the application must use
png_free() to free it. png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it (the png_zalloc() function is the same
as png_malloc() except that it also zeroes the newly-allocated memory).
If you allocated your row_pointers in a single block, as suggested above in If you allocated your row_pointers in a single block, as suggested above in
the description of the high level read interface, you must not transfer the description of the high level read interface, you must not transfer
responsibility for freeing it to the png_set_rows or png_read_destroy function, responsibility for freeing it to the png_set_rows or png_read_destroy function,
because they would also try to free the individual row_pointers[i]. because they would also try to free the individual row_pointers[i].
If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword
separately, do not transfer responsibility for freeing text_ptr to libpng,
because when libpng fills a png_text structure it combines these members with
the key member, and png_free_data() will free only text_ptr.key. Similarly,
if you transfer responsibility for free'ing text_ptr from libpng to your
application, your application must not separately free those members.
For a more compact example of reading a PNG image, see the file example.c. For a more compact example of reading a PNG image, see the file example.c.
.SS Reading PNG files progressively .SS Reading PNG files progressively
@ -2606,7 +2622,8 @@ transformations are permitted, enabled by the following masks.
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 bytes. PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes.
If you have valid image data in the info structure, simply do this: If you have valid image data in the info structure (you can use
png_set_rows() to put image data in the info structure), simply do this:
png_write_png(png_ptr, info_ptr, png_transforms, NULL) png_write_png(png_ptr, info_ptr, png_transforms, NULL)
@ -2867,10 +2884,12 @@ point to libpng-allocated storage with the following functions:
png_free_data(png_ptr, info_ptr, mask, n) png_free_data(png_ptr, info_ptr, mask, n)
mask - identifies data to be freed, a mask mask - identifies data to be freed, a mask
containing the logical OR of one or more of containing the logical OR of one or
more of
PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_PLTE, PNG_FREE_TRNS,
PNG_FREE_HIST, PNG_FREE_ICCP, PNG_FREE_HIST, PNG_FREE_ICCP,
PNG_FREE_SPLT, PNG_FREE_ROWS, PNG_FREE_PCAL, PNG_FREE_ROWS,
PNG_FREE_SCAL, PNG_FREE_SPLT,
PNG_FREE_TEXT, PNG_FREE_UNKN, PNG_FREE_TEXT, PNG_FREE_UNKN,
or simply PNG_FREE_ALL or simply PNG_FREE_ALL
n - sequence number of item to be freed n - sequence number of item to be freed
@ -2921,8 +2940,17 @@ This function only affects data that has already been allocated.
You can call this function before calling after the png_set_*() functions You can call this function before calling after the png_set_*() functions
to control whether the user or png_destroy_*() is supposed to free the data. to control whether the user or png_destroy_*() is supposed to free the data.
When the user assumes responsibility for libpng-allocated data, the When the user assumes responsibility for libpng-allocated data, the
application must use png_free() to free it. application must use
png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it.
If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword
separately, do not transfer responsibility for freeing text_ptr to libpng,
because when libpng fills a png_text structure it combines these members with
the key member, and png_free_data() will free only text_ptr.key. Similarly,
if you transfer responsibility for free'ing text_ptr from libpng to your
application, your application must not separately free those members.
For a more compact example of writing a PNG image, see the file example.c. 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:
@ -3312,15 +3340,29 @@ png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old name to force compilation errors with applications that try to use the old
method. method.
Starting with version 1.0.7, you can find out which version of the library
you are using at run-time:
png_uint_32 libpng_vn = png_access_version_number();
The number libpng_vn is constructed from the major version, minor
version with leading zero, and release number with leading zero,
(e.g., libpng_vn for version 1.0.7 is 10007).
You can also check which version of png.h you used when compiling your
application:
png_uint_32 application_vn = PNG_LIBPNG_VER;
.SH VII. Y2K Compliance in libpng .SH VII. Y2K Compliance in libpng
May 6, 2000 May 12, 2000
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.0.7beta11 are Y2K compliant. It is my belief that earlier upward through 1.0.7beta12 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
@ -3461,7 +3503,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.0.7beta11 - May 6, 2000: Libpng version 1.0.7beta12 - May 12, 2000:
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 (randeg@alum.rpi.edu). Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
@ -3476,7 +3518,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
Copyright (c) 1996, 1997 Andreas Dilger Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.89c, May 1996, through 0.96, May 1997) (libpng versions 0.89c, May 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000) (libpng versions 0.97, January 1998, through 1.0.7beta12, May 12, 2000)
For the purposes of this copyright and license, "Contributing Authors" For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals: is defined as the following set of individuals:

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.0.7beta11 - May 6, 2000 libpng version 1.0.7beta12 - May 12, 2000
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<randeg@alum.rpi.edu> <randeg@alum.rpi.edu>
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -552,7 +552,7 @@ into the info_ptr is returned for any complex types.
text_ptr[i].key - keyword for comment. Must contain text_ptr[i].key - keyword for comment. Must contain
1-79 characters. 1-79 characters.
text_ptr[i].text - text comments for current text_ptr[i].text - text comments for current
keyword. Can empty. keyword. Can be empty.
text_ptr[i].text_length - length of text string, text_ptr[i].text_length - length of text string,
after decompression, 0 for iTXt after decompression, 0 for iTXt
text_ptr[i].itxt_length - length of itxt string, text_ptr[i].itxt_length - length of itxt string,
@ -1183,10 +1183,12 @@ point to libpng-allocated storage with the following functions:
png_free_data(png_ptr, info_ptr, mask, n) png_free_data(png_ptr, info_ptr, mask, n)
mask - identifies data to be freed, a mask mask - identifies data to be freed, a mask
containing the logical OR of one or more of containing the logical OR of one or
more of
PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_PLTE, PNG_FREE_TRNS,
PNG_FREE_HIST, PNG_FREE_ICCP, PNG_FREE_HIST, PNG_FREE_ICCP,
PNG_FREE_SPLT, PNG_FREE_ROWS, PNG_FREE_PCAL, PNG_FREE_ROWS,
PNG_FREE_SCAL, PNG_FREE_SPLT,
PNG_FREE_TEXT, PNG_FREE_UNKN, PNG_FREE_TEXT, PNG_FREE_UNKN,
or simply PNG_FREE_ALL or simply PNG_FREE_ALL
n - sequence number of item to be freed n - sequence number of item to be freed
@ -1220,13 +1222,23 @@ function is responsible for freeing any existing data that might be present,
and again after the png_set_*() functions to control whether the user and again after the png_set_*() functions to control whether the user
or png_destroy_*() is supposed to free the data. When the user assumes or png_destroy_*() is supposed to free the data. When the user assumes
responsibility for libpng-allocated data, the application must use responsibility for libpng-allocated data, the application must use
png_free() to free it. png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it (the png_zalloc() function is the same
as png_malloc() except that it also zeroes the newly-allocated memory).
If you allocated your row_pointers in a single block, as suggested above in If you allocated your row_pointers in a single block, as suggested above in
the description of the high level read interface, you must not transfer the description of the high level read interface, you must not transfer
responsibility for freeing it to the png_set_rows or png_read_destroy function, responsibility for freeing it to the png_set_rows or png_read_destroy function,
because they would also try to free the individual row_pointers[i]. because they would also try to free the individual row_pointers[i].
If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword
separately, do not transfer responsibility for freeing text_ptr to libpng,
because when libpng fills a png_text structure it combines these members with
the key member, and png_free_data() will free only text_ptr.key. Similarly,
if you transfer responsibility for free'ing text_ptr from libpng to your
application, your application must not separately free those members.
For a more compact example of reading a PNG image, see the file example.c. For a more compact example of reading a PNG image, see the file example.c.
Reading PNG files progressively Reading PNG files progressively
@ -1867,7 +1879,8 @@ transformations are permitted, enabled by the following masks.
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 bytes. PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes.
If you have valid image data in the info structure, simply do this: If you have valid image data in the info structure (you can use
png_set_rows() to put image data in the info structure), simply do this:
png_write_png(png_ptr, info_ptr, png_transforms, NULL) png_write_png(png_ptr, info_ptr, png_transforms, NULL)
@ -2128,10 +2141,12 @@ point to libpng-allocated storage with the following functions:
png_free_data(png_ptr, info_ptr, mask, n) png_free_data(png_ptr, info_ptr, mask, n)
mask - identifies data to be freed, a mask mask - identifies data to be freed, a mask
containing the logical OR of one or more of containing the logical OR of one or
more of
PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_PLTE, PNG_FREE_TRNS,
PNG_FREE_HIST, PNG_FREE_ICCP, PNG_FREE_HIST, PNG_FREE_ICCP,
PNG_FREE_SPLT, PNG_FREE_ROWS, PNG_FREE_PCAL, PNG_FREE_ROWS,
PNG_FREE_SCAL, PNG_FREE_SPLT,
PNG_FREE_TEXT, PNG_FREE_UNKN, PNG_FREE_TEXT, PNG_FREE_UNKN,
or simply PNG_FREE_ALL or simply PNG_FREE_ALL
n - sequence number of item to be freed n - sequence number of item to be freed
@ -2182,8 +2197,17 @@ This function only affects data that has already been allocated.
You can call this function before calling after the png_set_*() functions You can call this function before calling after the png_set_*() functions
to control whether the user or png_destroy_*() is supposed to free the data. to control whether the user or png_destroy_*() is supposed to free the data.
When the user assumes responsibility for libpng-allocated data, the When the user assumes responsibility for libpng-allocated data, the
application must use png_free() to free it. application must use
png_free() to free it, and when the user transfers responsibility to libpng
for data that the user has allocated, the user must have used png_malloc()
or png_zalloc() to allocate it.
If you allocated text_ptr.text, text_ptr.lang, and text_ptr.translated_keyword
separately, do not transfer responsibility for freeing text_ptr to libpng,
because when libpng fills a png_text structure it combines these members with
the key member, and png_free_data() will free only text_ptr.key. Similarly,
if you transfer responsibility for free'ing text_ptr from libpng to your
application, your application must not separately free those members.
For a more compact example of writing a PNG image, see the file example.c. For a more compact example of writing a PNG image, see the file example.c.
V. Modifying/Customizing libpng: V. Modifying/Customizing libpng:
@ -2573,15 +2597,29 @@ png_set_error_fn(), which is essentially the same function, but with a new
name to force compilation errors with applications that try to use the old name to force compilation errors with applications that try to use the old
method. method.
Starting with version 1.0.7, you can find out which version of the library
you are using at run-time:
png_uint_32 libpng_vn = png_access_version_number();
The number libpng_vn is constructed from the major version, minor
version with leading zero, and release number with leading zero,
(e.g., libpng_vn for version 1.0.7 is 10007).
You can also check which version of png.h you used when compiling your
application:
png_uint_32 application_vn = PNG_LIBPNG_VER;
VII. Y2K Compliance in libpng VII. Y2K Compliance in libpng
May 6, 2000 May 12, 2000
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.0.7beta11 are Y2K compliant. It is my belief that earlier upward through 1.0.7beta12 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "May 6, 2000" .TH LIBPNGPF 3 "May 12, 2000"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta11 libpng \- Portable Network Graphics (PNG) Reference Library 1.0.7beta12
(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 "May 6, 2000" .TH PNG 5 "May 12, 2000"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION

91
png.c
View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* libpng version 1.0.7beta11 - May 6, 2000 * libpng version 1.0.7beta12 - May 12, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -14,14 +14,14 @@
#include "png.h" #include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_0_7beta11 Your_png_h_is_not_version_1_0_7beta11; typedef version_1_0_7beta12 Your_png_h_is_not_version_1_0_7beta12;
/* 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. */
#ifdef PNG_USE_GLOBAL_ARRAYS #ifdef PNG_USE_GLOBAL_ARRAYS
/* png_libpng_ver was changed to a function in version 1.0.5c */ /* png_libpng_ver was changed to a function in version 1.0.5c */
char png_libpng_ver[12] = "1.0.7beta11"; char png_libpng_ver[12] = "1.0.7beta12";
/* png_sig was changed to a function in version 1.0.5c */ /* png_sig was changed to a function in version 1.0.5c */
/* Place to hold the signature string for a PNG file. */ /* Place to hold the signature string for a PNG file. */
@ -290,6 +290,8 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num
/* free text item num or (if num == -1) all text items */ /* free text item num or (if num == -1) all text items */
#ifdef PNG_FREE_ME_SUPPORTED #ifdef PNG_FREE_ME_SUPPORTED
if (mask & info_ptr->free_me & PNG_FREE_TEXT) if (mask & info_ptr->free_me & PNG_FREE_TEXT)
#else
if (mask & PNG_FREE_TEXT)
#endif #endif
{ {
if (num != -1) if (num != -1)
@ -314,15 +316,14 @@ if (mask & info_ptr->free_me & PNG_FREE_TEXT)
#if defined(PNG_tRNS_SUPPORTED) #if defined(PNG_tRNS_SUPPORTED)
/* free any tRNS entry */ /* free any tRNS entry */
if (mask & PNG_FREE_TRNS) #ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_TRNS & info_ptr->free_me)
#else
if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
#endif
{ {
if (info_ptr->valid & PNG_INFO_tRNS) if (info_ptr->valid & PNG_INFO_tRNS)
{ {
#ifdef PNG_FREE_ME_SUPPORTED
if (info_ptr->free_me & PNG_FREE_TRNS)
#else
if (png_ptr->flags & PNG_FLAG_FREE_TRNS)
#endif
png_free(png_ptr, info_ptr->trans); png_free(png_ptr, info_ptr->trans);
info_ptr->valid &= ~PNG_INFO_tRNS; info_ptr->valid &= ~PNG_INFO_tRNS;
} }
@ -331,6 +332,11 @@ if (mask & PNG_FREE_TRNS)
#if defined(PNG_sCAL_SUPPORTED) #if defined(PNG_sCAL_SUPPORTED)
/* free any sCAL entry */ /* free any sCAL entry */
#ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_SCAL & info_ptr->free_me)
#else
if (mask & PNG_FREE_SCAL)
#endif
{ {
if (info_ptr->valid & PNG_INFO_sCAL) if (info_ptr->valid & PNG_INFO_sCAL)
{ {
@ -345,6 +351,11 @@ if (mask & PNG_FREE_TRNS)
#if defined(PNG_pCAL_SUPPORTED) #if defined(PNG_pCAL_SUPPORTED)
/* free any pCAL entry */ /* free any pCAL entry */
#ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_PCAL & info_ptr->free_me)
#else
if (mask & PNG_FREE_PCAL)
#endif
{ {
if (info_ptr->valid & PNG_INFO_pCAL) if (info_ptr->valid & PNG_INFO_pCAL)
{ {
@ -366,17 +377,16 @@ if (mask & PNG_FREE_TRNS)
#if defined(PNG_iCCP_SUPPORTED) #if defined(PNG_iCCP_SUPPORTED)
/* free any iCCP entry */ /* free any iCCP entry */
#ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_ICCP & info_ptr->free_me)
#else
if (mask & PNG_FREE_ICCP) if (mask & PNG_FREE_ICCP)
#endif
{ {
if (info_ptr->valid & PNG_INFO_iCCP) if (info_ptr->valid & PNG_INFO_iCCP)
{ {
#ifdef PNG_FREE_ME_SUPPORTED
if (info_ptr->free_me & PNG_FREE_ICCP)
#endif
{
png_free(png_ptr, info_ptr->iccp_name); png_free(png_ptr, info_ptr->iccp_name);
png_free(png_ptr, info_ptr->iccp_profile); png_free(png_ptr, info_ptr->iccp_profile);
}
info_ptr->valid &= ~PNG_INFO_iCCP; info_ptr->valid &= ~PNG_INFO_iCCP;
} }
} }
@ -384,7 +394,11 @@ if (mask & PNG_FREE_ICCP)
#if defined(PNG_sPLT_SUPPORTED) #if defined(PNG_sPLT_SUPPORTED)
/* free a given sPLT entry, or (if num == -1) all sPLT entries */ /* free a given sPLT entry, or (if num == -1) all sPLT entries */
#ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_SPLT & info_ptr->free_me)
#else
if (mask & PNG_FREE_SPLT) if (mask & PNG_FREE_SPLT)
#endif
{ {
if (num != -1) if (num != -1)
{ {
@ -408,7 +422,11 @@ if (mask & PNG_FREE_SPLT)
#endif #endif
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
#ifdef PNG_FREE_ME_SUPPORTED
if (mask & info_ptr->free_me & PNG_FREE_UNKN)
#else
if (mask & PNG_FREE_UNKN) if (mask & PNG_FREE_UNKN)
#endif
{ {
if (num != -1) if (num != -1)
{ {
@ -433,15 +451,14 @@ if (mask & PNG_FREE_UNKN)
#if defined(PNG_hIST_SUPPORTED) #if defined(PNG_hIST_SUPPORTED)
/* free any hIST entry */ /* free any hIST entry */
if (mask & PNG_FREE_HIST) #ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_HIST & info_ptr->free_me)
#else
if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
#endif
{ {
if (info_ptr->valid & PNG_INFO_hIST) if (info_ptr->valid & PNG_INFO_hIST)
{ {
#ifdef PNG_FREE_ME_SUPPORTED
if (info_ptr->free_me & PNG_FREE_HIST)
#else
if (png_ptr->flags & PNG_FLAG_FREE_HIST)
#endif
png_free(png_ptr, info_ptr->hist); png_free(png_ptr, info_ptr->hist);
info_ptr->valid &= ~PNG_INFO_hIST; info_ptr->valid &= ~PNG_INFO_hIST;
} }
@ -449,15 +466,14 @@ if (mask & PNG_FREE_HIST)
#endif #endif
/* free any PLTE entry that was internally allocated */ /* free any PLTE entry that was internally allocated */
if (mask & PNG_FREE_PLTE) #ifdef PNG_FREE_ME_SUPPORTED
if (mask & PNG_FREE_PLTE & info_ptr->free_me)
#else
if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
#endif
{ {
if (info_ptr->valid & PNG_INFO_PLTE) if (info_ptr->valid & PNG_INFO_PLTE)
{ {
#ifdef PNG_FREE_ME_SUPPORTED
if (info_ptr->free_me & PNG_FREE_PLTE)
#else
if (png_ptr->flags & PNG_FLAG_FREE_PLTE)
#endif
png_zfree(png_ptr, info_ptr->palette); png_zfree(png_ptr, info_ptr->palette);
info_ptr->valid &= ~(PNG_INFO_PLTE); info_ptr->valid &= ~(PNG_INFO_PLTE);
info_ptr->num_palette = 0; info_ptr->num_palette = 0;
@ -466,17 +482,19 @@ if (mask & PNG_FREE_PLTE)
#if defined(PNG_INFO_IMAGE_SUPPORTED) #if defined(PNG_INFO_IMAGE_SUPPORTED)
/* free any image bits attached to the info structure */ /* free any image bits attached to the info structure */
if (mask & PNG_FREE_ROWS)
{
#ifdef PNG_FREE_ME_SUPPORTED #ifdef PNG_FREE_ME_SUPPORTED
if (info_ptr->free_me & PNG_FREE_ROWS) if (mask & info_ptr->free_me & PNG_FREE_ROWS)
#else
if (mask & PNG_FREE_ROWS)
#endif #endif
{
if(info_ptr->row_pointers)
{ {
int row; int row;
for (row = 0; row < (int)info_ptr->height; row++) for (row = 0; row < (int)info_ptr->height; row++)
png_free(png_ptr, info_ptr->row_pointers[row]); png_free(png_ptr, info_ptr->row_pointers[row]);
png_free(png_ptr, info_ptr->row_pointers); png_free(png_ptr, info_ptr->row_pointers);
info_ptr->row_pointers=NULL;
} }
} }
#endif #endif
@ -583,7 +601,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr) png_get_copyright(png_structp png_ptr)
{ {
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */ if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
return ("\n libpng version 1.0.7beta11 - May 6, 2000\n\ return ("\n libpng version 1.0.7beta12 - May 12, 2000\n\
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\
Copyright (c) 1996, 1997 Andreas Dilger\n\ Copyright (c) 1996, 1997 Andreas Dilger\n\
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n"); Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n");
@ -601,8 +619,8 @@ png_get_libpng_ver(png_structp png_ptr)
{ {
/* Version of *.c files used when building libpng */ /* Version of *.c files used when building libpng */
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */ if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
return("1.0.7beta11"); return("1.0.7beta12");
return("1.0.7beta11"); return("1.0.7beta12");
} }
png_charp PNGAPI png_charp PNGAPI
@ -646,3 +664,10 @@ png_reset_zstream(png_structp png_ptr)
{ {
return (inflateReset(&png_ptr->zstream)); return (inflateReset(&png_ptr->zstream));
} }
png_uint_32 PNGAPI
png_access_version_number(void)
{
/* Version of *.c files used when building libpng */
return((png_uint_32) 10007L);
}

81
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.0.7beta11 - May 6, 2000 * libpng version 1.0.7beta12 - May 12, 2000
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -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.0.7beta11 - May 6, 2000: Glenn * libpng versions 0.97, January 1998, through 1.0.7beta12 - May 12, 2000: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -52,7 +52,7 @@
* 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6h 10007 10.6h (testing xy.z so-numbering)
* 1.0.6i 10007 10.6i * 1.0.6i 10007 10.6i
* 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0)
* 1.0.7beta11 10007 2.1.0.7beta11 (still compatible) * 1.0.7beta11-12 10007 2.1.0.7beta11-12 (still compatible)
* planned: * planned:
* 1.0.7prep00 10007 2.1.0.7prep00 (still compatible) * 1.0.7prep00 10007 2.1.0.7prep00 (still compatible)
* 1.0.6ptch04 (w/4 patches) 10006 2.1.0.6 (binary compatible) * 1.0.6ptch04 (w/4 patches) 10006 2.1.0.6 (binary compatible)
@ -87,7 +87,7 @@
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
* (libpng versions 0.89c, June 1996, through 0.96, May 1997) * (libpng versions 0.89c, June 1996, through 0.96, May 1997)
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
* (libpng versions 0.97, January 1998, through 1.0.7beta11, May 6, 2000) * (libpng versions 0.97, January 1998, through 1.0.7beta12, May 12, 2000)
* *
* For the purposes of this copyright and license, "Contributing Authors" * For the purposes of this copyright and license, "Contributing Authors"
* is defined as the following set of individuals: * is defined as the following set of individuals:
@ -162,13 +162,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* May 6, 2000 * May 12, 2000
* *
* 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.0.7beta11 are Y2K compliant. It is my belief that earlier * upward through 1.0.7beta12 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
@ -223,6 +223,30 @@
* at the actual function definitions and structure components. * at the actual function definitions and structure components.
*/ */
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.0.7beta12"
#define PNG_LIBPNG_VER_SONUM 2
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 0
#define PNG_LIBPNG_VER_RELEASE 7
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
#define PNG_LIBPNG_VER_BUILD 12
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
#define PNG_LIBPNG_VER 10007 /* 1.0.7 */
/* Note to maintainer: update this number in scripts/pngdef.pas as well */
#ifndef PNG_VERSION_INFO_ONLY
/* include the compression library's header */ /* include the compression library's header */
#include "zlib.h" #include "zlib.h"
@ -245,18 +269,6 @@ extern "C" {
* which applications aren't expected to use directly. * which applications aren't expected to use directly.
*/ */
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.0.7beta11"
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
* We must not include leading zeros.
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=bugfix */
#define PNG_LIBPNG_VER 10007 /* 1.0.7 */
/* Note to maintainer: update this number in scripts/pngdef.pas as well */
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */ /* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
#if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN) #if !defined(PNG_NO_EXTERN) || defined(PNG_ALWAYS_EXTERN)
/* Version information for C files, stored in png.c. This had better match /* Version information for C files, stored in png.c. This had better match
@ -1111,9 +1123,9 @@ struct png_struct_def
}; };
/* This prevents a compiler error in png_get_copyright() in png.c if png.c /* This prevents a compiler error in png_get_copyright() in png.c if png.c
and png.h are both at * version 1.0.7beta11 and png.h are both at * version 1.0.7beta12
*/ */
typedef png_structp version_1_0_7beta11; typedef png_structp version_1_0_7beta12;
typedef png_struct FAR * FAR * png_structpp; typedef png_struct FAR * FAR * png_structpp;
@ -1123,6 +1135,9 @@ typedef png_struct FAR * FAR * png_structpp;
* a simple one line description of the use of each function. * a simple one line description of the use of each function.
*/ */
/* Returns the version number of the library */
extern PNG_EXPORT(png_uint_32,png_access_version_number) PNGARG((void));
/* Tell lib we have already handled the first <num_bytes> magic bytes. /* Tell lib we have already handled the first <num_bytes> magic bytes.
* Handling more than 8 bytes from the beginning of the file is an error. * Handling more than 8 bytes from the beginning of the file is an error.
*/ */
@ -1675,14 +1690,14 @@ extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
#define PNG_FREE_ICCP 0x0010 #define PNG_FREE_ICCP 0x0010
#define PNG_FREE_SPLT 0x0020 #define PNG_FREE_SPLT 0x0020
#define PNG_FREE_ROWS 0x0040 #define PNG_FREE_ROWS 0x0040
#define PNG_FREE_PCAL 0x0080 /* not used any more */ #define PNG_FREE_PCAL 0x0080
#define PNG_FREE_SCAL 0x0100 /* not used any more */ #define PNG_FREE_SCAL 0x0100
#define PNG_FREE_UNKN 0x0200 #define PNG_FREE_UNKN 0x0200
#define PNG_FREE_LIST 0x0400 #define PNG_FREE_LIST 0x0400
#define PNG_FREE_PLTE 0x1000 #define PNG_FREE_PLTE 0x1000
#define PNG_FREE_TRNS 0x2000 #define PNG_FREE_TRNS 0x2000
#define PNG_FREE_TEXT 0x4000 #define PNG_FREE_TEXT 0x4000
#define PNG_FREE_ALL 0x3fff #define PNG_FREE_ALL 0x7fff
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr, extern PNG_EXPORT(png_voidp,png_malloc_default) PNGARG((png_structp png_ptr,
@ -2080,19 +2095,28 @@ extern PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr,
*/ */
#ifdef PNG_DEBUG #ifdef PNG_DEBUG
#if (PNG_DEBUG > 0) #if (PNG_DEBUG > 0)
#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
#include <crtdbg.h>
#define png_debug(l,m) if (PNG_DEBUG > l) _RPT0(_CRT_WARN,m)
#define png_debug1(l,m,p1) if (PNG_DEBUG > l) _RPT1(_CRT_WARN,m,p1)
#define png_debug2(l,m,p1,p2) if (PNG_DEBUG > l) _RPT2(_CRT_WARN,m,p1,p2)
#else /* PNG_DEBUG_FILE || !_MSC_VER */
#ifndef PNG_DEBUG_FILE #ifndef PNG_DEBUG_FILE
#define PNG_DEBUG_FILE stderr #define PNG_DEBUG_FILE stderr
#endif /* PNG_DEBUG_FILE */ #endif /* PNG_DEBUG_FILE */
#define png_debug(l,m) \
#define png_debug(l,m) if (PNG_DEBUG > l) \ if (PNG_DEBUG > l) \
fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \
(l==2 ? "\t\t":(l>2 ? "\t\t\t":"")))) (l==2 ? "\t\t":(l>2 ? "\t\t\t":""))))
#define png_debug1(l,m,p1) if (PNG_DEBUG > l) \ #define png_debug1(l,m,p1) \
if (PNG_DEBUG > l) \
fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \
(l==2 ? "\t\t":(l>2 ? "\t\t\t":""))),p1) (l==2 ? "\t\t":(l>2 ? "\t\t\t":""))),p1)
#define png_debug2(l,m,p1,p2) if (PNG_DEBUG > l) \ #define png_debug2(l,m,p1,p2) \
if (PNG_DEBUG > l) \
fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \ fprintf(PNG_DEBUG_FILE,"%s"m,(l==1 ? "\t" : \
(l==2 ? "\t\t":(l>2 ? "\t\t\t":""))),p1,p2) (l==2 ? "\t\t":(l>2 ? "\t\t\t":""))),p1,p2)
#endif /* _MSC_VER */
#endif /* (PNG_DEBUG > 0) */ #endif /* (PNG_DEBUG > 0) */
#endif /* PNG_DEBUG */ #endif /* PNG_DEBUG */
#ifndef png_debug #ifndef png_debug
@ -2113,7 +2137,7 @@ extern PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp png_ptr)
extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); extern PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr));
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.0.7beta11 - May 6, 2000 (header)\n" " libpng version 1.0.7beta12 - May 12, 2000 (header)\n"
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* With these routines we avoid an integer divide, which will be slower on /* With these routines we avoid an integer divide, which will be slower on
@ -2905,5 +2929,6 @@ PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
} }
#endif #endif
#endif /* PNG_VERSION_INFO_ONLY */
/* do not put anything past this line */ /* do not put anything past this line */
#endif /* _PNG_H */ #endif /* _PNG_H */

View File

@ -1,6 +1,6 @@
/* pngasmrd.h - assembler version of utilities to read a PNG file /* pngasmrd.h - assembler version of utilities to read a PNG file
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1999, 2000 Glenn Randers-Pehrson
* *

View File

@ -1,6 +1,6 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -58,6 +58,14 @@
* #define PNG_NO_STDIO * #define PNG_NO_STDIO
*/ */
#ifdef PNG_BUILD_DLL
# ifndef PNG_CONSOLE_IO_SUPPORTED
# ifndef PNG_NO_CONSOLE_IO
# define PNG_NO_CONSOLE_IO
# endif
# endif
#endif
# ifdef PNG_NO_STDIO # ifdef PNG_NO_STDIO
# ifndef PNG_NO_CONSOLE_IO # ifndef PNG_NO_CONSOLE_IO
# define PNG_NO_CONSOLE_IO # define PNG_NO_CONSOLE_IO
@ -987,33 +995,8 @@ typedef z_stream FAR * png_zstreamp;
# define PNG_ATTR_DLLIMP # define PNG_ATTR_DLLIMP
#endif #endif
#ifndef PNG_EXPORT
# define PNG_EXPORT(type,symbol) type symbol
#endif
#if defined(__MINGW32__) || defined(__CYGWIN32__)
# define PNG_ATTR_DLLIMP
#endif
#ifdef PNG_USE_GLOBAL_ARRAYS #ifdef PNG_USE_GLOBAL_ARRAYS
#ifndef PNG_EXPORT_VAR #ifndef PNG_EXPORT_VAR
# if defined(_MSC_VER) && defined(_DLL) /* GRR 20000206 */
# define PNG_EXPORT_VAR(type) extern type __declspec(dllexport)
# endif
# ifdef PNG_DECL_DLLEXP
# define PNG_EXPORT_VAR(type) extern __declspec(dllexport) type
# endif
# ifdef PNG_ATTR_DLLEXP
# define PNG_EXPORT_VAR(type) extern type __attribute__((dllexport))
# endif
# ifdef PNG_DECL_DLLIMP
# define PNG_EXPORT_VAR(type) extern __declspec(dllimport) type
# endif
# ifdef PNG_ATTR_DLLIMP
# define PNG_EXPORT_VAR(type) extern type __attribute__((dllimport))
# endif
#endif
#ifndef PNG_EXPORT_VAR
# define PNG_EXPORT_VAR(type) extern type # define PNG_EXPORT_VAR(type) extern type
#endif #endif
#endif #endif

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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -6,7 +6,7 @@
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm * and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
* for Intel's performance analysis of the MMX vs. non-MMX code. * for Intel's performance analysis of the MMX vs. non-MMX code.
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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, Intel Corporation * Copyright (c) 1998, Intel Corporation
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
@ -230,7 +230,7 @@ png_read_filter_row_c(png_structp png_ptr, png_row_infop row_info,
/* Use this routine for the x86 platform - it uses a faster MMX routine /* Use this routine for the x86 platform - it uses a faster MMX routine
if the machine supports MMX. */ if the machine supports MMX. */
void PNGAPI void /* PRIVATE */
png_combine_row(png_structp png_ptr, png_bytep row, int mask) png_combine_row(png_structp png_ptr, png_bytep row, int mask)
{ {
png_debug(1,"in png_combine_row_asm\n"); png_debug(1,"in png_combine_row_asm\n");
@ -4310,7 +4310,7 @@ png_read_filter_row_mmx_up(png_row_infop row_info, png_bytep row,
// Optimized png_read_filter_row routines // Optimized png_read_filter_row routines
void PNGAPI void /* PRIVATE */
png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep
row, png_bytep prev_row, int filter) row, png_bytep prev_row, int filter)
{ {

View File

@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct /* pngget.c - retrieval of values from info struct
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * 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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * 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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file /* pngread.c - read a PNG file
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -697,7 +697,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
* not called png_set_interlace_handling(), the display_row buffer will * not called png_set_interlace_handling(), the display_row buffer will
* be ignored, so pass NULL to it. * be ignored, so pass NULL to it.
* *
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta11 * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta12
*/ */
void PNGAPI void PNGAPI
@ -746,7 +746,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
* only call this function once. If you desire to have an image for * only call this function once. If you desire to have an image for
* each pass of a interlaced image, use png_read_rows() instead. * each pass of a interlaced image, use png_read_rows() instead.
* *
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta11 * [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.7beta12
*/ */
void PNGAPI void PNGAPI
png_read_image(png_structp png_ptr, png_bytepp image) png_read_image(png_structp png_ptr, png_bytepp image)
@ -1293,18 +1293,9 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
/* -------------- image transformations end here ------------------- */ /* -------------- image transformations end here ------------------- */
if(info_ptr->row_pointers)
{
#ifdef PNG_FREE_ME_SUPPORTED #ifdef PNG_FREE_ME_SUPPORTED
if(info_ptr->free_me & PNG_FREE_ROWS) png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
{
for (row = 0; row < (int)info_ptr->height; row++)
png_free(png_ptr, info_ptr->row_pointers[row]);
png_free(png_ptr, info_ptr->row_pointers);
info_ptr->row_pointers = NULL;
}
#endif #endif
}
if(info_ptr->row_pointers == NULL) if(info_ptr->row_pointers == NULL)
{ {
info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr, info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,

View File

@ -1,7 +1,7 @@
/* pngrio.c - functions for data input /* pngrio.c - functions for data input
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * 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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -2043,9 +2043,9 @@ png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name)
you want all pixels to be combined, pass 0xff (255) in mask. */ you want all pixels to be combined, pass 0xff (255) in mask. */
void /* PRIVATE */ void /* PRIVATE */
#ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW #ifdef PNG_HAVE_ASSEMBLER_COMBINE_ROW
png_combine_row_c /* PRIVATE */ png_combine_row_c
#else #else
png_combine_row /* PRIVATE */ png_combine_row
#endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */ #endif /* PNG_HAVE_ASSEMBLER_COMBINE_ROW */
(png_structp png_ptr, png_bytep row, int mask) (png_structp png_ptr, png_bytep row, int mask)
{ {

View File

@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct /* pngset.c - storage of image information into info struct
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -240,6 +240,9 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
} }
info_ptr->valid |= PNG_INFO_pCAL; info_ptr->valid |= PNG_INFO_pCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
} }
#endif #endif
@ -284,6 +287,9 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length); png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length);
info_ptr->valid |= PNG_INFO_sCAL; info_ptr->valid |= PNG_INFO_sCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_SCAL;
#endif
} }
#endif #endif
#endif #endif
@ -488,6 +494,9 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
info_ptr->num_text = 0; info_ptr->num_text = 0;
info_ptr->text = (png_textp)png_malloc(png_ptr, info_ptr->text = (png_textp)png_malloc(png_ptr,
(png_uint_32)(info_ptr->max_text * sizeof (png_text))); (png_uint_32)(info_ptr->max_text * sizeof (png_text)));
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_TEXT;
#endif
} }
png_debug1(3, "allocated %d entries for info_ptr->text\n", png_debug1(3, "allocated %d entries for info_ptr->text\n",
info_ptr->max_text); info_ptr->max_text);
@ -495,9 +504,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
for (i = 0; i < num_text; i++) for (i = 0; i < num_text; i++)
{ {
png_size_t text_length,key_len; png_size_t text_length,key_len;
#ifdef PNG_iTXt_SUPPORTED
png_size_t lang_len,lang_key_len; png_size_t lang_len,lang_key_len;
#endif
png_textp textp = &(info_ptr->text[info_ptr->num_text]); png_textp textp = &(info_ptr->text[info_ptr->num_text]);
if (text_ptr[i].key == (png_charp)NULL) if (text_ptr[i].key == (png_charp)NULL)
@ -505,7 +512,12 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
key_len = png_strlen(text_ptr[i].key); key_len = png_strlen(text_ptr[i].key);
if(text_ptr[i].compression > 0) if(text_ptr[i].compression <= 0)
{
lang_len = 0;
lang_key_len = 0;
}
else
#ifdef PNG_iTXt_SUPPORTED #ifdef PNG_iTXt_SUPPORTED
{ {
/* set iTXt data */ /* set iTXt data */
@ -518,11 +530,6 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
else else
lang_key_len = 0; lang_key_len = 0;
} }
else
{
lang_len = 0;
lang_key_len = 0;
}
#else #else
{ {
png_warning(png_ptr, "iTXt chunk not supported."); png_warning(png_ptr, "iTXt chunk not supported.");
@ -547,17 +554,9 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
} }
textp->key = (png_charp)png_malloc(png_ptr, textp->key = (png_charp)png_malloc(png_ptr,
(png_uint_32)(key_len + (png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4));
#ifdef PNG_iTXt_SUPPORTED
lang_len + lang_key_len +
#endif
text_length + 4));
png_debug2(2, "Allocated %d bytes at %x in png_set_text\n", png_debug2(2, "Allocated %d bytes at %x in png_set_text\n",
key_len + key_len + lang_len + lang_key_len + text_length + 4, textp->key);
#ifdef PNG_iTXt_SUPPORTED
lang_len + lang_key_len +
#endif
text_length + 4, textp->key);
png_memcpy(textp->key, text_ptr[i].key, png_memcpy(textp->key, text_ptr[i].key,
(png_size_t)(key_len)); (png_size_t)(key_len));
@ -603,9 +602,6 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
} }
info_ptr->text[info_ptr->num_text]= *textp; info_ptr->text[info_ptr->num_text]= *textp;
info_ptr->num_text++; info_ptr->num_text++;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_TEXT;
#endif
png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text);
} }
} }

View File

@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng /* pngtest.c - a simple test program to test libpng
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -1152,9 +1152,11 @@ main(int argc, char *argv[])
fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION); fprintf(STDERR, " with zlib version %s\n", ZLIB_VERSION);
fprintf(STDERR,"%s",png_get_copyright(NULL)); fprintf(STDERR,"%s",png_get_copyright(NULL));
/* Show the version of libpng used in building the library */ /* Show the version of libpng used in building the library */
fprintf(STDERR," library:%s",png_get_header_version(NULL)); fprintf(STDERR," library (%lu):%s", png_access_version_number(),
png_get_header_version(NULL));
/* Show the version of libpng used in building the application */ /* Show the version of libpng used in building the application */
fprintf(STDERR," pngtest:%s",PNG_HEADER_VERSION_STRING); fprintf(STDERR," pngtest (%lu):%s", PNG_LIBPNG_VER,
PNG_HEADER_VERSION_STRING);
fprintf(STDERR," sizeof(png_struct)=%d, sizeof(png_info)=%d\n", fprintf(STDERR," sizeof(png_struct)=%d, sizeof(png_info)=%d\n",
sizeof(png_struct), sizeof(png_info)); sizeof(png_struct), sizeof(png_info));
@ -1378,4 +1380,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_0_7beta11 your_png_h_is_not_version_1_0_7beta11; typedef version_1_0_7beta12 your_png_h_is_not_version_1_0_7beta12;

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)
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -2,7 +2,7 @@
* *
* For Intel x86 CPU and Microsoft Visual C++ compiler * For Intel x86 CPU and Microsoft Visual C++ compiler
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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, Intel Corporation * Copyright (c) 1998, Intel Corporation
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson * Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson

View File

@ -1,7 +1,7 @@
/* pngwio.c - functions for data output /* pngwio.c - functions for data output
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file /* pngwrite.c - general routines to write a PNG file
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger
@ -1245,8 +1245,7 @@ png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
#if defined(PNG_INFO_IMAGE_SUPPORTED) #if defined(PNG_INFO_IMAGE_SUPPORTED)
void PNGAPI void PNGAPI
png_write_png(png_structp png_ptr, png_infop info_ptr, png_write_png(png_structp png_ptr, png_infop info_ptr,
int transforms, int transforms, voidp params)
voidp params)
{ {
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) #if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
/* invert the alpha channel from opacity to transparency */ /* invert the alpha channel from opacity to transparency */

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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * 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
* *
* libpng 1.0.7beta11 - May 6, 2000 * libpng 1.0.7beta12 - May 12, 2000
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. * Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger * Copyright (c) 1996, 1997 Andreas Dilger

View File

@ -31,7 +31,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
# where make install puts libpng.a, libpng.so*, and png.h # where make install puts libpng.a, libpng.so*, and png.h

View File

@ -14,7 +14,7 @@ ZLIBINC=../zlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
CC=cc CC=cc

View File

@ -34,7 +34,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include INCPATH=$(prefix)/include

View File

@ -34,7 +34,7 @@ RANLIB=ranlib
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include INCPATH=$(prefix)/include

View File

@ -25,7 +25,7 @@ RANLIB=echo
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include INCPATH=$(prefix)/include

View File

@ -19,8 +19,8 @@ CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 # -g -DPNG_DEBUG=5
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
LDSHARED=gcc -shared LDSHARED=gcc -shared
VER=1.0.7beta11 VER=1.0.7beta12
LIBS=libpng.so.1.0.7beta11 LIBS=libpng.so.1.0.7beta12
SHAREDLIB=libpng.so SHAREDLIB=libpng.so
libdir=$(prefix)/lib32 libdir=$(prefix)/lib32

View File

@ -31,7 +31,7 @@ RANLIB=echo
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not # read libpng.txt or png.h to see why PNGMAJ is 2. You should not
# have to change it. # have to change it.
PNGMAJ = 2 PNGMAJ = 2
PNGMIN = 1.0.7beta11 PNGMIN = 1.0.7beta12
PNGVER = $(PNGMAJ).$(PNGMIN) PNGVER = $(PNGMAJ).$(PNGMIN)
INCPATH=$(prefix)/include INCPATH=$(prefix)/include

View File

@ -1,9 +1,11 @@
unit pngdef; unit pngdef;
// Caution: this file is probably out of date.
interface interface
const const
PNG_LIBPNG_VER_STRING = '1.0.7beta11'; PNG_LIBPNG_VER_STRING = '1.0.7beta12';
PNG_LIBPNG_VER = 10007; PNG_LIBPNG_VER = 10007;
type type

View File

@ -2,6 +2,8 @@
; PNGLIB module definition file for OS/2 ; PNGLIB module definition file for OS/2
;---------------------------------------- ;----------------------------------------
; Caution: This file is probably out of date.
LIBRARY PNG LIBRARY PNG
DESCRIPTION "PNG image compression library for OS/2" DESCRIPTION "PNG image compression library for OS/2"
CODE PRELOAD MOVEABLE DISCARDABLE CODE PRELOAD MOVEABLE DISCARDABLE