Imported from libpng-1.0.6e.tar
This commit is contained in:
parent
81fdf8aca1
commit
38e6e77419
20
ANNOUNCE
20
ANNOUNCE
@ -1,12 +1,12 @@
|
||||
|
||||
Libpng 1.0.6d - April 7, 2000
|
||||
Libpng 1.0.6e - April 10, 2000
|
||||
|
||||
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.
|
||||
|
||||
Changes since the last public release (1.0.6):
|
||||
|
||||
version 1.0.6d [April 7, 2000]
|
||||
version 1.0.6d [April 8, 2000]
|
||||
Changed sprintf() to strcpy() in png_write_sCAL_s() to work without STDIO
|
||||
Added data_length parameter to png_decompress_chunk() function
|
||||
Revised documentation to remove reference to abandoned png_free_chnk functions
|
||||
@ -15,6 +15,22 @@ version 1.0.6d [April 7, 2000]
|
||||
Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file
|
||||
Added a check for info_ptr->free_me&PNG_FREE_TEXT when free'ing text in png.c
|
||||
Simplify png_sig_bytes() function to remove use of non-ISO-C strdup().
|
||||
version 1.0.6e [April 10, 2000]
|
||||
Added png_data_freer() function.
|
||||
In the code that checks for over-length tRNS chunks, added check of
|
||||
info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann)
|
||||
Minor revisions of libpng.txt/libpng.3.
|
||||
Check for existing data and free it if the free_me flag is set, in png_set_*()
|
||||
and png_handle_*().
|
||||
Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED
|
||||
is defined.
|
||||
Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c
|
||||
and mentioned the purposes of the two macros in libpng.txt/libpng.3.
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
|
||||
Glenn R-P
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
|
11
CHANGES
11
CHANGES
@ -669,6 +669,17 @@ version 1.0.6d [April 7, 2000]
|
||||
Renamed makefile.ibmvac3 to makefile.ibmc, added libpng.icc IBM project file
|
||||
Added a check for info_ptr->free_me&PNG_FREE_TEXT when free'ing text in png.c
|
||||
Simplify png_sig_bytes() function to remove use of non-ISO-C strdup().
|
||||
version 1.0.6e [April 10, 2000]
|
||||
Added png_data_freer() function.
|
||||
In the code that checks for over-length tRNS chunks, added check of
|
||||
info_ptr->num_trans as well as png_ptr->num_trans (Matthias Benckmann)
|
||||
Minor revisions of libpng.txt/libpng.3.
|
||||
Check for existing data and free it if the free_me flag is set, in png_set_*()
|
||||
and png_handle_*().
|
||||
Only define PNG_WEIGHTED_FILTERS_SUPPORTED when PNG_FLOATING_POINT_SUPPORTED
|
||||
is defined.
|
||||
Changed several instances of PNG_NO_CONSOLE_ID to PNG_NO_STDIO in pngrutil.c
|
||||
and mentioned the purposes of the two macros in libpng.txt/libpng.3.
|
||||
|
||||
Send comments/corrections/commendations to
|
||||
png-implement@ccrc.wustl.edu or to randeg@alum.rpi.edu
|
||||
|
12
INSTALL
12
INSTALL
@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.0.6d - April 7, 2000
|
||||
Installing libpng version 1.0.6e - April 10, 2000
|
||||
|
||||
Before installing libpng, you must first install zlib. zlib
|
||||
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.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.0.6d" or "lpng106" and "zlib-1.1.3"
|
||||
might be called "libpng-1.0.6e" or "lpng106" and "zlib-1.1.3"
|
||||
or "zlib113") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@ -47,8 +47,8 @@ The files that are presently available in the scripts directory
|
||||
include
|
||||
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6d)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6d,
|
||||
makefile.linux => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng.so.2.1.0.6e,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
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)
|
||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6d)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.6d)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
|
4
LICENSE
4
LICENSE
@ -5,7 +5,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
Copyright (c) 1996, 1997 Andreas Dilger
|
||||
(libpng versions 0.90, December 1996, through 0.96, May 1997)
|
||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
(libpng versions 0.97, January 1998, through 1.0.6d, April 7, 2000)
|
||||
(libpng versions 0.97, January 1998, through 1.0.6e, April 10, 2000)
|
||||
|
||||
For the purposes of this copyright and license, "Contributing Authors"
|
||||
is defined as the following set of individuals:
|
||||
@ -68,4 +68,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
randeg@alum.rpi.edu
|
||||
April 7, 2000
|
||||
April 10, 2000
|
||||
|
10
README
10
README
@ -1,4 +1,4 @@
|
||||
README for libpng 1.0.6d - April 7, 2000 (shared library 2.1)
|
||||
README for libpng 1.0.6e - April 10, 2000 (shared library 2.1)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
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
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng.so.2.1.0.6d)
|
||||
(gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates
|
||||
libpng.so.2.1.0.6d, uses assembler code
|
||||
libpng.so.2.1.0.6e, uses assembler code
|
||||
tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
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)
|
||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6d)
|
||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng.so.2.1.0.6d)
|
||||
(gcc, creates libpng.so.2.1.0.6e)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.mips => MIPS makefile
|
||||
makefile.acorn => Acorn makefile
|
||||
|
4
Y2KINFO
4
Y2KINFO
@ -1,13 +1,13 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
April 7, 2000
|
||||
April 10, 2000
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.6d are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.6e are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
|
2
configure
vendored
2
configure
vendored
@ -1,5 +1,5 @@
|
||||
echo "
|
||||
There is no \"configure\" script for Libpng-1.0.6d. Instead, please
|
||||
There is no \"configure\" script for Libpng-1.0.6e. Instead, please
|
||||
copy the appropriate makefile for your system from the \"scripts\"
|
||||
directory. Read the INSTALL file for more details.
|
||||
"
|
||||
|
87
libpng.3
87
libpng.3
@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "April 7, 2000"
|
||||
.TH LIBPNG 3 "April 10, 2000"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6d
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6e
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@ -713,7 +713,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.6d - April 7, 2000
|
||||
libpng version 1.0.6e - April 10, 2000
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alum.rpi.edu>
|
||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
@ -1054,7 +1054,7 @@ where png_transforms is an integer containing the logical-or of some set of
|
||||
transformation flags. This call is equivalent to png_read_info(),
|
||||
followed the set of transformations indicated by the transform mask,
|
||||
followed by png_update_info(), followed by a read of the image bytes
|
||||
to the info member `rowpointers', followed by png_read_end().
|
||||
to the info_ptr, followed by png_read_end().
|
||||
|
||||
(The final parameter of this call is not yet used. Someday it
|
||||
will point to transformation parameters.)
|
||||
@ -1827,7 +1827,6 @@ point to libpng-allocated storage with the following functions:
|
||||
PNG_FREE_PLTE, PNG_FREE_TRNS,
|
||||
PNG_FREE_HIST, PNG_FREE_ICCP,
|
||||
PNG_FREE_SPLT, PNG_FREE_ROWS,
|
||||
PNG_FREE_PCAL, PNG_FREE_SCAL,
|
||||
PNG_FREE_TEXT, PNG_FREE_UNKN,
|
||||
or simply PNG_FREE_ALL
|
||||
n - sequence number of item to be freed
|
||||
@ -1841,6 +1840,26 @@ of the selected data type, such as PLTE, is allowed. If "n" is not
|
||||
-1, and multiple items are allowed for the data type identified in
|
||||
the mask, such as text or splt, only the n'th item is freed.
|
||||
|
||||
The default behavior is only to free data that was allocated internally
|
||||
by libpng. This can be changed, so that libpng will not free the data,
|
||||
or so that it will also free data that was passed in via a png_set_*()
|
||||
function, with
|
||||
|
||||
png_data_freer(png_ptr, info_ptr, freer, mask)
|
||||
mask - which data elements are affected
|
||||
same choices as in png_free_data()
|
||||
freer - one of
|
||||
PNG_DESTROY_WILL_FREE_DATA
|
||||
PNG_SET_WILL_FREE_DATA
|
||||
PNG_USER_WILL_FREE_DATA
|
||||
|
||||
This function only affects data that has already been allocated.
|
||||
You can call this function after reading the PNG data but before calling
|
||||
any png_set_*() functions, to control whether the user or the png_set_*()
|
||||
function is responsible for freeing any existing data that might be present,
|
||||
and again after the png_set_*() functions to control whether the user
|
||||
or png_destroy_*() is supposed to free the data..
|
||||
|
||||
For a more compact example of reading a PNG image, see the file example.c.
|
||||
|
||||
.SS Reading PNG files progressively
|
||||
@ -2439,7 +2458,7 @@ specification's ordering rules.
|
||||
At this point there are two ways to proceed; through the high-level
|
||||
write interface, or through a sequence of low-level write operations.
|
||||
You can use the high-level interface if your image data is present
|
||||
on the rowpointers member of the info structure. All defined output
|
||||
in the info structure. All defined output
|
||||
transformations are permitted, enabled by the following masks.
|
||||
|
||||
PNG_TRANSFORM_IDENTITY No transformation
|
||||
@ -2453,15 +2472,15 @@ transformations are permitted, enabled by the following masks.
|
||||
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
|
||||
PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes.
|
||||
|
||||
If you have valid image data on the rowpointers member, simply do this:
|
||||
If you have valid image data in the info structure, simply do this:
|
||||
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, NULL)
|
||||
|
||||
where png_transforms is an integer containing the logical-or of some set of
|
||||
transformation flags. This call is equivalent to png_write_info(),
|
||||
followed by the set of transformations indicated by the transform
|
||||
mask, followed by followed by a write of the image bytes from the info
|
||||
member `rowpointers', followed by png_write_end().
|
||||
mask, followed by followed by a write of the image bytes from the
|
||||
info_ptr, followed by png_write_end().
|
||||
|
||||
(The final parameter of this call is not yet used. Someday it
|
||||
may point to output transformation parameters.)
|
||||
@ -2719,7 +2738,6 @@ point to libpng-allocated storage with the following functions:
|
||||
PNG_FREE_PLTE, PNG_FREE_TRNS,
|
||||
PNG_FREE_HIST, PNG_FREE_ICCP,
|
||||
PNG_FREE_SPLT, PNG_FREE_ROWS,
|
||||
PNG_FREE_PCAL, PNG_FREE_SCAL,
|
||||
PNG_FREE_TEXT, PNG_FREE_UNKN,
|
||||
or simply PNG_FREE_ALL
|
||||
n - sequence number of item to be freed
|
||||
@ -2736,6 +2754,35 @@ If you allocated data such as a palette that you passed in to libpng with
|
||||
png_set_*, you must not free it until just before the call to
|
||||
png_destroy_write_struct().
|
||||
|
||||
The default behavior is only to free data that was allocated internally
|
||||
by libpng. This can be changed, so that libpng will not free the data,
|
||||
or so that it will free data that was passed in via a png_set_*() function,
|
||||
with
|
||||
|
||||
png_data_freer(png_ptr, info_ptr, freer, mask)
|
||||
mask - which data elements are affected
|
||||
same choices as in png_free_data()
|
||||
freer - one of
|
||||
PNG_DESTROY_WILL_FREE_DATA
|
||||
PNG_SET_WILL_FREE_DATA
|
||||
PNG_USER_WILL_FREE_DATA
|
||||
|
||||
For example, to transfer responsibility for some data from a read structure
|
||||
to a write structure, you could use
|
||||
|
||||
png_data_freer(read_ptr, read_info_ptr,
|
||||
PNG_USER_WILL_FREE_DATA,
|
||||
PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST)
|
||||
png_data_freer(write_ptr, write_info_ptr,
|
||||
PNG_DESTROY_WILL_FREE_DATA,
|
||||
PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST)
|
||||
|
||||
Thereby briefly reassigning responsibility for freeing to the user but
|
||||
immediately afterwards reassigning it once more to the write_destroy
|
||||
function. Having done this, it would then be safe to destroy the read
|
||||
structure and continue to use the PLTE, tRNS, and hIST data in the write
|
||||
structure.
|
||||
|
||||
For a more compact example of writing a PNG image, see the file example.c.
|
||||
|
||||
.SH V. Modifying/Customizing libpng:
|
||||
@ -2801,11 +2848,13 @@ but you could change this to do things like exit() if you should wish.
|
||||
On non-fatal errors, png_warning() is called
|
||||
to print a warning message, and then control returns to the calling code.
|
||||
By default png_error() and png_warning() print a message on stderr via
|
||||
fprintf() unless the library is compiled with PNG_NO_STDIO defined. If
|
||||
you wish to change the behavior of the error functions, you will need to
|
||||
set up your own message callbacks. These functions are normally supplied
|
||||
at the time that the png_struct is created. It is also possible to change
|
||||
these functions after png_create_*_struct() has been called by calling:
|
||||
fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined
|
||||
(because you don't want the messages) or PNG_NO_STDIO defined (because
|
||||
fprintf() isn't available). If you wish to change the behavior of the error
|
||||
functions, you will need to set up your own message callbacks. These
|
||||
functions are normally supplied at the time that the png_struct is created.
|
||||
It is also possible to change these functions after png_create_*_struct()
|
||||
has been called by calling:
|
||||
|
||||
png_set_error_fn(png_structp png_ptr,
|
||||
png_voidp error_ptr, png_error_ptr error_fn,
|
||||
@ -3108,13 +3157,13 @@ the old method.
|
||||
|
||||
.SH VII. Y2K Compliance in libpng
|
||||
|
||||
April 7, 2000
|
||||
April 10, 2000
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.6d are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.6e are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
@ -3255,7 +3304,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.0.6d - April 7, 2000:
|
||||
Libpng version 1.0.6e - April 10, 2000:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (randeg@alum.rpi.edu).
|
||||
|
||||
@ -3270,7 +3319,7 @@ Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
Copyright (c) 1996, 1997 Andreas Dilger
|
||||
(libpng versions 0.89c, May 1996, through 0.96, May 1997)
|
||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
(libpng versions 0.97, January 1998, through 1.0.6d, April 7, 2000)
|
||||
(libpng versions 0.97, January 1998, through 1.0.6e, April 10, 2000)
|
||||
|
||||
For the purposes of this copyright and license, "Contributing Authors"
|
||||
is defined as the following set of individuals:
|
||||
|
79
libpng.txt
79
libpng.txt
@ -1,6 +1,6 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.0.6d - April 7, 2000
|
||||
libpng version 1.0.6e - April 10, 2000
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<randeg@alum.rpi.edu>
|
||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
@ -341,7 +341,7 @@ where png_transforms is an integer containing the logical-or of some set of
|
||||
transformation flags. This call is equivalent to png_read_info(),
|
||||
followed the set of transformations indicated by the transform mask,
|
||||
followed by png_update_info(), followed by a read of the image bytes
|
||||
to the info member `rowpointers', followed by png_read_end().
|
||||
to the info_ptr, followed by png_read_end().
|
||||
|
||||
(The final parameter of this call is not yet used. Someday it
|
||||
will point to transformation parameters.)
|
||||
@ -1114,7 +1114,6 @@ point to libpng-allocated storage with the following functions:
|
||||
PNG_FREE_PLTE, PNG_FREE_TRNS,
|
||||
PNG_FREE_HIST, PNG_FREE_ICCP,
|
||||
PNG_FREE_SPLT, PNG_FREE_ROWS,
|
||||
PNG_FREE_PCAL, PNG_FREE_SCAL,
|
||||
PNG_FREE_TEXT, PNG_FREE_UNKN,
|
||||
or simply PNG_FREE_ALL
|
||||
n - sequence number of item to be freed
|
||||
@ -1128,6 +1127,26 @@ of the selected data type, such as PLTE, is allowed. If "n" is not
|
||||
-1, and multiple items are allowed for the data type identified in
|
||||
the mask, such as text or splt, only the n'th item is freed.
|
||||
|
||||
The default behavior is only to free data that was allocated internally
|
||||
by libpng. This can be changed, so that libpng will not free the data,
|
||||
or so that it will also free data that was passed in via a png_set_*()
|
||||
function, with
|
||||
|
||||
png_data_freer(png_ptr, info_ptr, freer, mask)
|
||||
mask - which data elements are affected
|
||||
same choices as in png_free_data()
|
||||
freer - one of
|
||||
PNG_DESTROY_WILL_FREE_DATA
|
||||
PNG_SET_WILL_FREE_DATA
|
||||
PNG_USER_WILL_FREE_DATA
|
||||
|
||||
This function only affects data that has already been allocated.
|
||||
You can call this function after reading the PNG data but before calling
|
||||
any png_set_*() functions, to control whether the user or the png_set_*()
|
||||
function is responsible for freeing any existing data that might be present,
|
||||
and again after the png_set_*() functions to control whether the user
|
||||
or png_destroy_*() is supposed to free the data..
|
||||
|
||||
For a more compact example of reading a PNG image, see the file example.c.
|
||||
|
||||
Reading PNG files progressively
|
||||
@ -1726,7 +1745,7 @@ The high-level write interface
|
||||
At this point there are two ways to proceed; through the high-level
|
||||
write interface, or through a sequence of low-level write operations.
|
||||
You can use the high-level interface if your image data is present
|
||||
on the rowpointers member of the info structure. All defined output
|
||||
in the info structure. All defined output
|
||||
transformations are permitted, enabled by the following masks.
|
||||
|
||||
PNG_TRANSFORM_IDENTITY No transformation
|
||||
@ -1740,15 +1759,15 @@ transformations are permitted, enabled by the following masks.
|
||||
PNG_TRANSFORM_SWAP_ENDIAN Byte-swap 16-bit samples
|
||||
PNG_TRANSFORM_STRIP_FILLER Strip out filler bytes.
|
||||
|
||||
If you have valid image data on the rowpointers member, simply do this:
|
||||
If you have valid image data in the info structure, simply do this:
|
||||
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, NULL)
|
||||
|
||||
where png_transforms is an integer containing the logical-or of some set of
|
||||
transformation flags. This call is equivalent to png_write_info(),
|
||||
followed by the set of transformations indicated by the transform
|
||||
mask, followed by followed by a write of the image bytes from the info
|
||||
member `rowpointers', followed by png_write_end().
|
||||
mask, followed by followed by a write of the image bytes from the
|
||||
info_ptr, followed by png_write_end().
|
||||
|
||||
(The final parameter of this call is not yet used. Someday it
|
||||
may point to output transformation parameters.)
|
||||
@ -2006,7 +2025,6 @@ point to libpng-allocated storage with the following functions:
|
||||
PNG_FREE_PLTE, PNG_FREE_TRNS,
|
||||
PNG_FREE_HIST, PNG_FREE_ICCP,
|
||||
PNG_FREE_SPLT, PNG_FREE_ROWS,
|
||||
PNG_FREE_PCAL, PNG_FREE_SCAL,
|
||||
PNG_FREE_TEXT, PNG_FREE_UNKN,
|
||||
or simply PNG_FREE_ALL
|
||||
n - sequence number of item to be freed
|
||||
@ -2023,6 +2041,35 @@ If you allocated data such as a palette that you passed in to libpng with
|
||||
png_set_*, you must not free it until just before the call to
|
||||
png_destroy_write_struct().
|
||||
|
||||
The default behavior is only to free data that was allocated internally
|
||||
by libpng. This can be changed, so that libpng will not free the data,
|
||||
or so that it will free data that was passed in via a png_set_*() function,
|
||||
with
|
||||
|
||||
png_data_freer(png_ptr, info_ptr, freer, mask)
|
||||
mask - which data elements are affected
|
||||
same choices as in png_free_data()
|
||||
freer - one of
|
||||
PNG_DESTROY_WILL_FREE_DATA
|
||||
PNG_SET_WILL_FREE_DATA
|
||||
PNG_USER_WILL_FREE_DATA
|
||||
|
||||
For example, to transfer responsibility for some data from a read structure
|
||||
to a write structure, you could use
|
||||
|
||||
png_data_freer(read_ptr, read_info_ptr,
|
||||
PNG_USER_WILL_FREE_DATA,
|
||||
PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST)
|
||||
png_data_freer(write_ptr, write_info_ptr,
|
||||
PNG_DESTROY_WILL_FREE_DATA,
|
||||
PNG_FREE_PLTE|PNG_FREE_tRNS|PNG_FREE_hIST)
|
||||
|
||||
Thereby briefly reassigning responsibility for freeing to the user but
|
||||
immediately afterwards reassigning it once more to the write_destroy
|
||||
function. Having done this, it would then be safe to destroy the read
|
||||
structure and continue to use the PLTE, tRNS, and hIST data in the write
|
||||
structure.
|
||||
|
||||
For a more compact example of writing a PNG image, see the file example.c.
|
||||
|
||||
V. Modifying/Customizing libpng:
|
||||
@ -2088,11 +2135,13 @@ but you could change this to do things like exit() if you should wish.
|
||||
On non-fatal errors, png_warning() is called
|
||||
to print a warning message, and then control returns to the calling code.
|
||||
By default png_error() and png_warning() print a message on stderr via
|
||||
fprintf() unless the library is compiled with PNG_NO_STDIO defined. If
|
||||
you wish to change the behavior of the error functions, you will need to
|
||||
set up your own message callbacks. These functions are normally supplied
|
||||
at the time that the png_struct is created. It is also possible to change
|
||||
these functions after png_create_*_struct() has been called by calling:
|
||||
fprintf() unless the library is compiled with PNG_NO_CONSOLE_IO defined
|
||||
(because you don't want the messages) or PNG_NO_STDIO defined (because
|
||||
fprintf() isn't available). If you wish to change the behavior of the error
|
||||
functions, you will need to set up your own message callbacks. These
|
||||
functions are normally supplied at the time that the png_struct is created.
|
||||
It is also possible to change these functions after png_create_*_struct()
|
||||
has been called by calling:
|
||||
|
||||
png_set_error_fn(png_structp png_ptr,
|
||||
png_voidp error_ptr, png_error_ptr error_fn,
|
||||
@ -2395,13 +2444,13 @@ the old method.
|
||||
|
||||
VII. Y2K Compliance in libpng
|
||||
|
||||
April 7, 2000
|
||||
April 10, 2000
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.0.6d are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.0.6e are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
|
@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 April 7, 2000
|
||||
.TH LIBPNGPF 3 April 10, 2000
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6d
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.0.6e
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "April 7, 2000"
|
||||
.TH PNG 5 "April 10, 2000"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
35
png.c
35
png.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* libpng version 1.0.6d - April 7, 2000
|
||||
* libpng version 1.0.6e - April 10, 2000
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
@ -14,14 +14,14 @@
|
||||
#include "png.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_0_6d Your_png_h_is_not_version_1_0_6d;
|
||||
typedef version_1_0_6e Your_png_h_is_not_version_1_0_6e;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
|
||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
||||
char png_libpng_ver[12] = "1.0.6d";
|
||||
char png_libpng_ver[12] = "1.0.6e";
|
||||
|
||||
/* png_sig was changed to a function in version 1.0.5c */
|
||||
/* Place to hold the signature string for a PNG file. */
|
||||
@ -261,9 +261,26 @@ png_info_init(png_infop info_ptr)
|
||||
png_memset(info_ptr, 0, sizeof (png_info));
|
||||
}
|
||||
|
||||
void
|
||||
png_data_freer(png_structp png_ptr, png_infop info_ptr,
|
||||
int freer, png_uint_32 mask)
|
||||
{
|
||||
png_debug(1, "in png_data_freer\n");
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
if(freer == PNG_DESTROY_WILL_FREE_DATA)
|
||||
info_ptr->free_me |= mask;
|
||||
else if(freer == PNG_USER_WILL_FREE_DATA)
|
||||
info_ptr->free_me &= ~mask;
|
||||
else
|
||||
png_warning(png_ptr,
|
||||
"Unknown freer parameter in png_data_freer.");
|
||||
}
|
||||
|
||||
void
|
||||
png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num)
|
||||
{
|
||||
png_debug(1, "in png_free_data\n");
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
@ -306,7 +323,6 @@ if (mask & PNG_FREE_TRNS)
|
||||
|
||||
#if defined(PNG_sCAL_SUPPORTED)
|
||||
/* free any sCAL entry */
|
||||
if (mask & PNG_FREE_SCAL)
|
||||
{
|
||||
if (info_ptr->valid & PNG_INFO_sCAL)
|
||||
{
|
||||
@ -321,7 +337,6 @@ if (mask & PNG_FREE_SCAL)
|
||||
|
||||
#if defined(PNG_pCAL_SUPPORTED)
|
||||
/* free any pCAL entry */
|
||||
if (mask & PNG_FREE_PCAL)
|
||||
{
|
||||
if (info_ptr->valid & PNG_INFO_pCAL)
|
||||
{
|
||||
@ -484,7 +499,9 @@ png_get_io_ptr(png_structp png_ptr)
|
||||
#if !defined(PNG_NO_STDIO)
|
||||
/* Initialize the default input/output functions for the PNG file. If you
|
||||
* use your own read or write routines, you can call either png_set_read_fn()
|
||||
* or png_set_write_fn() instead of png_init_io().
|
||||
* or png_set_write_fn() instead of png_init_io(). If you have defined
|
||||
* PNG_NO_STDIO, you must use a function of your own because "FILE *" isn't
|
||||
* necessarily available.
|
||||
*/
|
||||
void
|
||||
png_init_io(png_structp png_ptr, FILE *fp)
|
||||
@ -544,7 +561,7 @@ png_charp
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr != NULL || png_ptr == NULL) /* silence compiler warning */
|
||||
return ("\n libpng version 1.0.6d - April 7, 2000\n\
|
||||
return ("\n libpng version 1.0.6e - April 10, 2000\n\
|
||||
Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.\n\
|
||||
Copyright (c) 1996, 1997 Andreas Dilger\n\
|
||||
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson\n");
|
||||
@ -562,8 +579,8 @@ png_get_libpng_ver(png_structp png_ptr)
|
||||
{
|
||||
/* Version of *.c files used when building libpng */
|
||||
if(png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
||||
return("1.0.6d");
|
||||
return("1.0.6d");
|
||||
return("1.0.6e");
|
||||
return("1.0.6e");
|
||||
}
|
||||
|
||||
png_charp
|
||||
|
56
png.h
56
png.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.0.6d - April 7, 2000
|
||||
* libpng version 1.0.6e - April 10, 2000
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
@ -9,7 +9,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.0.6d - April 7, 2000: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.0.6e - April 10, 2000: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@ -47,7 +47,7 @@
|
||||
* 1.0.5e-r 1.0.5e-r 10100 2.1.0.5e-r (not compatible)
|
||||
* 1.0.5s-v 1.0.5s-v 10006 2.1.0.5s-v (compatible)
|
||||
* 1.0.6 (+ 3 patches) 1.0.6 10006 2.1.0.6
|
||||
* 1.0.6d 1.0.6d 10007 2.1.0.6d
|
||||
* 1.0.6d-e 1.0.6d-e 10007 2.1.0.6d-e
|
||||
* 1.0.7 1.0.7 10007 2.1.0.7 (still compatible)
|
||||
*
|
||||
* Henceforth the source version will match the shared-library minor
|
||||
@ -73,7 +73,7 @@
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
* (libpng versions 0.89c, June 1996, through 0.96, May 1997)
|
||||
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
* (libpng versions 0.97, January 1998, through 1.0.6d, April 7, 2000)
|
||||
* (libpng versions 0.97, January 1998, through 1.0.6e, April 10, 2000)
|
||||
*
|
||||
* For the purposes of this copyright and license, "Contributing Authors"
|
||||
* is defined as the following set of individuals:
|
||||
@ -148,13 +148,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* April 7, 2000
|
||||
* April 10, 2000
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.0.6d are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.0.6e are Y2K compliant. It is my belief that earlier
|
||||
* versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
@ -232,7 +232,7 @@ extern "C" {
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.6d"
|
||||
#define PNG_LIBPNG_VER_STRING "1.0.6e"
|
||||
|
||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||
* We must not include leading zeros.
|
||||
@ -428,16 +428,20 @@ typedef png_unknown_chunk FAR * FAR * png_unknown_chunkpp;
|
||||
* The following members may have allocated storage attached that should be
|
||||
* cleaned up before the structure is discarded: palette, trans, text,
|
||||
* pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
|
||||
* splt_palettes, scal_unit, and row_pointers. These are automatically
|
||||
* freed when the info structure is deallocated.
|
||||
* splt_palettes, scal_unit, row_pointers, and unknowns. By default, these are
|
||||
* automatically freed when the info structure is deallocated, if they were
|
||||
* allocated internally by libpng. This behavior can be changed by means
|
||||
* of the png_data_freer() function.
|
||||
*
|
||||
* More allocation details: all the chunk-reading functions that change these
|
||||
* members go through the corresponding png_set_* functions. Functions to
|
||||
* clear these members are available: see png_free_*. The png_set_* functions
|
||||
* do not depend on being able to point info structure members to any of the
|
||||
* storage they are passed (they make their own copies), EXCEPT that the
|
||||
* png_set_text function uses the same storage passed to them
|
||||
* in the text_ptr or itxt_ptr structure argument.
|
||||
* members go through the corresponding png_set_* functions. A function to
|
||||
* clear these members is available: see png_free_data(). Some of the
|
||||
* png_set_* functions do not depend on being able to point info structure
|
||||
* members to any of the storage they are passed (they make their own copies),
|
||||
* EXCEPT that the png_set_text functions use the same storage passed to them
|
||||
* in the text_ptr or itxt_ptr structure argument, and the png_set_tRNS,
|
||||
* png_set_PLTE, png_set_hIST, png_set_iCCP, png_set_rows, png_set_sPLT,
|
||||
* and png_set_unknowns do not make their own copies.
|
||||
*/
|
||||
typedef struct png_info_struct
|
||||
{
|
||||
@ -1057,9 +1061,9 @@ struct png_struct_def
|
||||
};
|
||||
|
||||
/* This prevents a compiler error in png_get_copyright() in png.c if png.c
|
||||
and png.h are both at * version 1.0.6d
|
||||
and png.h are both at * version 1.0.6e
|
||||
*/
|
||||
typedef png_structp version_1_0_6d;
|
||||
typedef png_structp version_1_0_6e;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
@ -1591,10 +1595,18 @@ extern PNG_EXPORT(png_voidp,png_malloc) PNGARG((png_structp png_ptr,
|
||||
/* frees a pointer allocated by png_malloc() */
|
||||
extern PNG_EXPORT(void,png_free) PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
|
||||
/* free data that was allocated internally */
|
||||
/* Free data that was allocated internally */
|
||||
extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 free_me, int num));
|
||||
/* flags for png_ptr->free_me and info_ptr->free_me */
|
||||
/* Reassign responsibility for freeing existing data, whether allocated
|
||||
* by libpng or by the application */
|
||||
extern PNG_EXPORT(void,png_data_freer) PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, int freer, png_uint_32 mask));
|
||||
/* assignments for png_data_freer */
|
||||
#define PNG_DESTROY_WILL_FREE_DATA 1
|
||||
#define PNG_SET_WILL_FREE_DATA 1
|
||||
#define PNG_USER_WILL_FREE_DATA 2
|
||||
/* Flags for png_ptr->free_me and info_ptr->free_me */
|
||||
#define PNG_FREE_PLTE 0x0001
|
||||
#define PNG_FREE_TRNS 0x0002
|
||||
#define PNG_FREE_TEXT 0x0004
|
||||
@ -1602,8 +1614,8 @@ extern PNG_EXPORT(void,png_free_data) PNGARG((png_structp png_ptr,
|
||||
#define PNG_FREE_ICCP 0x0010
|
||||
#define PNG_FREE_SPLT 0x0020
|
||||
#define PNG_FREE_ROWS 0x0040
|
||||
#define PNG_FREE_PCAL 0x0080
|
||||
#define PNG_FREE_SCAL 0x0100
|
||||
#define PNG_FREE_PCAL 0x0080 /* not used any more */
|
||||
#define PNG_FREE_SCAL 0x0100 /* not used any more */
|
||||
#define PNG_FREE_UNKN 0x0200
|
||||
#define PNG_FREE_LIST 0x0400
|
||||
#define PNG_FREE_ALL 0x07ff
|
||||
@ -2032,7 +2044,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));
|
||||
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.0.6d - April 7, 2000 (header)\n"
|
||||
" libpng version 1.0.6e - April 10, 2000 (header)\n"
|
||||
|
||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||
/* With these routines we avoid an integer divide, which will be slower on
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* pngasmrd.h - assembler version of utilities to read a PNG file
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1999, 2000 Glenn Randers-Pehrson
|
||||
*
|
||||
|
21
pngconf.h
21
pngconf.h
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
@ -255,7 +255,7 @@
|
||||
* things to happen if the library and/or application ever change.
|
||||
*/
|
||||
|
||||
/* Any transformations you will not be using can be undef'ed here */
|
||||
/* Any features you will not be using can be undef'ed here */
|
||||
|
||||
/* GR-P, 0.96a: Set "*TRANSFORMS_SUPPORTED as default but allow user
|
||||
to turn it off with "*TRANSFORMS_NOT_SUPPORTED" or *PNG_NO_*_TRANSFORMS
|
||||
@ -267,7 +267,13 @@
|
||||
1.0.1c, for consistency)
|
||||
*/
|
||||
|
||||
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
|
||||
#define PNG_FLOATING_POINT_SUPPORTED
|
||||
#endif
|
||||
|
||||
#ifndef PNG_NO_FIXED_POINT_SUPPORTED
|
||||
#define PNG_FIXED_POINT_SUPPORTED
|
||||
#endif
|
||||
|
||||
#if !defined(PNG_READ_TRANSFORMS_NOT_SUPPORTED) && \
|
||||
!defined(PNG_NO_READ_TRANSFORMS)
|
||||
@ -387,7 +393,8 @@
|
||||
encoders, but can cause trouble
|
||||
if left undefined */
|
||||
|
||||
#ifndef PNG_NO_WRITE_WEIGHTED_FILTER
|
||||
#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
|
||||
defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
#endif
|
||||
|
||||
@ -428,14 +435,6 @@
|
||||
#define PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
#endif
|
||||
|
||||
#ifndef PNG_NO_FLOATING_POINT_SUPPORTED
|
||||
#define PNG_FLOATING_POINT_SUPPORTED
|
||||
#endif
|
||||
|
||||
#ifndef PNG_NO_FIXED_POINT_SUPPORTED
|
||||
#define PNG_FIXED_POINT_SUPPORTED
|
||||
#endif
|
||||
|
||||
/* Do not use global arrays (helps with building DLL's)
|
||||
* They are no longer used in libpng itself, since version 1.0.5c,
|
||||
* but might be required for some pre-1.0.5c applications.
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -6,7 +6,7 @@
|
||||
* and http://www.intel.com/drg/pentiumII/appnotes/923/923.htm
|
||||
* for Intel's performance analysis of the MMX vs. non-MMX code.
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998, Intel Corporation
|
||||
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
|
2
pngget.c
2
pngget.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
2
pngmem.c
2
pngmem.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
@ -641,7 +641,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
|
||||
* be ignored, so pass NULL to it.
|
||||
*
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.6d.
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.6e.
|
||||
*/
|
||||
|
||||
void
|
||||
@ -690,7 +690,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
* only call this function once. If you desire to have an image for
|
||||
* each pass of a interlaced image, use png_read_rows() instead.
|
||||
*
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.6d.
|
||||
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.6e.
|
||||
*/
|
||||
void
|
||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
|
2
pngrio.c
2
pngrio.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
33
pngrutil.c
33
pngrutil.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
@ -392,8 +392,9 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
num = (int)length / 3;
|
||||
|
||||
palette = (png_colorp)png_zalloc(png_ptr, (uInt)num, sizeof (png_color));
|
||||
png_ptr->free_me |= PNG_FREE_PLTE;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
png_byte buf[3];
|
||||
@ -431,7 +432,6 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
else
|
||||
{
|
||||
png_chunk_warning(png_ptr, "CRC error");
|
||||
png_ptr->free_me &= ~PNG_FREE_PLTE;
|
||||
png_zfree(png_ptr, palette);
|
||||
return;
|
||||
}
|
||||
@ -445,6 +445,9 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
#endif
|
||||
png_ptr->palette = palette;
|
||||
png_ptr->num_palette = (png_uint_16)num;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
|
||||
png_ptr->free_me |= PNG_FREE_PLTE;
|
||||
png_set_PLTE(png_ptr, info_ptr, palette, num);
|
||||
|
||||
#if defined (PNG_READ_tRNS_SUPPORTED)
|
||||
@ -452,10 +455,15 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
|
||||
{
|
||||
if (png_ptr->num_trans > png_ptr->num_palette)
|
||||
if (png_ptr->num_trans > (png_uint_16)num)
|
||||
{
|
||||
png_warning(png_ptr, "Truncating incorrect tRNS chunk length");
|
||||
png_ptr->num_trans = png_ptr->num_palette;
|
||||
png_ptr->num_trans = (png_uint_16)num;
|
||||
}
|
||||
if (info_ptr->num_trans > (png_uint_16)num)
|
||||
{
|
||||
png_warning(png_ptr, "Truncating incorrect info tRNS chunk length");
|
||||
info_ptr->num_trans = (png_uint_16)num;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -543,7 +551,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring incorrect gAMA value when sRGB is also present");
|
||||
#ifndef PNG_NO_CONSOLE_IO
|
||||
#ifndef PNG_NO_STDIO
|
||||
fprintf(stderr, "gamma = (%d/100000)\n", (int)igamma);
|
||||
#endif
|
||||
return;
|
||||
@ -753,7 +761,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_warning(png_ptr,
|
||||
"Ignoring incorrect cHRM value when sRGB is also present");
|
||||
#ifndef PNG_NO_CONSOLE_IO
|
||||
#ifndef PNG_NO_STDIO
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
fprintf(stderr,"wx=%f, wy=%f, rx=%f, ry=%f\n",
|
||||
white_x, white_y, red_x, red_y);
|
||||
@ -765,7 +773,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
fprintf(stderr,"gx=%ld, gy=%ld, bx=%ld, by=%ld\n",
|
||||
int_x_green, int_y_green, int_x_blue, int_y_blue);
|
||||
#endif
|
||||
#endif /* PNG_NO_CONSOLE_IO */
|
||||
#endif /* PNG_NO_STDIO */
|
||||
}
|
||||
png_crc_finish(png_ptr, 0);
|
||||
return;
|
||||
@ -848,7 +856,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Ignoring incorrect gAMA value when sRGB is also present");
|
||||
#ifndef PNG_NO_CONSOLE_IO
|
||||
#ifndef PNG_NO_STDIO
|
||||
# ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
fprintf(stderr,"incorrect gamma=(%d/100000)\n",(int)png_ptr->int_gamma);
|
||||
# else
|
||||
@ -923,7 +931,6 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
#endif
|
||||
|
||||
chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
|
||||
png_ptr->free_me |= PNG_FREE_ICCP;
|
||||
slength = (png_size_t)length;
|
||||
png_crc_read(png_ptr, (png_bytep)chunkdata, slength);
|
||||
|
||||
@ -1103,7 +1110,6 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
png_ptr->trans = (png_bytep)png_malloc(png_ptr, length);
|
||||
png_ptr->free_me |= PNG_FREE_TRNS;
|
||||
png_crc_read(png_ptr, png_ptr->trans, (png_size_t)length);
|
||||
png_ptr->num_trans = (png_uint_16)length;
|
||||
}
|
||||
@ -1149,6 +1155,8 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
if (png_crc_finish(png_ptr, 0))
|
||||
return;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||
png_ptr->free_me |= PNG_FREE_TRNS;
|
||||
png_set_tRNS(png_ptr, info_ptr, png_ptr->trans, png_ptr->num_trans,
|
||||
&(png_ptr->trans_values));
|
||||
}
|
||||
@ -1283,7 +1291,6 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
num = (int)length / 2 ;
|
||||
png_ptr->hist = (png_uint_16p)png_malloc(png_ptr,
|
||||
(png_uint_32)(num * sizeof (png_uint_16)));
|
||||
png_ptr->free_me |= PNG_FREE_HIST;
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
png_byte buf[2];
|
||||
@ -1295,6 +1302,8 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
if (png_crc_finish(png_ptr, 0))
|
||||
return;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
||||
png_ptr->free_me |= PNG_FREE_HIST;
|
||||
png_set_hIST(png_ptr, info_ptr, png_ptr->hist);
|
||||
}
|
||||
#endif
|
||||
|
5
pngset.c
5
pngset.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
@ -425,6 +425,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL)
|
||||
return;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ICCP, 0);
|
||||
info_ptr->iccp_name = png_malloc(png_ptr, png_strlen(name)+1);
|
||||
strcpy(info_ptr->iccp_name, name);
|
||||
info_ptr->iccp_profile = png_malloc(png_ptr, proflen);
|
||||
@ -754,8 +755,8 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
|
||||
info_ptr->row_pointers = row_pointers;
|
||||
info_ptr->free_me |= PNG_FREE_ROWS;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
@ -1344,4 +1344,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_0_6d your_png_h_is_not_version_1_0_6d;
|
||||
typedef version_1_0_6e your_png_h_is_not_version_1_0_6e;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -2,7 +2,7 @@
|
||||
*
|
||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998, Intel Corporation
|
||||
* Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
|
||||
|
2
pngwio.c
2
pngwio.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* libpng 1.0.6d - April 7, 2000
|
||||
* libpng 1.0.6e - April 10, 2000
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
|
||||
* Copyright (c) 1996, 1997 Andreas Dilger
|
||||
|
@ -31,7 +31,7 @@ RANLIB=ranlib
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# where make install puts libpng.a, libpng.so*, and png.h
|
||||
|
@ -14,7 +14,7 @@ ZLIBINC=../zlib
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
CC=cc
|
||||
|
@ -34,7 +34,7 @@ RANLIB=ranlib
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
|
@ -34,7 +34,7 @@ RANLIB=ranlib
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
|
@ -25,7 +25,7 @@ RANLIB=echo
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
|
@ -19,8 +19,8 @@ CFLAGS=-I$(ZLIBINC) -O2 $(WARNMORE) -fPIC -mabi=n32 # -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
LDSHARED=gcc -shared
|
||||
|
||||
VER=1.0.6d
|
||||
LIBS=libpng.so.1.0.6d
|
||||
VER=1.0.6e
|
||||
LIBS=libpng.so.1.0.6e
|
||||
SHAREDLIB=libpng.so
|
||||
libdir=$(prefix)/lib32
|
||||
|
||||
|
@ -31,7 +31,7 @@ RANLIB=echo
|
||||
# read libpng.txt or png.h to see why PNGMAJ is 2. You should not
|
||||
# have to change it.
|
||||
PNGMAJ = 2
|
||||
PNGMIN = 1.0.6d
|
||||
PNGMIN = 1.0.6e
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
|
@ -3,7 +3,7 @@ unit pngdef;
|
||||
interface
|
||||
|
||||
const
|
||||
PNG_LIBPNG_VER_STRING = '1.0.6d';
|
||||
PNG_LIBPNG_VER_STRING = '1.0.6e';
|
||||
PNG_LIBPNG_VER = 10007;
|
||||
|
||||
type
|
||||
|
Reference in New Issue
Block a user