Imported from libpng-1.2.6rc1.tar
This commit is contained in:
parent
5fea36fb00
commit
272489dc69
19
ANNOUNCE
19
ANNOUNCE
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Libpng 1.2.6beta4 - July 28, 2004
|
Libpng 1.2.6rc1 - August 4, 2004
|
||||||
|
|
||||||
This is not intended to be a public release. It will be replaced
|
This is not intended to be a public release. It will be replaced
|
||||||
within a few weeks by a public version or by another test version.
|
within a few weeks by a public version or by another test version.
|
||||||
@ -76,9 +76,24 @@ Changes since the last public release (1.2.5):
|
|||||||
Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4.
|
Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4.
|
||||||
Revised Borland portion of png_malloc() to return NULL or issue
|
Revised Borland portion of png_malloc() to return NULL or issue
|
||||||
png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK.
|
png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK.
|
||||||
|
Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove
|
||||||
|
sequential read support.
|
||||||
|
Added some "#if PNG_WRITE_SUPPORTED" blocks.
|
||||||
|
#ifdef'ed out some redundancy in png_malloc_default().
|
||||||
|
Use png_malloc instead of png_zalloc to allocate the pallete.
|
||||||
|
Rearranged order of processing of color types in png_handle_tRNS().
|
||||||
|
Added PNG_ROWBYTES macro to calculate rowbytes without integer overflow.
|
||||||
|
Updated makefile.darwin and removed makefile.macosx from scripts directory.
|
||||||
|
Imposed default one million column, one-million row limits on the image
|
||||||
|
dimensions, and added png_set_user_limits() function and
|
||||||
|
PNG_SET_USER_LIMITS_SUPPORTED macro to override them..
|
||||||
|
Fixed wrong cast of returns from png_get_user_width|height_max().
|
||||||
|
Fixed buffer overflow vulnerability in png_handle_tRNS()
|
||||||
|
Fixed integer arithmetic overflow vulnerability in png_read_png().
|
||||||
|
Fixed some harmless bugs in png_handle_sBIT, etc, that would cause
|
||||||
|
duplicate chunk types to go undetected.
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to glennrp@users.sourceforge.net
|
png-implement@ccrc.wustl.edu or to glennrp@users.sourceforge.net
|
||||||
|
|
||||||
Glenn R-P
|
Glenn R-P
|
||||||
|
|
||||||
|
25
CHANGES
25
CHANGES
@ -1241,7 +1241,7 @@ version 1.2.6beta3 [July 18, 2004]
|
|||||||
Updated contrib/visupng/VisualPng.dsp (Cosmin).
|
Updated contrib/visupng/VisualPng.dsp (Cosmin).
|
||||||
Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin).
|
Updated contrib/visupng/cexcept.h to version 2.0.0 (Cosmin).
|
||||||
Added a separate distribution with "configure" and supporting files (Junichi).
|
Added a separate distribution with "configure" and supporting files (Junichi).
|
||||||
version 1.2.6beta4 [July 28, 2004]
|
version 1.2.6beta4 [August 4, 2004]
|
||||||
Added user ability to change png_size_t via a PNG_SIZE_T macro.
|
Added user ability to change png_size_t via a PNG_SIZE_T macro.
|
||||||
Added png_sizeof() and png_convert_size() functions.
|
Added png_sizeof() and png_convert_size() functions.
|
||||||
Added PNG_SIZE_MAX (maximum value of a png_size_t variable.
|
Added PNG_SIZE_MAX (maximum value of a png_size_t variable.
|
||||||
@ -1256,6 +1256,7 @@ version 1.2.6beta4 [July 28, 2004]
|
|||||||
overflow.
|
overflow.
|
||||||
Turn on PNG_NO_ZALLOC_ZERO by default in version 1.2.x
|
Turn on PNG_NO_ZALLOC_ZERO by default in version 1.2.x
|
||||||
Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4.
|
Revised "clobber list" in pnggccrd.c so it will compile under gcc-3.4.
|
||||||
|
version 1.2.6beta4 [July 28, 2004]
|
||||||
Revised Borland portion of png_malloc() to return NULL or issue
|
Revised Borland portion of png_malloc() to return NULL or issue
|
||||||
png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK.
|
png_error() according to setting of PNG_FLAG_MALLOC_NULL_MEM_OK.
|
||||||
Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove
|
Added PNG_NO_SEQUENTIAL_READ_SUPPORTED macro to conditionally remove
|
||||||
@ -1263,7 +1264,27 @@ version 1.2.6beta4 [July 28, 2004]
|
|||||||
Added some "#if PNG_WRITE_SUPPORTED" blocks.
|
Added some "#if PNG_WRITE_SUPPORTED" blocks.
|
||||||
#ifdef'ed out some redundancy in png_malloc_default().
|
#ifdef'ed out some redundancy in png_malloc_default().
|
||||||
Use png_malloc instead of png_zalloc to allocate the pallete.
|
Use png_malloc instead of png_zalloc to allocate the pallete.
|
||||||
|
version 1.2.6beta4d [July 28, 2004]
|
||||||
|
Fixed buffer overflow vulnerability in png_handle_tRNS()
|
||||||
|
Fixed integer arithmetic overflow vulnerability in png_read_png().
|
||||||
|
Fixed some harmless bugs in png_handle_sBIT, etc, that would cause
|
||||||
|
duplicate chunk types to go undetected.
|
||||||
|
Fixed some timestamps in the -config version
|
||||||
|
version 1.2.6beta4e [July 28, 2004]
|
||||||
|
Fixed some timestamps in the -config version
|
||||||
|
version 1.2.6beta4f [July 28, 2004]
|
||||||
|
Rearranged order of processing of color types in png_handle_tRNS().
|
||||||
|
version 1.2.6beta4g [July 31, 2004]
|
||||||
|
Added ROWBYTES macro to calculate rowbytes without integer overflow.
|
||||||
|
Updated makefile.darwin and removed makefile.macosx from scripts directory.
|
||||||
|
version 1.2.6beta4h [August 1, 2004]
|
||||||
|
Imposed default one million column, one-million row limits on the image
|
||||||
|
dimensions, and added png_set_user_limits() function to override them.
|
||||||
|
Revised use of PNG_SET_USER_LIMITS_SUPPORTED macro.
|
||||||
|
version 1.2.6beta4j [August 1, 2004]
|
||||||
|
Fixed wrong cast of returns from png_get_user_width|height_max().
|
||||||
|
version 1.2.6rc6 [August 4, 2004]
|
||||||
|
Changed some "keep the compiler happy" from empty statements to returns,
|
||||||
|
|
||||||
Send comments/corrections/commendations to
|
Send comments/corrections/commendations to
|
||||||
png-implement@ccrc.wustl.edu or to glennrp@users.sourceforge.net
|
png-implement@ccrc.wustl.edu or to glennrp@users.sourceforge.net
|
||||||
|
17
INSTALL
17
INSTALL
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Installing libpng version 1.2.6beta4 - July 28, 2004
|
Installing libpng version 1.2.6rc1 - August 4, 2004
|
||||||
|
|
||||||
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.2.6beta4" or "lpng109" and "zlib-1.1.3"
|
might be called "libpng-1.2.6rc1" or "lpng109" 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:
|
||||||
@ -64,8 +64,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 libpng12.so.0.1.2.6beta4)
|
makefile.linux => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.6rc1)
|
||||||
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.6beta4,
|
makefile.gcmmx => Linux/ELF makefile (gcc, creates libpng12.so.0.1.2.6rc1,
|
||||||
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
|
||||||
@ -73,7 +73,7 @@ include
|
|||||||
ftp://ftp.cs.wisc.edu/ghost)
|
ftp://ftp.cs.wisc.edu/ghost)
|
||||||
makefile.aix => AIX/gcc makefile
|
makefile.aix => AIX/gcc makefile
|
||||||
makefile.cygwin => Cygwin/gcc makefile
|
makefile.cygwin => Cygwin/gcc makefile
|
||||||
makefile.darwin => Darwin makefile
|
makefile.darwin => Darwin makefile, can use on MacosX
|
||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.hpgcc => FreeBSD makefile
|
makefile.hpgcc => FreeBSD makefile
|
||||||
makefile.hpgcc => HPUX makefile using gcc
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
@ -81,15 +81,14 @@ 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)
|
||||||
makefile.intel => Intel C/C++ version 4.0 and later
|
makefile.intel => Intel C/C++ version 4.0 and later
|
||||||
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.macosx => MACOS X Makefile
|
|
||||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
||||||
makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so
|
makefile.ne0bsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng0.so
|
||||||
makefile.openbsd => OpenBSD makefile
|
makefile.openbsd => OpenBSD makefile
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||||
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.6beta4)
|
makefile.sggcc => Silicon Graphics (gcc, creates libpng12.so.0.1.2.6rc1)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.6beta4)
|
makefile.solaris => Solaris 2.X makefile (gcc, creates libpng12.so.0.1.2.6rc1)
|
||||||
makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.6beta4)
|
makefile.so9 => Solaris 9 makefile (gcc, creates libpng12.so.0.1.2.6rc1)
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
|
2
KNOWNBUG
2
KNOWNBUG
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Known bugs in libpng version 1.2.6beta4
|
Known bugs in libpng version 1.2.6rc1
|
||||||
|
|
||||||
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
|
||||||
reading interlaced PNG files, when assembler code is enabled but running
|
reading interlaced PNG files, when assembler code is enabled but running
|
||||||
|
4
LICENSE
4
LICENSE
@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng version 1.2.6, July 28, 2004, is
|
libpng version 1.2.6, August 4, 2004, is
|
||||||
Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
||||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@ -107,4 +107,4 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp@users.sourceforge.net
|
glennrp@users.sourceforge.net
|
||||||
July 28, 2004
|
August 4, 2004
|
||||||
|
2
README
2
README
@ -1,4 +1,4 @@
|
|||||||
README for libpng version 1.2.6beta4 - July 28, 2004 (shared library 12.0)
|
README for libpng version 1.2.6rc1 - August 4, 2004 (shared library 12.0)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
|
4
Y2KINFO
4
Y2KINFO
@ -1,13 +1,13 @@
|
|||||||
Y2K compliance in libpng:
|
Y2K compliance in libpng:
|
||||||
=========================
|
=========================
|
||||||
|
|
||||||
July 28, 2004
|
August 4, 2004
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.6beta4 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.6rc1 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
|
||||||
|
4
configure
vendored
4
configure
vendored
@ -1,13 +1,13 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo "
|
echo "
|
||||||
There is no \"configure\" script in this distribution of
|
There is no \"configure\" script in this distribution of
|
||||||
libpng-1.2.6beta4.
|
libpng-1.2.6rc1.
|
||||||
|
|
||||||
Instead, please copy the appropriate makefile for your system from the
|
Instead, please copy the appropriate makefile for your system from the
|
||||||
\"scripts\" directory. Read the INSTALL file for more details.
|
\"scripts\" directory. Read the INSTALL file for more details.
|
||||||
|
|
||||||
Update, July 2004: you can get a "configure" based distribution
|
Update, July 2004: you can get a "configure" based distribution
|
||||||
from the libpng distribution sites. Download the file
|
from the libpng distribution sites. Download the file
|
||||||
libpng-1.2.6beta4-config.tar.gz
|
libpng-1.2.6rc1-config.tar.gz
|
||||||
"
|
"
|
||||||
|
|
||||||
|
292
libpng.3
292
libpng.3
@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNG 3 "July 28, 2004"
|
.TH LIBPNG 3 "August 4, 2004"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6beta4
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6rc1
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
@ -266,10 +266,18 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6beta4
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fBpng_uint_32 png_get_user_height_max( png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fBpng_uint_32 png_get_user_width_max (png_structp \fIpng_ptr\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP
|
\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@ -650,6 +658,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6beta4
|
|||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
|
|
||||||
|
\fBvoid png_set_user_limits (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIuser_width_max\fP\fB, png_uint_32 \fIuser_height_max\fP\fB);\fP
|
||||||
|
|
||||||
|
\fI\fB
|
||||||
|
|
||||||
\fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP
|
\fBvoid png_set_user_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_transform_ptr\fP\fB, int \fP\fIuser_transform_depth\fP\fB, int \fIuser_transform_channels\fP\fB);\fP
|
||||||
|
|
||||||
\fI\fB
|
\fI\fB
|
||||||
@ -761,7 +773,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.2.6beta4 - July 28, 2004
|
libpng version 1.2.6rc1 - August 4, 2004
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp@users.sourceforge.net>
|
<glennrp@users.sourceforge.net>
|
||||||
Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
@ -1061,6 +1073,28 @@ To inform libpng about your function, use
|
|||||||
|
|
||||||
png_set_read_status_fn(png_ptr, read_row_callback);
|
png_set_read_status_fn(png_ptr, read_row_callback);
|
||||||
|
|
||||||
|
%-%.SS Width and height limits
|
||||||
|
%-%
|
||||||
|
%-%The PNG specification allows the width and height of an image to be as
|
||||||
|
%-%large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
|
||||||
|
%-%Since very few applications really need to process such large images,
|
||||||
|
%-%we have imposed an arbitrary 1-million limit on rows and columns.
|
||||||
|
%-%Larger images will be rejected immediately with a png_error() call. If
|
||||||
|
%-%you wish to override this limit, you can use
|
||||||
|
%-%
|
||||||
|
%-% png_set_user_limits(png_ptr, width_max, height_max);
|
||||||
|
%-%
|
||||||
|
%-%to set your own limits, or use width_max = height_max = 0x7fffffffL
|
||||||
|
%-%to allow all valid dimensions (libpng may reject some very large images
|
||||||
|
%-%anyway because of potential buffer overflow conditions).
|
||||||
|
%-%
|
||||||
|
%-%You should put this statement after you create the PNG structure and
|
||||||
|
%-%before calling png_read_info(), png_read_png(), or png_process_data().
|
||||||
|
%-%If you need to retrieve the limits that are being applied, use
|
||||||
|
%-%
|
||||||
|
%-% width_max = png_get_user_width_max(png_ptr);
|
||||||
|
%-% height_max = png_get_user_height_max(png_ptr);
|
||||||
|
%-%
|
||||||
.SS Unknown-chunk handling
|
.SS Unknown-chunk handling
|
||||||
|
|
||||||
Now you get to set the way the library processes unknown chunks in the
|
Now you get to set the way the library processes unknown chunks in the
|
||||||
@ -1069,7 +1103,7 @@ behavior is that known chunks will be parsed into information in
|
|||||||
various info_ptr members; unknown chunks will be discarded. To change
|
various info_ptr members; unknown chunks will be discarded. To change
|
||||||
this, you can call:
|
this, you can call:
|
||||||
|
|
||||||
png_set_keep_unknown_chunks(png_ptr, info_ptr, keep,
|
png_set_keep_unknown_chunks(png_ptr, keep,
|
||||||
chunk_list, num_chunks);
|
chunk_list, num_chunks);
|
||||||
keep - 0: do not keep
|
keep - 0: do not keep
|
||||||
1: keep only if safe-to-copy
|
1: keep only if safe-to-copy
|
||||||
@ -3420,125 +3454,125 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements
|
|||||||
having level = 0 will be printed. There aren't any such statements in
|
having level = 0 will be printed. There aren't any such statements in
|
||||||
this version of libpng, but if you insert some they will be printed.
|
this version of libpng, but if you insert some they will be printed.
|
||||||
|
|
||||||
.SH VI. Runtime optimization
|
%-%.SH VI. Runtime optimization
|
||||||
|
%-%
|
||||||
A new feature in libpng 1.2.0 is the ability to dynamically switch between
|
%-%A new feature in libpng 1.2.0 is the ability to dynamically switch between
|
||||||
standard and optimized versions of some routines. Currently these are
|
%-%standard and optimized versions of some routines. Currently these are
|
||||||
limited to three computationally intensive tasks when reading PNG files:
|
%-%limited to three computationally intensive tasks when reading PNG files:
|
||||||
decoding row filters, expanding interlacing, and combining interlaced or
|
%-%decoding row filters, expanding interlacing, and combining interlaced or
|
||||||
transparent row data with previous row data. Currently the optimized
|
%-%transparent row data with previous row data. Currently the optimized
|
||||||
versions are available only for x86 (Intel, AMD, etc.) platforms with
|
%-%versions are available only for x86 (Intel, AMD, etc.) platforms with
|
||||||
MMX support, though this may change in future versions. (For example,
|
%-%MMX support, though this may change in future versions. (For example,
|
||||||
the non-MMX assembler optimizations for zlib might become similarly
|
%-%the non-MMX assembler optimizations for zlib might become similarly
|
||||||
runtime-selectable in future releases, in which case libpng could be
|
%-%runtime-selectable in future releases, in which case libpng could be
|
||||||
extended to support them. Alternatively, the compile-time choice of
|
%-%extended to support them. Alternatively, the compile-time choice of
|
||||||
floating-point versus integer routines for gamma correction might become
|
%-%floating-point versus integer routines for gamma correction might become
|
||||||
runtime-selectable.)
|
%-%runtime-selectable.)
|
||||||
|
%-%
|
||||||
Because such optimizations tend to be very platform- and compiler-dependent,
|
%-%Because such optimizations tend to be very platform- and compiler-dependent,
|
||||||
both in how they are written and in how they perform, the new runtime code
|
%-%both in how they are written and in how they perform, the new runtime code
|
||||||
in libpng has been written to allow programs to query, enable, and disable
|
%-%in libpng has been written to allow programs to query, enable, and disable
|
||||||
either specific optimizations or all such optimizations. For example, to
|
%-%either specific optimizations or all such optimizations. For example, to
|
||||||
enable all possible optimizations (bearing in mind that some "optimizations"
|
%-%enable all possible optimizations (bearing in mind that some "optimizations"
|
||||||
may actually run more slowly in rare cases):
|
%-%may actually run more slowly in rare cases):
|
||||||
|
%-%
|
||||||
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||||
png_uint_32 mask, flags;
|
%-% png_uint_32 mask, flags;
|
||||||
|
%-%
|
||||||
flags = png_get_asm_flags(png_ptr);
|
%-% flags = png_get_asm_flags(png_ptr);
|
||||||
mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
|
%-% mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
|
||||||
png_set_asm_flags(png_ptr, flags | mask);
|
%-% png_set_asm_flags(png_ptr, flags | mask);
|
||||||
#endif
|
%-% #endif
|
||||||
|
%-%
|
||||||
To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ
|
%-%To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ
|
||||||
by itself when calling png_get_asm_flagmask(); similarly for optimizing
|
%-%by itself when calling png_get_asm_flagmask(); similarly for optimizing
|
||||||
only writing. To disable all optimizations:
|
%-%only writing. To disable all optimizations:
|
||||||
|
%-%
|
||||||
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||||
flags = png_get_asm_flags(png_ptr);
|
%-% flags = png_get_asm_flags(png_ptr);
|
||||||
mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
|
%-% mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE);
|
||||||
png_set_asm_flags(png_ptr, flags & ~mask);
|
%-% png_set_asm_flags(png_ptr, flags & ~mask);
|
||||||
#endif
|
%-% #endif
|
||||||
|
%-%
|
||||||
To enable or disable only MMX-related features, use png_get_mmx_flagmask()
|
%-%To enable or disable only MMX-related features, use png_get_mmx_flagmask()
|
||||||
in place of png_get_asm_flagmask(). The mmx version takes one additional
|
%-%in place of png_get_asm_flagmask(). The mmx version takes one additional
|
||||||
parameter:
|
%-%parameter:
|
||||||
|
%-%
|
||||||
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||||
int selection = PNG_SELECT_READ | PNG_SELECT_WRITE;
|
%-% int selection = PNG_SELECT_READ | PNG_SELECT_WRITE;
|
||||||
int compilerID;
|
%-% int compilerID;
|
||||||
|
%-%
|
||||||
mask = png_get_mmx_flagmask(selection, &compilerID);
|
%-% mask = png_get_mmx_flagmask(selection, &compilerID);
|
||||||
#endif
|
%-% #endif
|
||||||
|
%-%
|
||||||
On return, compilerID will indicate which version of the MMX assembler
|
%-%On return, compilerID will indicate which version of the MMX assembler
|
||||||
optimizations was compiled. Currently two flavors exist: Microsoft
|
%-%optimizations was compiled. Currently two flavors exist: Microsoft
|
||||||
Visual C++ (compilerID == 1) and GNU C (a.k.a. gcc/gas, compilerID == 2).
|
%-%Visual C++ (compilerID == 1) and GNU C (a.k.a. gcc/gas, compilerID == 2).
|
||||||
On non-x86 platforms or on systems compiled without MMX optimizations, a
|
%-%On non-x86 platforms or on systems compiled without MMX optimizations, a
|
||||||
value of -1 is used.
|
%-%value of -1 is used.
|
||||||
|
%-%
|
||||||
Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return
|
%-%Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return
|
||||||
all valid, settable optimization bits for the version of the library that's
|
%-%all valid, settable optimization bits for the version of the library that's
|
||||||
currently in use. In the case of shared (dynamically linked) libraries,
|
%-%currently in use. In the case of shared (dynamically linked) libraries,
|
||||||
this may include optimizations that did not exist at the time the code was
|
%-%this may include optimizations that did not exist at the time the code was
|
||||||
written and compiled. It is also possible, of course, to enable only known,
|
%-%written and compiled. It is also possible, of course, to enable only known,
|
||||||
specific optimizations; for example:
|
%-%specific optimizations; for example:
|
||||||
|
%-%
|
||||||
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||||
flags = PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
%-% flags = PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||||
| PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
%-% | PNG_ASM_FLAG_MMX_READ_INTERLACE \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_UP \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ;
|
||||||
png_set_asm_flags(png_ptr, flags);
|
%-% png_set_asm_flags(png_ptr, flags);
|
||||||
#endif
|
%-% #endif
|
||||||
|
%-%
|
||||||
This method would enable only the MMX read-optimizations available at the
|
%-%This method would enable only the MMX read-optimizations available at the
|
||||||
time of libpng 1.2.0's release, regardless of whether a later version of
|
%-%time of libpng 1.2.0's release, regardless of whether a later version of
|
||||||
the DLL were actually being used. (Also note that these functions did not
|
%-%the DLL were actually being used. (Also note that these functions did not
|
||||||
exist in versions older than 1.2.0, so any attempt to run a dynamically
|
%-%exist in versions older than 1.2.0, so any attempt to run a dynamically
|
||||||
linked app on such an older version would fail.)
|
%-%linked app on such an older version would fail.)
|
||||||
|
%-%
|
||||||
To determine whether the processor supports MMX instructions at all, use
|
%-%To determine whether the processor supports MMX instructions at all, use
|
||||||
the png_mmx_support() function:
|
%-%the png_mmx_support() function:
|
||||||
|
%-%
|
||||||
#if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200)
|
||||||
mmxsupport = png_mmx_support();
|
%-% mmxsupport = png_mmx_support();
|
||||||
#endif
|
%-% #endif
|
||||||
|
%-%
|
||||||
It returns -1 if MMX support is not compiled into libpng, 0 if MMX code
|
%-%It returns -1 if MMX support is not compiled into libpng, 0 if MMX code
|
||||||
is compiled but MMX is not supported by the processor, or 1 if MMX support
|
%-%is compiled but MMX is not supported by the processor, or 1 if MMX support
|
||||||
is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(),
|
%-%is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(),
|
||||||
and png_get_asm_flagmask() all may be called without allocating and ini-
|
%-%and png_get_asm_flagmask() all may be called without allocating and ini-
|
||||||
tializing any PNG structures (for example, as part of a usage screen or
|
%-%tializing any PNG structures (for example, as part of a usage screen or
|
||||||
"about" box).
|
%-%"about" box).
|
||||||
|
%-%
|
||||||
The following code can be used to prevent an application from using the
|
%-%The following code can be used to prevent an application from using the
|
||||||
thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK
|
%-%thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK
|
||||||
defined:
|
%-%defined:
|
||||||
|
%-%
|
||||||
#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \
|
%-%#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \
|
||||||
&& defined(PNG_THREAD_UNSAFE_OK)
|
%-% && defined(PNG_THREAD_UNSAFE_OK)
|
||||||
/* Disable thread-unsafe features of pnggccrd */
|
%-% /* Disable thread-unsafe features of pnggccrd */
|
||||||
if (png_access_version() >= 10200)
|
%-% if (png_access_version() >= 10200)
|
||||||
{
|
%-% {
|
||||||
png_uint_32 mmx_disable_mask = 0;
|
%-% png_uint_32 mmx_disable_mask = 0;
|
||||||
png_uint_32 asm_flags;
|
%-% png_uint_32 asm_flags;
|
||||||
|
%-%
|
||||||
mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
%-% mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \
|
||||||
| PNG_ASM_FLAG_MMX_READ_FILTER_PAETH );
|
%-% | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH );
|
||||||
asm_flags = png_get_asm_flags(png_ptr);
|
%-% asm_flags = png_get_asm_flags(png_ptr);
|
||||||
png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask);
|
%-% png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask);
|
||||||
}
|
%-% }
|
||||||
#endif
|
%-%#endif
|
||||||
|
%-%
|
||||||
For more extensive examples of runtime querying, enabling and disabling
|
%-%For more extensive examples of runtime querying, enabling and disabling
|
||||||
of optimized features, see contrib/gregbook/readpng2.c in the libpng
|
%-%of optimized features, see contrib/gregbook/readpng2.c in the libpng
|
||||||
source-code distribution.
|
%-%source-code distribution.
|
||||||
|
%-%
|
||||||
.SH VI. MNG support
|
.SH VI. MNG support
|
||||||
|
|
||||||
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
The MNG specification (available at http://www.libpng.org/pub/mng) allows
|
||||||
@ -3615,13 +3649,13 @@ application:
|
|||||||
|
|
||||||
.SH VII. Y2K Compliance in libpng
|
.SH VII. Y2K Compliance in libpng
|
||||||
|
|
||||||
July 28, 2004
|
August 4, 2004
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.6beta4 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.6rc1 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
|
||||||
@ -3761,6 +3795,8 @@ the first widely used release:
|
|||||||
1.0.15 10 10015 10.so.0.1.0.15
|
1.0.15 10 10015 10.so.0.1.0.15
|
||||||
1.2.5 13 10205 12.so.0.1.2.5
|
1.2.5 13 10205 12.so.0.1.2.5
|
||||||
1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
|
1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
|
||||||
|
1.0.16rc1-4 10 10016 10.so.0.1.0.16rc1-4
|
||||||
|
1.2.6rc1-4 13 10206 12.so.0.1.2.6rc1-4
|
||||||
|
|
||||||
Henceforth the source version will match the shared-library minor
|
Henceforth the source version will match the shared-library minor
|
||||||
and patch numbers; the shared-library major version number will be
|
and patch numbers; the shared-library major version number will be
|
||||||
@ -3818,7 +3854,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.2.6beta4 - July 28, 2004:
|
Libpng version 1.2.6rc1 - August 4, 2004:
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (glennrp@users.sourceforge.net).
|
Currently maintained by Glenn Randers-Pehrson (glennrp@users.sourceforge.net).
|
||||||
|
|
||||||
@ -3835,7 +3871,7 @@ included in the libpng distribution, the latter shall prevail.)
|
|||||||
If you modify libpng you may insert additional notices immediately following
|
If you modify libpng you may insert additional notices immediately following
|
||||||
this sentence.
|
this sentence.
|
||||||
|
|
||||||
libpng version 1.2.6, July 28, 2004, is
|
libpng version 1.2.6, August 4, 2004, is
|
||||||
Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
||||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
with the following individuals added to the list of Contributing Authors
|
with the following individuals added to the list of Contributing Authors
|
||||||
@ -3935,7 +3971,7 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp@users.sourceforge.net
|
glennrp@users.sourceforge.net
|
||||||
July 28, 2004
|
August 4, 2004
|
||||||
|
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|
||||||
|
30
libpng.txt
30
libpng.txt
@ -1,6 +1,6 @@
|
|||||||
libpng.txt - A description on how to use and modify libpng
|
libpng.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.2.6beta4 - July 28, 2004
|
libpng version 1.2.6rc1 - August 4, 2004
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp@users.sourceforge.net>
|
<glennrp@users.sourceforge.net>
|
||||||
Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
@ -300,6 +300,28 @@ To inform libpng about your function, use
|
|||||||
|
|
||||||
png_set_read_status_fn(png_ptr, read_row_callback);
|
png_set_read_status_fn(png_ptr, read_row_callback);
|
||||||
|
|
||||||
|
Width and height limits
|
||||||
|
|
||||||
|
The PNG specification allows the width and height of an image to be as
|
||||||
|
large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns.
|
||||||
|
Since very few applications really need to process such large images,
|
||||||
|
we have imposed an arbitrary 1-million limit on rows and columns.
|
||||||
|
Larger images will be rejected immediately with a png_error() call. If
|
||||||
|
you wish to override this limit, you can use
|
||||||
|
|
||||||
|
png_set_user_limits(png_ptr, width_max, height_max);
|
||||||
|
|
||||||
|
to set your own limits, or use width_max = height_max = 0x7fffffffL
|
||||||
|
to allow all valid dimensions (libpng may reject some very large images
|
||||||
|
anyway because of potential buffer overflow conditions).
|
||||||
|
|
||||||
|
You should put this statement after you create the PNG structure and
|
||||||
|
before calling png_read_info(), png_read_png(), or png_process_data().
|
||||||
|
If you need to retrieve the limits that are being applied, use
|
||||||
|
|
||||||
|
width_max = png_get_user_width_max(png_ptr);
|
||||||
|
height_max = png_get_user_height_max(png_ptr);
|
||||||
|
|
||||||
Unknown-chunk handling
|
Unknown-chunk handling
|
||||||
|
|
||||||
Now you get to set the way the library processes unknown chunks in the
|
Now you get to set the way the library processes unknown chunks in the
|
||||||
@ -308,7 +330,7 @@ behavior is that known chunks will be parsed into information in
|
|||||||
various info_ptr members; unknown chunks will be discarded. To change
|
various info_ptr members; unknown chunks will be discarded. To change
|
||||||
this, you can call:
|
this, you can call:
|
||||||
|
|
||||||
png_set_keep_unknown_chunks(png_ptr, info_ptr, keep,
|
png_set_keep_unknown_chunks(png_ptr, keep,
|
||||||
chunk_list, num_chunks);
|
chunk_list, num_chunks);
|
||||||
keep - 0: do not keep
|
keep - 0: do not keep
|
||||||
1: keep only if safe-to-copy
|
1: keep only if safe-to-copy
|
||||||
@ -2854,13 +2876,13 @@ application:
|
|||||||
|
|
||||||
VII. Y2K Compliance in libpng
|
VII. Y2K Compliance in libpng
|
||||||
|
|
||||||
July 28, 2004
|
August 4, 2004
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.2.6beta4 are Y2K compliant. It is my belief that earlier
|
upward through 1.2.6rc1 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
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNGPF 3 "July 28, 2004"
|
.TH LIBPNGPF 3 "August 4, 2004"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6beta4
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6rc1
|
||||||
(private functions)
|
(private functions)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB\fB#include <png.h>\fP\fP
|
\fB\fB#include <png.h>\fP\fP
|
||||||
|
2
png.5
2
png.5
@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "July 28, 2004"
|
.TH PNG 5 "August 4, 2004"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
6
png.c
6
png.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include "png.h"
|
#include "png.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_2_6beta4 Your_png_h_is_not_version_1_2_6beta4;
|
typedef version_1_2_6rc1 Your_png_h_is_not_version_1_2_6rc1;
|
||||||
|
|
||||||
/* 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. */
|
||||||
@ -678,7 +678,7 @@ png_charp PNGAPI
|
|||||||
png_get_copyright(png_structp png_ptr)
|
png_get_copyright(png_structp png_ptr)
|
||||||
{
|
{
|
||||||
if (&png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
if (&png_ptr != NULL) /* silence compiler warning about unused png_ptr */
|
||||||
return ((png_charp) "\n libpng version 1.2.6beta4 - July 28, 2004\n\
|
return ((png_charp) "\n libpng version 1.2.6rc1 - August 4, 2004\n\
|
||||||
Copyright (c) 1998-2004 Glenn Randers-Pehrson\n\
|
Copyright (c) 1998-2004 Glenn Randers-Pehrson\n\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||||
|
47
png.h
47
png.h
@ -1,6 +1,6 @@
|
|||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@ -8,7 +8,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.2.6beta4 - July 28, 2004: Glenn
|
* libpng versions 0.97, January 1998, through 1.2.6rc1 - August 4, 2004: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@ -99,6 +99,8 @@
|
|||||||
* 1.0.15 10 10015 10.so.0.1.0.15
|
* 1.0.15 10 10015 10.so.0.1.0.15
|
||||||
* 1.2.5 13 10205 12.so.0.1.2.5
|
* 1.2.5 13 10205 12.so.0.1.2.5
|
||||||
* 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
|
* 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4
|
||||||
|
* 1.0.16rc1-4 10 10016 10.so.0.1.0.16rc1-4
|
||||||
|
* 1.2.6rc1-4 13 10206 12.so.0.1.2.6rc1-4
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library major
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* and minor numbers; the shared-library major version number will be
|
||||||
@ -128,7 +130,7 @@
|
|||||||
* If you modify libpng you may insert additional notices immediately following
|
* If you modify libpng you may insert additional notices immediately following
|
||||||
* this sentence.
|
* this sentence.
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6, July 28, 2004, is
|
* libpng version 1.2.6, August 4, 2004, is
|
||||||
* Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
* Copyright (c) 2004 Glenn Randers-Pehrson, and is
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individuals added to the list of Contributing Authors
|
* with the following individuals added to the list of Contributing Authors
|
||||||
@ -241,13 +243,13 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* July 28, 2004
|
* August 4, 2004
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* This is your unofficial assurance that libpng from version 0.71 and
|
||||||
* upward through 1.2.6beta4 are Y2K compliant. It is my belief that earlier
|
* upward through 1.2.6rc1 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
|
||||||
@ -303,9 +305,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.2.6beta4"
|
#define PNG_LIBPNG_VER_STRING "1.2.6rc1"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.2.6beta4 - July 28, 2004 (header)\n"
|
" libpng version 1.2.6rc1 - August 4, 2004 (header)\n"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 0
|
#define PNG_LIBPNG_VER_SONUM 0
|
||||||
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
|
#define PNG_LIBPNG_VER_DLLNUM %DLLNUM%
|
||||||
@ -317,7 +319,7 @@
|
|||||||
/* This should match the numeric part of the final component of
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_BUILD 4
|
#define PNG_LIBPNG_VER_BUILD 1
|
||||||
|
|
||||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||||
#define PNG_LIBPNG_BUILD_BETA 2
|
#define PNG_LIBPNG_BUILD_BETA 2
|
||||||
@ -325,7 +327,7 @@
|
|||||||
#define PNG_LIBPNG_BUILD_STABLE 4
|
#define PNG_LIBPNG_BUILD_STABLE 4
|
||||||
#define PNG_LIBPNG_BUILD_TYPEMASK 7
|
#define PNG_LIBPNG_BUILD_TYPEMASK 7
|
||||||
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
|
#define PNG_LIBPNG_BUILD_PATCH 8 /* Can be OR'ed with STABLE only */
|
||||||
#define PNG_LIBPNG_BUILD_TYPE 2
|
#define PNG_LIBPNG_BUILD_TYPE 3
|
||||||
|
|
||||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||||
* We must not include leading zeros.
|
* We must not include leading zeros.
|
||||||
@ -1294,16 +1296,22 @@ struct png_struct_def
|
|||||||
png_bytep palette_to_index; /* which original index points to this */
|
png_bytep palette_to_index; /* which original index points to this */
|
||||||
/* palette color */
|
/* palette color */
|
||||||
#endif
|
#endif
|
||||||
/* New member added in libpng-1.0.16 and 1.2.6 */
|
|
||||||
|
/* New members added in libpng-1.0.16 and 1.2.6 */
|
||||||
png_byte compression_type;
|
png_byte compression_type;
|
||||||
|
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
png_uint_32 user_width_max;
|
||||||
|
png_uint_32 user_height_max;
|
||||||
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||||
* do not agree upon the version number.
|
* do not agree upon the version number.
|
||||||
*/
|
*/
|
||||||
typedef png_structp version_1_2_6beta4;
|
typedef png_structp version_1_2_6rc1;
|
||||||
|
|
||||||
typedef png_struct FAR * FAR * png_structpp;
|
typedef png_struct FAR * FAR * png_structpp;
|
||||||
|
|
||||||
@ -2453,8 +2461,19 @@ extern PNG_EXPORT(int,png_mmx_support) PNGARG((void));
|
|||||||
extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
||||||
png_ptr, png_uint_32 strip_mode));
|
png_ptr, png_uint_32 strip_mode));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PNG_1_0_X */
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
|
/* Added at libpng-1.2.6 */
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
extern PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp
|
||||||
|
png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max));
|
||||||
|
extern PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp
|
||||||
|
png_ptr));
|
||||||
|
extern PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp
|
||||||
|
png_ptr));
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project defs */
|
||||||
|
|
||||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||||
@ -2598,6 +2617,12 @@ extern PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp
|
|||||||
PNG_FLAG_CRC_CRITICAL_MASK)
|
PNG_FLAG_CRC_CRITICAL_MASK)
|
||||||
|
|
||||||
/* save typing and make code easier to understand */
|
/* save typing and make code easier to understand */
|
||||||
|
|
||||||
|
#define PNG_ROWBYTES(pixel_bits, width) \
|
||||||
|
((pixel_bits) >= 8 ? \
|
||||||
|
((width) * (((png_uint_32)(pixel_bits)) >> 3)) : \
|
||||||
|
(( ((width) * ((png_uint_32)(pixel_bits))) + 7) >> 3) )
|
||||||
|
|
||||||
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
|
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
|
||||||
abs((int)((c1).green) - (int)((c2).green)) + \
|
abs((int)((c1).green) - (int)((c2).green)) + \
|
||||||
abs((int)((c1).blue) - (int)((c2).blue)))
|
abs((int)((c1).blue) - (int)((c2).blue)))
|
||||||
|
@ -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.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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) 2002-2004 Glenn Randers-Pehrson
|
* Copyright (c) 2002-2004 Glenn Randers-Pehrson
|
||||||
*
|
*
|
||||||
|
25
pngconf.h
25
pngconf.h
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -669,6 +669,25 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif /* PNG_1_0_X */
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
|
/* Added at libpng-1.2.6 */
|
||||||
|
#if !defined(PNG_1_0_X)
|
||||||
|
#ifndef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED)
|
||||||
|
# define PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
|
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGS no matter
|
||||||
|
* how large, set these limits to 0x7fffffffL
|
||||||
|
*/
|
||||||
|
#ifndef PNG_USER_WIDTH_MAX
|
||||||
|
# define PNG_USER_WIDTH_MAX 1000000L
|
||||||
|
#endif
|
||||||
|
#ifndef PNG_USER_HEIGHT_MAX
|
||||||
|
# define PNG_USER_HEIGHT_MAX 1000000L
|
||||||
|
#endif
|
||||||
|
|
||||||
/* These are currently experimental features, define them if you want */
|
/* These are currently experimental features, define them if you want */
|
||||||
|
|
||||||
/* very little testing */
|
/* very little testing */
|
||||||
@ -683,11 +702,9 @@
|
|||||||
/* This is only for PowerPC big-endian and 680x0 systems */
|
/* This is only for PowerPC big-endian and 680x0 systems */
|
||||||
/* some testing */
|
/* some testing */
|
||||||
/*
|
/*
|
||||||
#ifdef PNG_READ_SUPPORTED
|
#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||||
# ifndef PNG_PNG_READ_BIG_ENDIAN_SUPPORTED
|
|
||||||
# define PNG_READ_BIG_ENDIAN_SUPPORTED
|
# define PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
|
/* Buggy compilers (e.g., gcc 2.7.2.2) need this */
|
||||||
|
18
pngerror.c
18
pngerror.c
@ -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 version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -35,9 +35,9 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
char msg[16];
|
char msg[16];
|
||||||
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))
|
||||||
{
|
{
|
||||||
int offset = 0;
|
|
||||||
if (*error_message == '#')
|
if (*error_message == '#')
|
||||||
{
|
{
|
||||||
|
int offset;
|
||||||
for (offset=1; offset<15; offset++)
|
for (offset=1; offset<15; offset++)
|
||||||
if (*(error_message+offset) == ' ')
|
if (*(error_message+offset) == ' ')
|
||||||
break;
|
break;
|
||||||
@ -190,9 +190,6 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
fprintf(stderr, "libpng error: %s\n", error_message);
|
fprintf(stderr, "libpng error: %s\n", error_message);
|
||||||
#else
|
|
||||||
if (error_message)
|
|
||||||
/* make compiler happy */ ;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
@ -206,10 +203,15 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
|||||||
longjmp(png_ptr->jmpbuf, 1);
|
longjmp(png_ptr->jmpbuf, 1);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
if (png_ptr)
|
|
||||||
/* make compiler happy */ ;
|
/* make compiler happy */ ;
|
||||||
|
if (png_ptr)
|
||||||
PNG_ABORT();
|
PNG_ABORT();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef PNG_NO_CONSOLE_IO
|
||||||
|
/* make compiler happy */ ;
|
||||||
|
if (&error_message != NULL)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called when there is a warning, but the library thinks
|
/* This function is called when there is a warning, but the library thinks
|
||||||
@ -245,9 +247,11 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
|||||||
# endif
|
# endif
|
||||||
fprintf(stderr, "libpng warning: %s\n", warning_message);
|
fprintf(stderr, "libpng warning: %s\n", warning_message);
|
||||||
#else
|
#else
|
||||||
|
/* make compiler happy */ ;
|
||||||
if (warning_message)
|
if (warning_message)
|
||||||
/* appease compiler */ ;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
/* make compiler happy */ ;
|
||||||
if (png_ptr)
|
if (png_ptr)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -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 version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
@ -428,7 +428,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
{
|
{
|
||||||
png_debug(2,"mask == 0xff: doing single png_memcpy()\n");
|
png_debug(2,"mask == 0xff: doing single png_memcpy()\n");
|
||||||
png_memcpy(row, png_ptr->row_buf + 1,
|
png_memcpy(row, png_ptr->row_buf + 1,
|
||||||
(png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3));
|
(png_size_t)PNG_ROWBYTES(png_ptr->row_info.pixel_depth,png_ptr->width));
|
||||||
}
|
}
|
||||||
else /* (png_combine_row() is never called with mask == 0) */
|
else /* (png_combine_row() is never called with mask == 0) */
|
||||||
{
|
{
|
||||||
@ -2733,8 +2733,8 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
} /* end switch (row_info->pixel_depth) */
|
} /* end switch (row_info->pixel_depth) */
|
||||||
|
|
||||||
row_info->width = final_width;
|
row_info->width = final_width;
|
||||||
row_info->rowbytes = ((final_width *
|
|
||||||
(png_uint_32)row_info->pixel_depth + 7) >> 3);
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
} /* end png_do_read_interlace() */
|
} /* end png_do_read_interlace() */
|
||||||
|
43
pngget.c
43
pngget.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngget.c - retrieval of values from info struct
|
/* pngget.c - retrieval of values from info struct
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -540,9 +540,6 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&
|
if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL &&
|
||||||
bit_depth != NULL && color_type != NULL)
|
bit_depth != NULL && color_type != NULL)
|
||||||
{
|
{
|
||||||
int pixel_depth, channels;
|
|
||||||
png_uint_32 rowbytes_per_pixel;
|
|
||||||
|
|
||||||
png_debug1(1, "in %s retrieval function\n", "IHDR");
|
png_debug1(1, "in %s retrieval function\n", "IHDR");
|
||||||
*width = info_ptr->width;
|
*width = info_ptr->width;
|
||||||
*height = info_ptr->height;
|
*height = info_ptr->height;
|
||||||
@ -560,23 +557,18 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
*interlace_type = info_ptr->interlace_type;
|
*interlace_type = info_ptr->interlace_type;
|
||||||
|
|
||||||
/* check for potential overflow of rowbytes */
|
/* check for potential overflow of rowbytes */
|
||||||
if (*color_type == PNG_COLOR_TYPE_PALETTE)
|
|
||||||
channels = 1;
|
|
||||||
else if (*color_type & PNG_COLOR_MASK_COLOR)
|
|
||||||
channels = 3;
|
|
||||||
else
|
|
||||||
channels = 1;
|
|
||||||
if (*color_type & PNG_COLOR_MASK_ALPHA)
|
|
||||||
channels++;
|
|
||||||
pixel_depth = *bit_depth * channels;
|
|
||||||
rowbytes_per_pixel = (pixel_depth + 7) >> 3;
|
|
||||||
if (width == 0 || *width > PNG_UINT_31_MAX)
|
if (width == 0 || *width > PNG_UINT_31_MAX)
|
||||||
png_error(png_ptr, "Invalid image width");
|
png_error(png_ptr, "Invalid image width");
|
||||||
if (height == 0 || *height > PNG_UINT_31_MAX)
|
if (height == 0 || *height > PNG_UINT_31_MAX)
|
||||||
png_error(png_ptr, "Invalid image height");
|
png_error(png_ptr, "Invalid image height");
|
||||||
if (*width > PNG_UINT_32_MAX/rowbytes_per_pixel - 64)
|
if (info_ptr->width > (PNG_UINT_32_MAX
|
||||||
|
>> 3) /* 8-byte RGBA pixels */
|
||||||
|
- 64 /* bigrowbuf hack */
|
||||||
|
- 1 /* filter byte */
|
||||||
|
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||||
|
- 8) /* extra max_pixel_depth pad */
|
||||||
{
|
{
|
||||||
png_error(png_ptr,
|
png_warning(png_ptr,
|
||||||
"Width too large for libpng to process image data.");
|
"Width too large for libpng to process image data.");
|
||||||
}
|
}
|
||||||
return (1);
|
return (1);
|
||||||
@ -923,5 +915,20 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
|
return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
|
||||||
}
|
}
|
||||||
#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
|
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||||
#endif /* PNG_1_0_X */
|
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
/* these functions were added to libpng 1.2.6 */
|
||||||
|
png_uint_32 PNGAPI
|
||||||
|
png_get_user_width_max (png_structp png_ptr)
|
||||||
|
{
|
||||||
|
return (png_ptr? png_ptr->user_width_max : 0);
|
||||||
|
}
|
||||||
|
png_uint_32 PNGAPI
|
||||||
|
png_get_user_height_max (png_structp png_ptr)
|
||||||
|
{
|
||||||
|
return (png_ptr? png_ptr->user_height_max : 0);
|
||||||
|
}
|
||||||
|
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
|
||||||
|
|
||||||
|
#endif /* ?PNG_1_0_X */
|
||||||
|
7
pngmem.c
7
pngmem.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngmem.c - stub functions for memory allocation
|
/* pngmem.c - stub functions for memory allocation
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -423,10 +423,10 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
|||||||
{
|
{
|
||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
|
|
||||||
|
#ifdef PNG_USER_MEM_SUPPORTED
|
||||||
if (png_ptr == NULL || size == 0)
|
if (png_ptr == NULL || size == 0)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
#ifdef PNG_USER_MEM_SUPPORTED
|
|
||||||
if(png_ptr->malloc_fn != NULL)
|
if(png_ptr->malloc_fn != NULL)
|
||||||
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
|
ret = ((png_voidp)(*(png_ptr->malloc_fn))(png_ptr, (png_size_t)size));
|
||||||
else
|
else
|
||||||
@ -442,6 +442,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
|||||||
png_voidp ret;
|
png_voidp ret;
|
||||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||||
|
|
||||||
|
if (png_ptr == NULL || size == 0)
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
#ifdef PNG_MAX_MALLOC_64K
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
if (size > (png_uint_32)65536L)
|
if (size > (png_uint_32)65536L)
|
||||||
{
|
{
|
||||||
|
10
pngpread.c
10
pngpread.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -782,8 +782,8 @@ png_push_process_row(png_structp png_ptr)
|
|||||||
png_ptr->row_info.bit_depth = png_ptr->bit_depth;
|
png_ptr->row_info.bit_depth = png_ptr->bit_depth;
|
||||||
png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
|
png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
|
||||||
|
|
||||||
png_ptr->row_info.rowbytes = ((png_ptr->row_info.width *
|
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||||
(png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3);
|
png_ptr->row_info.width);
|
||||||
|
|
||||||
png_read_filter_row(png_ptr, &(png_ptr->row_info),
|
png_read_filter_row(png_ptr, &(png_ptr->row_info),
|
||||||
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
|
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
|
||||||
@ -1008,8 +1008,8 @@ png_read_push_finish_row(png_structp png_ptr)
|
|||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
|
|
||||||
png_ptr->irowbytes = ((png_ptr->iwidth *
|
png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
|
||||||
png_ptr->pixel_depth + 7) >> 3) + 1;
|
png_ptr->iwidth);
|
||||||
|
|
||||||
if (png_ptr->transformations & PNG_INTERLACE)
|
if (png_ptr->transformations & PNG_INTERLACE)
|
||||||
break;
|
break;
|
||||||
|
60
pngread.c
60
pngread.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -59,6 +59,12 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
#endif
|
#endif
|
||||||
#endif /* PNG_1_0_X */
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
|
/* added at libpng-1.2.6 */
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
|
||||||
|
png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
if (setjmp(jmpbuf))
|
if (setjmp(jmpbuf))
|
||||||
@ -266,6 +272,12 @@ png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
|
png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof (jmp_buf));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* added at libpng-1.2.6 */
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
|
||||||
|
png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* initialize zbuf - compression buffer */
|
/* initialize zbuf - compression buffer */
|
||||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||||
@ -712,8 +724,8 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
png_ptr->row_info.channels = png_ptr->channels;
|
png_ptr->row_info.channels = png_ptr->channels;
|
||||||
png_ptr->row_info.bit_depth = png_ptr->bit_depth;
|
png_ptr->row_info.bit_depth = png_ptr->bit_depth;
|
||||||
png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
|
png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
|
||||||
png_ptr->row_info.rowbytes = ((png_ptr->row_info.width *
|
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||||
(png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3);
|
png_ptr->row_info.width);
|
||||||
|
|
||||||
if(png_ptr->row_buf[0])
|
if(png_ptr->row_buf[0])
|
||||||
png_read_filter_row(png_ptr, &(png_ptr->row_info),
|
png_read_filter_row(png_ptr, &(png_ptr->row_info),
|
||||||
@ -791,7 +803,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.2.6beta4
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.6rc1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
@ -841,7 +853,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.2.6beta4
|
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.6rc1
|
||||||
*/
|
*/
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_image(png_structp png_ptr, png_bytepp image)
|
png_read_image(png_structp png_ptr, png_bytepp image)
|
||||||
@ -1071,8 +1083,8 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
|||||||
png_structp png_ptr = NULL;
|
png_structp png_ptr = NULL;
|
||||||
png_infop info_ptr = NULL, end_info_ptr = NULL;
|
png_infop info_ptr = NULL, end_info_ptr = NULL;
|
||||||
#ifdef PNG_USER_MEM_SUPPORTED
|
#ifdef PNG_USER_MEM_SUPPORTED
|
||||||
png_free_ptr free_fn = NULL;
|
png_free_ptr free_fn;
|
||||||
png_voidp mem_ptr = NULL;
|
png_voidp mem_ptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
png_debug(1, "in png_destroy_read_struct\n");
|
png_debug(1, "in png_destroy_read_struct\n");
|
||||||
@ -1295,34 +1307,38 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
int row;
|
int row;
|
||||||
|
|
||||||
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
|
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
|
||||||
/* invert the alpha channel from opacity to transparency */
|
/* invert the alpha channel from opacity to transparency
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
|
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
|
||||||
png_set_invert_alpha(png_ptr);
|
png_set_invert_alpha(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The call to png_read_info() gives us all of the information from the
|
/* png_read_info() gives us all of the information from the
|
||||||
* PNG file before the first IDAT (image data chunk).
|
* PNG file before the first IDAT (image data chunk).
|
||||||
*/
|
*/
|
||||||
png_read_info(png_ptr, info_ptr);
|
png_read_info(png_ptr, info_ptr);
|
||||||
|
if (info_ptr->height > PNG_UINT_32_MAX/png_sizeof(png_bytep))
|
||||||
|
png_error(png_ptr,"Image is too high to process with png_read_png()");
|
||||||
|
|
||||||
/* -------------- image transformations start here ------------------- */
|
/* -------------- image transformations start here ------------------- */
|
||||||
|
|
||||||
#if defined(PNG_READ_16_TO_8_SUPPORTED)
|
#if defined(PNG_READ_16_TO_8_SUPPORTED)
|
||||||
/* tell libpng to strip 16 bit/color files down to 8 bits/color */
|
/* tell libpng to strip 16 bit/color files down to 8 bits per color
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_STRIP_16)
|
if (transforms & PNG_TRANSFORM_STRIP_16)
|
||||||
png_set_strip_16(png_ptr);
|
png_set_strip_16(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
#if defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
||||||
/* Strip alpha bytes from the input data without combining with the
|
/* Strip alpha bytes from the input data without combining with
|
||||||
* background (not recommended).
|
* the background (not recommended).
|
||||||
*/
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_STRIP_ALPHA)
|
if (transforms & PNG_TRANSFORM_STRIP_ALPHA)
|
||||||
png_set_strip_alpha(png_ptr);
|
png_set_strip_alpha(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED)
|
#if defined(PNG_READ_PACK_SUPPORTED) && !defined(PNG_READ_EXPAND_SUPPORTED)
|
||||||
/* Extract multiple pixels with bit depths of 1, 2, and 4 from a single
|
/* Extract multiple pixels with bit depths of 1, 2, or 4 from a single
|
||||||
* byte into separate bytes (useful for paletted and grayscale images).
|
* byte into separate bytes (useful for paletted and grayscale images).
|
||||||
*/
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_PACKING)
|
if (transforms & PNG_TRANSFORM_PACKING)
|
||||||
@ -1331,7 +1347,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
|
|
||||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
|
#if defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||||
/* Change the order of packed pixels to least significant bit first
|
/* Change the order of packed pixels to least significant bit first
|
||||||
* (not useful if you are using png_set_packing). */
|
* (not useful if you are using png_set_packing).
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_PACKSWAP)
|
if (transforms & PNG_TRANSFORM_PACKSWAP)
|
||||||
png_set_packswap(png_ptr);
|
png_set_packswap(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
@ -1349,10 +1366,12 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
png_set_expand(png_ptr);
|
png_set_expand(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We don't handle background color or gamma transformation or dithering. */
|
/* We don't handle background color or gamma transformation or dithering.
|
||||||
|
*/
|
||||||
|
|
||||||
#if defined(PNG_READ_INVERT_SUPPORTED)
|
#if defined(PNG_READ_INVERT_SUPPORTED)
|
||||||
/* invert monochrome files to have 0 as white and 1 as black */
|
/* invert monochrome files to have 0 as white and 1 as black
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_INVERT_MONO)
|
if (transforms & PNG_TRANSFORM_INVERT_MONO)
|
||||||
png_set_invert_mono(png_ptr);
|
png_set_invert_mono(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
@ -1373,19 +1392,22 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_BGR_SUPPORTED)
|
#if defined(PNG_READ_BGR_SUPPORTED)
|
||||||
/* flip the RGB pixels to BGR (or RGBA to BGRA) */
|
/* flip the RGB pixels to BGR (or RGBA to BGRA)
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_BGR)
|
if (transforms & PNG_TRANSFORM_BGR)
|
||||||
png_set_bgr(png_ptr);
|
png_set_bgr(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
|
#if defined(PNG_READ_SWAP_ALPHA_SUPPORTED)
|
||||||
/* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR) */
|
/* swap the RGBA or GA data to ARGB or AG (or BGRA to ABGR)
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_SWAP_ALPHA)
|
if (transforms & PNG_TRANSFORM_SWAP_ALPHA)
|
||||||
png_set_swap_alpha(png_ptr);
|
png_set_swap_alpha(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PNG_READ_SWAP_SUPPORTED)
|
#if defined(PNG_READ_SWAP_SUPPORTED)
|
||||||
/* swap bytes of 16 bit files to least significant byte first */
|
/* swap bytes of 16 bit files to least significant byte first
|
||||||
|
*/
|
||||||
if (transforms & PNG_TRANSFORM_SWAP_ENDIAN)
|
if (transforms & PNG_TRANSFORM_SWAP_ENDIAN)
|
||||||
png_set_swap(png_ptr);
|
png_set_swap(png_ptr);
|
||||||
#endif
|
#endif
|
||||||
|
2
pngrio.c
2
pngrio.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
31
pngrtran.c
31
pngrtran.c
@ -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 version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -1151,7 +1151,8 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
|||||||
|
|
||||||
info_ptr->pixel_depth = (png_byte)(info_ptr->channels *
|
info_ptr->pixel_depth = (png_byte)(info_ptr->channels *
|
||||||
info_ptr->bit_depth);
|
info_ptr->bit_depth);
|
||||||
info_ptr->rowbytes = ((info_ptr->width * info_ptr->pixel_depth + 7) >> 3);
|
|
||||||
|
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,info_ptr->width);
|
||||||
|
|
||||||
#if !defined(PNG_READ_EXPAND_SUPPORTED)
|
#if !defined(PNG_READ_EXPAND_SUPPORTED)
|
||||||
if(png_ptr)
|
if(png_ptr)
|
||||||
@ -1382,8 +1383,8 @@ From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
|||||||
#endif
|
#endif
|
||||||
png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
|
png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
|
||||||
png_ptr->row_info.channels);
|
png_ptr->row_info.channels);
|
||||||
png_ptr->row_info.rowbytes = (png_ptr->row_info.width *
|
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||||
png_ptr->row_info.pixel_depth+7)>>3;
|
png_ptr->row_info.width);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2089,8 +2090,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
|||||||
row_info->color_type |= PNG_COLOR_MASK_COLOR;
|
row_info->color_type |= PNG_COLOR_MASK_COLOR;
|
||||||
row_info->pixel_depth = (png_byte)(row_info->channels *
|
row_info->pixel_depth = (png_byte)(row_info->channels *
|
||||||
row_info->bit_depth);
|
row_info->bit_depth);
|
||||||
row_info->rowbytes = ((row_width *
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2343,8 +2343,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
row_info->color_type &= ~PNG_COLOR_MASK_COLOR;
|
row_info->color_type &= ~PNG_COLOR_MASK_COLOR;
|
||||||
row_info->pixel_depth = (png_byte)(row_info->channels *
|
row_info->pixel_depth = (png_byte)(row_info->channels *
|
||||||
row_info->bit_depth);
|
row_info->bit_depth);
|
||||||
row_info->rowbytes = ((row_width *
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
return rgb_error;
|
return rgb_error;
|
||||||
}
|
}
|
||||||
@ -3262,8 +3261,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
|||||||
row_info->channels--;
|
row_info->channels--;
|
||||||
row_info->pixel_depth = (png_byte)(row_info->channels *
|
row_info->pixel_depth = (png_byte)(row_info->channels *
|
||||||
row_info->bit_depth);
|
row_info->bit_depth);
|
||||||
row_info->rowbytes = ((row_width *
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3737,8 +3735,8 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
|
row_info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
|
||||||
row_info->channels = 2;
|
row_info->channels = 2;
|
||||||
row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1);
|
row_info->pixel_depth = (png_byte)(row_info->bit_depth << 1);
|
||||||
row_info->rowbytes =
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
|
||||||
((row_width * row_info->pixel_depth) >> 3);
|
row_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value)
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB && trans_value)
|
||||||
@ -3792,8 +3790,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
row_info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||||
row_info->channels = 4;
|
row_info->channels = 4;
|
||||||
row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2);
|
row_info->pixel_depth = (png_byte)(row_info->bit_depth << 2);
|
||||||
row_info->rowbytes =
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
((row_width * row_info->pixel_depth) >> 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3846,8 +3843,7 @@ png_do_dither(png_row_infop row_info, png_bytep row,
|
|||||||
row_info->color_type = PNG_COLOR_TYPE_PALETTE;
|
row_info->color_type = PNG_COLOR_TYPE_PALETTE;
|
||||||
row_info->channels = 1;
|
row_info->channels = 1;
|
||||||
row_info->pixel_depth = row_info->bit_depth;
|
row_info->pixel_depth = row_info->bit_depth;
|
||||||
row_info->rowbytes =
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
((row_width * row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA &&
|
||||||
palette_lookup != NULL && row_info->bit_depth == 8)
|
palette_lookup != NULL && row_info->bit_depth == 8)
|
||||||
@ -3876,8 +3872,7 @@ png_do_dither(png_row_infop row_info, png_bytep row,
|
|||||||
row_info->color_type = PNG_COLOR_TYPE_PALETTE;
|
row_info->color_type = PNG_COLOR_TYPE_PALETTE;
|
||||||
row_info->channels = 1;
|
row_info->channels = 1;
|
||||||
row_info->pixel_depth = row_info->bit_depth;
|
row_info->pixel_depth = row_info->bit_depth;
|
||||||
row_info->rowbytes =
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,row_width);
|
||||||
((row_width * row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
|
else if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
|
||||||
dither_lookup && row_info->bit_depth == 8)
|
dither_lookup && row_info->bit_depth == 8)
|
||||||
|
134
pngrutil.c
134
pngrutil.c
@ -1,6 +1,6 @@
|
|||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -394,8 +394,7 @@ png_handle_IHDR(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* set up other useful info */
|
/* set up other useful info */
|
||||||
png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth *
|
png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth *
|
||||||
png_ptr->channels);
|
png_ptr->channels);
|
||||||
png_ptr->rowbytes = ((png_ptr->width *
|
png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width);
|
||||||
(png_uint_32)png_ptr->pixel_depth + 7) >> 3);
|
|
||||||
png_debug1(3,"bit_depth = %d\n", png_ptr->bit_depth);
|
png_debug1(3,"bit_depth = %d\n", png_ptr->bit_depth);
|
||||||
png_debug1(3,"channels = %d\n", png_ptr->channels);
|
png_debug1(3,"channels = %d\n", png_ptr->channels);
|
||||||
png_debug1(3,"rowbytes = %lu\n", png_ptr->rowbytes);
|
png_debug1(3,"rowbytes = %lu\n", png_ptr->rowbytes);
|
||||||
@ -550,8 +549,6 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
|
if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT))
|
||||||
{
|
{
|
||||||
png_error(png_ptr, "No image in file");
|
png_error(png_ptr, "No image in file");
|
||||||
|
|
||||||
info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);
|
png_ptr->mode |= (PNG_AFTER_IDAT | PNG_HAVE_IEND);
|
||||||
@ -561,6 +558,9 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_warning(png_ptr, "Incorrect IEND chunk length");
|
png_warning(png_ptr, "Incorrect IEND chunk length");
|
||||||
}
|
}
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
|
|
||||||
|
if (&info_ptr == NULL) /* quiet compiler warnings about unused info_ptr */
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_READ_gAMA_SUPPORTED)
|
#if defined(PNG_READ_gAMA_SUPPORTED)
|
||||||
@ -587,7 +587,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Should be an error, but we can cope with it */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Out of place gAMA chunk");
|
png_warning(png_ptr, "Out of place gAMA chunk");
|
||||||
|
|
||||||
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
|
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA)
|
||||||
#if defined(PNG_READ_sRGB_SUPPORTED)
|
#if defined(PNG_READ_sRGB_SUPPORTED)
|
||||||
&& !(info_ptr->valid & PNG_INFO_sRGB)
|
&& !(info_ptr->valid & PNG_INFO_sRGB)
|
||||||
#endif
|
#endif
|
||||||
@ -668,7 +668,7 @@ png_handle_sBIT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Should be an error, but we can cope with it */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Out of place sBIT chunk");
|
png_warning(png_ptr, "Out of place sBIT chunk");
|
||||||
}
|
}
|
||||||
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT))
|
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT))
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Duplicate sBIT chunk");
|
png_warning(png_ptr, "Duplicate sBIT chunk");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
@ -737,7 +737,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Should be an error, but we can cope with it */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Missing PLTE before cHRM");
|
png_warning(png_ptr, "Missing PLTE before cHRM");
|
||||||
|
|
||||||
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)
|
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)
|
||||||
#if defined(PNG_READ_sRGB_SUPPORTED)
|
#if defined(PNG_READ_sRGB_SUPPORTED)
|
||||||
&& !(info_ptr->valid & PNG_INFO_sRGB)
|
&& !(info_ptr->valid & PNG_INFO_sRGB)
|
||||||
#endif
|
#endif
|
||||||
@ -899,7 +899,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Should be an error, but we can cope with it */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Out of place sRGB chunk");
|
png_warning(png_ptr, "Out of place sRGB chunk");
|
||||||
|
|
||||||
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
|
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB))
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Duplicate sRGB chunk");
|
png_warning(png_ptr, "Duplicate sRGB chunk");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
@ -1002,7 +1002,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
/* Should be an error, but we can cope with it */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Out of place iCCP chunk");
|
png_warning(png_ptr, "Out of place iCCP chunk");
|
||||||
|
|
||||||
else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP))
|
if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP))
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Duplicate iCCP chunk");
|
png_warning(png_ptr, "Duplicate iCCP chunk");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
@ -1160,8 +1160,9 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_palette.nentries = data_length / entry_size;
|
new_palette.nentries = (png_uint_32) (data_length / entry_size);
|
||||||
if (new_palette.nentries > PNG_SIZE_MAX / png_sizeof(png_sPLT_entry))
|
if ((png_uint_32) new_palette.nentries > (png_uint_32) (PNG_SIZE_MAX /
|
||||||
|
png_sizeof(png_sPLT_entry)))
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "sPLT chunk too long");
|
png_warning(png_ptr, "sPLT chunk too long");
|
||||||
return;
|
return;
|
||||||
@ -1251,49 +1252,9 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
|
||||||
{
|
{
|
||||||
if (!(png_ptr->mode & PNG_HAVE_PLTE))
|
png_byte buf[2];
|
||||||
{
|
|
||||||
/* Should be an error, but we can cope with it */
|
|
||||||
png_warning(png_ptr, "Missing PLTE before tRNS");
|
|
||||||
}
|
|
||||||
else if (length > (png_uint_32)png_ptr->num_palette)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Incorrect tRNS chunk length");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (length == 0)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Zero length tRNS chunk");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
png_crc_read(png_ptr, readbuf, (png_size_t)length);
|
|
||||||
png_ptr->num_trans = (png_uint_16)length;
|
|
||||||
}
|
|
||||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
{
|
|
||||||
png_byte buf[6];
|
|
||||||
|
|
||||||
if (length != 6)
|
|
||||||
{
|
|
||||||
png_warning(png_ptr, "Incorrect tRNS chunk length");
|
|
||||||
png_crc_finish(png_ptr, length);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
png_crc_read(png_ptr, buf, (png_size_t)length);
|
|
||||||
png_ptr->num_trans = 1;
|
|
||||||
png_ptr->trans_values.red = png_get_uint_16(buf);
|
|
||||||
png_ptr->trans_values.green = png_get_uint_16(buf + 2);
|
|
||||||
png_ptr->trans_values.blue = png_get_uint_16(buf + 4);
|
|
||||||
}
|
|
||||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_GRAY)
|
|
||||||
{
|
|
||||||
png_byte buf[6];
|
|
||||||
|
|
||||||
if (length != 2)
|
if (length != 2)
|
||||||
{
|
{
|
||||||
@ -1306,6 +1267,45 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_ptr->num_trans = 1;
|
png_ptr->num_trans = 1;
|
||||||
png_ptr->trans_values.gray = png_get_uint_16(buf);
|
png_ptr->trans_values.gray = png_get_uint_16(buf);
|
||||||
}
|
}
|
||||||
|
else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
|
{
|
||||||
|
png_byte buf[6];
|
||||||
|
|
||||||
|
if (length != 6)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Incorrect tRNS chunk length");
|
||||||
|
png_crc_finish(png_ptr, length);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
png_crc_read(png_ptr, buf, (png_size_t)length);
|
||||||
|
png_ptr->num_trans = 1;
|
||||||
|
png_ptr->trans_values.red = png_get_uint_16(buf);
|
||||||
|
png_ptr->trans_values.green = png_get_uint_16(buf + 2);
|
||||||
|
png_ptr->trans_values.blue = png_get_uint_16(buf + 4);
|
||||||
|
}
|
||||||
|
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
|
{
|
||||||
|
if (!(png_ptr->mode & PNG_HAVE_PLTE))
|
||||||
|
{
|
||||||
|
/* Should be an error, but we can cope with it. */
|
||||||
|
png_warning(png_ptr, "Missing PLTE before tRNS");
|
||||||
|
}
|
||||||
|
if (length > (png_uint_32)png_ptr->num_palette ||
|
||||||
|
length > PNG_MAX_PALETTE_LENGTH)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Incorrect tRNS chunk length");
|
||||||
|
png_crc_finish(png_ptr, length);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (length == 0)
|
||||||
|
{
|
||||||
|
png_warning(png_ptr, "Zero length tRNS chunk");
|
||||||
|
png_crc_finish(png_ptr, length);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
png_crc_read(png_ptr, readbuf, (png_size_t)length);
|
||||||
|
png_ptr->num_trans = (png_uint_16)length;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "tRNS chunk not allowed with alpha channel");
|
png_warning(png_ptr, "tRNS chunk not allowed with alpha channel");
|
||||||
@ -1441,7 +1441,8 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
num = length / 2 ;
|
num = length / 2 ;
|
||||||
if (num != png_ptr->num_palette || num > PNG_MAX_PALETTE_LENGTH)
|
if (num != (unsigned int) png_ptr->num_palette || num >
|
||||||
|
(unsigned int) PNG_MAX_PALETTE_LENGTH)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Incorrect hIST chunk length");
|
png_warning(png_ptr, "Incorrect hIST chunk length");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
@ -2213,7 +2214,8 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
|||||||
png_crc_finish(png_ptr, skip);
|
png_crc_finish(png_ptr, skip);
|
||||||
|
|
||||||
#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED)
|
#if !defined(PNG_READ_USER_CHUNKS_SUPPORTED)
|
||||||
info_ptr = info_ptr; /* quiet compiler warnings about unused info_ptr */
|
if (&info_ptr == NULL) /* quiet compiler warnings about unused info_ptr */
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2254,8 +2256,7 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
if (mask == 0xff)
|
if (mask == 0xff)
|
||||||
{
|
{
|
||||||
png_memcpy(row, png_ptr->row_buf + 1,
|
png_memcpy(row, png_ptr->row_buf + 1,
|
||||||
(png_size_t)((png_ptr->width *
|
PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->width));
|
||||||
png_ptr->row_info.pixel_depth + 7) >> 3));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2670,11 +2671,11 @@ png_do_read_interlace(png_structp png_ptr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
row_info->width = final_width;
|
row_info->width = final_width;
|
||||||
row_info->rowbytes = ((final_width *
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width);
|
||||||
(png_uint_32)row_info->pixel_depth + 7) >> 3);
|
|
||||||
}
|
}
|
||||||
#if !defined(PNG_READ_PACKSWAP_SUPPORTED)
|
#if !defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||||
transformations = transformations; /* silence compiler warning */
|
if (&transformations == NULL) /* silence compiler warning */
|
||||||
|
return;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */
|
#endif /* !PNG_HAVE_ASSEMBLER_READ_INTERLACE */
|
||||||
@ -2842,8 +2843,9 @@ png_read_finish_row(png_structp png_ptr)
|
|||||||
png_pass_inc[png_ptr->pass] - 1 -
|
png_pass_inc[png_ptr->pass] - 1 -
|
||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
png_ptr->irowbytes = ((png_ptr->iwidth *
|
|
||||||
(png_uint_32)png_ptr->pixel_depth + 7) >> 3) +1;
|
png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
|
||||||
|
png_ptr->iwidth) + 1;
|
||||||
|
|
||||||
if (!(png_ptr->transformations & PNG_INTERLACE))
|
if (!(png_ptr->transformations & PNG_INTERLACE))
|
||||||
{
|
{
|
||||||
@ -2969,8 +2971,8 @@ png_read_start_row(png_structp png_ptr)
|
|||||||
png_pass_start[png_ptr->pass]) /
|
png_pass_start[png_ptr->pass]) /
|
||||||
png_pass_inc[png_ptr->pass];
|
png_pass_inc[png_ptr->pass];
|
||||||
|
|
||||||
row_bytes = ((png_ptr->iwidth *
|
row_bytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->iwidth) + 1;
|
||||||
(png_uint_32)png_ptr->pixel_depth + 7) >> 3) +1;
|
|
||||||
png_ptr->irowbytes = (png_size_t)row_bytes;
|
png_ptr->irowbytes = (png_size_t)row_bytes;
|
||||||
if((png_uint_32)png_ptr->irowbytes != row_bytes)
|
if((png_uint_32)png_ptr->irowbytes != row_bytes)
|
||||||
png_error(png_ptr, "Rowbytes overflow in png_read_start_row");
|
png_error(png_ptr, "Rowbytes overflow in png_read_start_row");
|
||||||
@ -3088,7 +3090,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
|||||||
row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7));
|
row_bytes = ((png_ptr->width + 7) & ~((png_uint_32)7));
|
||||||
/* calculate the maximum bytes needed, adding a byte and a pixel
|
/* calculate the maximum bytes needed, adding a byte and a pixel
|
||||||
for safety's sake */
|
for safety's sake */
|
||||||
row_bytes = ((row_bytes * (png_uint_32)max_pixel_depth + 7) >> 3) +
|
row_bytes = PNG_ROWBYTES(max_pixel_depth,row_bytes) +
|
||||||
1 + ((max_pixel_depth + 7) >> 3);
|
1 + ((max_pixel_depth + 7) >> 3);
|
||||||
#ifdef PNG_MAX_MALLOC_64K
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
if (row_bytes > (png_uint_32)65536L)
|
if (row_bytes > (png_uint_32)65536L)
|
||||||
|
49
pngset.c
49
pngset.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -247,7 +247,6 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
int color_type, int interlace_type, int compression_type,
|
int color_type, int interlace_type, int compression_type,
|
||||||
int filter_type)
|
int filter_type)
|
||||||
{
|
{
|
||||||
int rowbytes_per_pixel;
|
|
||||||
png_debug1(1, "in %s storage function\n", "IHDR");
|
png_debug1(1, "in %s storage function\n", "IHDR");
|
||||||
if (png_ptr == NULL || info_ptr == NULL)
|
if (png_ptr == NULL || info_ptr == NULL)
|
||||||
return;
|
return;
|
||||||
@ -255,8 +254,22 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
/* check for width and height valid values */
|
/* check for width and height valid values */
|
||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
png_error(png_ptr, "Image width or height is zero in IHDR");
|
png_error(png_ptr, "Image width or height is zero in IHDR");
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
if (width > png_ptr->user_width_max || height > png_ptr->user_height_max)
|
||||||
|
png_error(png_ptr, "image size exceeds user limits in IHDR");
|
||||||
|
#else
|
||||||
|
if (width > PNG_USER_WIDTH_MAX || height > PNG_USER_HEIGHT_MAX)
|
||||||
|
png_error(png_ptr, "image size exceeds user limits in IHDR");
|
||||||
|
#endif
|
||||||
if (width > PNG_UINT_31_MAX || height > PNG_UINT_31_MAX)
|
if (width > PNG_UINT_31_MAX || height > PNG_UINT_31_MAX)
|
||||||
png_error(png_ptr, "Invalid image size in IHDR");
|
png_error(png_ptr, "Invalid image size in IHDR");
|
||||||
|
if ( width > (PNG_UINT_32_MAX
|
||||||
|
>> 3) /* 8-byte RGBA pixels */
|
||||||
|
- 64 /* bigrowbuf hack */
|
||||||
|
- 1 /* filter byte */
|
||||||
|
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||||
|
- 8) /* extra max_pixel_depth pad */
|
||||||
|
png_warning(png_ptr, "Width is too large for libpng to process pixels");
|
||||||
|
|
||||||
/* check other values */
|
/* check other values */
|
||||||
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
||||||
@ -324,16 +337,16 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
|||||||
info_ptr->channels++;
|
info_ptr->channels++;
|
||||||
info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
|
info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth);
|
||||||
|
|
||||||
/* check for overflow */
|
/* check for potential overflow */
|
||||||
rowbytes_per_pixel = (info_ptr->pixel_depth + 7) >> 3;
|
if ( width > (PNG_UINT_32_MAX
|
||||||
if ( width > PNG_UINT_32_MAX/rowbytes_per_pixel - 64)
|
>> 3) /* 8-byte RGBA pixels */
|
||||||
{
|
- 64 /* bigrowbuf hack */
|
||||||
png_warning(png_ptr,
|
- 1 /* filter byte */
|
||||||
"Width too large to process image data; rowbytes will overflow.");
|
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||||
|
- 8) /* extra max_pixel_depth pad */
|
||||||
info_ptr->rowbytes = (png_size_t)0;
|
info_ptr->rowbytes = (png_size_t)0;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
info_ptr->rowbytes = (info_ptr->width * info_ptr->pixel_depth + 7) >> 3;
|
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth,width);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PNG_oFFs_SUPPORTED)
|
#if defined(PNG_oFFs_SUPPORTED)
|
||||||
@ -1187,4 +1200,20 @@ png_set_mmx_thresholds (png_structp png_ptr,
|
|||||||
png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
png_ptr->mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
||||||
}
|
}
|
||||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
/* this function was added to libpng 1.2.6 */
|
||||||
|
void PNGAPI
|
||||||
|
png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
|
||||||
|
png_uint_32 user_height_max)
|
||||||
|
{
|
||||||
|
/* Images with dimensions larger than these limits will be
|
||||||
|
* rejected by png_set_IHDR(). To accept any PNG datastream
|
||||||
|
* regardless of dimensions, set both limits to 0x7ffffffL.
|
||||||
|
*/
|
||||||
|
png_ptr->user_width_max = user_width_max;
|
||||||
|
png_ptr->user_height_max = user_height_max;
|
||||||
|
}
|
||||||
|
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
|
||||||
|
|
||||||
#endif /* ?PNG_1_0_X */
|
#endif /* ?PNG_1_0_X */
|
||||||
|
13
pngtest.c
13
pngtest.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -519,6 +519,12 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
|||||||
if (current_allocation > maximum_allocation)
|
if (current_allocation > maximum_allocation)
|
||||||
maximum_allocation = current_allocation;
|
maximum_allocation = current_allocation;
|
||||||
pinfo->pointer = (png_voidp)png_malloc_default(png_ptr, size);
|
pinfo->pointer = (png_voidp)png_malloc_default(png_ptr, size);
|
||||||
|
if (size != 0 && pinfo->pointer == NULL)
|
||||||
|
{
|
||||||
|
current_allocation -= size;
|
||||||
|
total_allocation -= size;
|
||||||
|
png_error(png_ptr,"out of memory in pngtest->png_malloc_default.\n");
|
||||||
|
}
|
||||||
pinfo->next = pinformation;
|
pinfo->next = pinformation;
|
||||||
pinformation = pinfo;
|
pinformation = pinfo;
|
||||||
/* Make sure the caller isn't assuming zeroed memory. */
|
/* Make sure the caller isn't assuming zeroed memory. */
|
||||||
@ -1308,9 +1314,6 @@ main(int argc, char *argv[])
|
|||||||
PNG_HEADER_VERSION_STRING);
|
PNG_HEADER_VERSION_STRING);
|
||||||
fprintf(STDERR," png_sizeof(png_struct)=%ld, png_sizeof(png_info)=%ld\n",
|
fprintf(STDERR," png_sizeof(png_struct)=%ld, png_sizeof(png_info)=%ld\n",
|
||||||
(long)png_sizeof(png_struct), (long)png_sizeof(png_info));
|
(long)png_sizeof(png_struct), (long)png_sizeof(png_info));
|
||||||
fprintf(STDERR," PNG_UINT_31_MAX=%lu, PNG_UINT_32_MAX=%lu\n",
|
|
||||||
PNG_UINT_31_MAX, PNG_UINT_32_MAX);
|
|
||||||
fprintf(STDERR," PNG_SIZE_MAX=%u\n",PNG_SIZE_MAX);
|
|
||||||
|
|
||||||
/* Do some consistency checking on the memory allocation settings, I'm
|
/* Do some consistency checking on the memory allocation settings, I'm
|
||||||
not sure this matters, but it is nice to know, the first of these
|
not sure this matters, but it is nice to know, the first of these
|
||||||
@ -1541,4 +1544,4 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef version_1_2_6beta4 your_png_h_is_not_version_1_2_6beta4;
|
typedef version_1_2_6rc1 your_png_h_is_not_version_1_2_6rc1;
|
||||||
|
BIN
pngtest.png
BIN
pngtest.png
Binary file not shown.
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
@ -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.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
*
|
*
|
||||||
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
* For Intel x86 CPU and Microsoft Visual C++ compiler
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* Copyright (c) 1998, Intel Corporation
|
* Copyright (c) 1998, Intel Corporation
|
||||||
@ -125,7 +125,8 @@ png_combine_row(png_structp png_ptr, png_bytep row, int mask)
|
|||||||
if (mask == 0xff)
|
if (mask == 0xff)
|
||||||
{
|
{
|
||||||
png_memcpy(row, png_ptr->row_buf + 1,
|
png_memcpy(row, png_ptr->row_buf + 1,
|
||||||
(png_size_t)((png_ptr->width * png_ptr->row_info.pixel_depth + 7) >> 3));
|
(png_size_t)PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||||
|
png_ptr->width));
|
||||||
}
|
}
|
||||||
/* GRR: add "else if (mask == 0)" case?
|
/* GRR: add "else if (mask == 0)" case?
|
||||||
* or does png_combine_row() not even get called in that case? */
|
* or does png_combine_row() not even get called in that case? */
|
||||||
@ -1902,8 +1903,8 @@ loop4_pass4:
|
|||||||
} /* end switch (row_info->pixel_depth) */
|
} /* end switch (row_info->pixel_depth) */
|
||||||
|
|
||||||
row_info->width = final_width;
|
row_info->width = final_width;
|
||||||
row_info->rowbytes = ((final_width *
|
|
||||||
(png_uint_32)row_info->pixel_depth + 7) >> 3);
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,final_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
2
pngwio.c
2
pngwio.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
18
pngwrite.c
18
pngwrite.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng 1.2.6beta4 - July 28, 2004
|
* libpng 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -458,6 +458,12 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
|||||||
#endif
|
#endif
|
||||||
#endif /* PNG_1_0_X */
|
#endif /* PNG_1_0_X */
|
||||||
|
|
||||||
|
/* added at libpng-1.2.6 */
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
|
||||||
|
png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#ifdef PNG_SETJMP_SUPPORTED
|
||||||
#ifdef USE_FAR_KEYWORD
|
#ifdef USE_FAR_KEYWORD
|
||||||
if (setjmp(jmpbuf))
|
if (setjmp(jmpbuf))
|
||||||
@ -641,6 +647,12 @@ png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
|||||||
/* reset all variables to 0 */
|
/* reset all variables to 0 */
|
||||||
png_memset(png_ptr, 0, png_sizeof (png_struct));
|
png_memset(png_ptr, 0, png_sizeof (png_struct));
|
||||||
|
|
||||||
|
/* added at libpng-1.2.6 */
|
||||||
|
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||||
|
png_ptr->user_width_max=PNG_USER_WIDTH_MAX;
|
||||||
|
png_ptr->user_height_max=PNG_USER_HEIGHT_MAX;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(PNG_1_0_X)
|
#if !defined(PNG_1_0_X)
|
||||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||||
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
|
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
|
||||||
@ -829,8 +841,8 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
|||||||
png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
|
png_ptr->row_info.pixel_depth = (png_byte)(png_ptr->row_info.bit_depth *
|
||||||
png_ptr->row_info.channels);
|
png_ptr->row_info.channels);
|
||||||
|
|
||||||
png_ptr->row_info.rowbytes = ((png_ptr->row_info.width *
|
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||||
(png_uint_32)png_ptr->row_info.pixel_depth + 7) >> 3);
|
png_ptr->row_info.width);
|
||||||
|
|
||||||
png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type);
|
png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type);
|
||||||
png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width);
|
png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width);
|
||||||
|
@ -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 version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -195,8 +195,8 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
|||||||
}
|
}
|
||||||
row_info->bit_depth = (png_byte)bit_depth;
|
row_info->bit_depth = (png_byte)bit_depth;
|
||||||
row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels);
|
row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels);
|
||||||
row_info->rowbytes =
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
|
||||||
((row_info->width * row_info->pixel_depth + 7) >> 3);
|
row_info->width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
21
pngwutil.c
21
pngwutil.c
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngwutil.c - utilities to write a PNG file
|
/* pngwutil.c - utilities to write a PNG file
|
||||||
*
|
*
|
||||||
* libpng version 1.2.6beta4 - July 28, 2004
|
* libpng version 1.2.6rc1 - August 4, 2004
|
||||||
* 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-2004 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2004 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
@ -473,7 +473,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
|||||||
png_ptr->height = height;
|
png_ptr->height = height;
|
||||||
|
|
||||||
png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels);
|
png_ptr->pixel_depth = (png_byte)(bit_depth * png_ptr->channels);
|
||||||
png_ptr->rowbytes = ((width * (png_size_t)png_ptr->pixel_depth + 7) >> 3);
|
png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width);
|
||||||
/* set the usr info, so any transformations can modify it */
|
/* set the usr info, so any transformations can modify it */
|
||||||
png_ptr->usr_width = png_ptr->width;
|
png_ptr->usr_width = png_ptr->width;
|
||||||
png_ptr->usr_bit_depth = png_ptr->bit_depth;
|
png_ptr->usr_bit_depth = png_ptr->bit_depth;
|
||||||
@ -617,7 +617,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
|||||||
png_ptr->height < 16384 && png_ptr->width < 16384)
|
png_ptr->height < 16384 && png_ptr->width < 16384)
|
||||||
{
|
{
|
||||||
png_uint_32 uncompressed_idat_size = png_ptr->height *
|
png_uint_32 uncompressed_idat_size = png_ptr->height *
|
||||||
((png_ptr->width *
|
(PNG_ROWBYTES(png_ptr->channels*png_ptr->bit_depth,
|
||||||
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
|
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
|
||||||
unsigned int z_cinfo = z_cmf >> 4;
|
unsigned int z_cinfo = z_cmf >> 4;
|
||||||
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
|
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
|
||||||
@ -1691,8 +1691,8 @@ png_write_start_row(png_structp png_ptr)
|
|||||||
png_size_t buf_size;
|
png_size_t buf_size;
|
||||||
|
|
||||||
png_debug(1, "in png_write_start_row\n");
|
png_debug(1, "in png_write_start_row\n");
|
||||||
buf_size = (png_size_t)(((png_ptr->width * png_ptr->usr_channels *
|
buf_size = (png_size_t)(PNG_ROWBYTES(
|
||||||
png_ptr->usr_bit_depth + 7) >> 3) + 1);
|
png_ptr->usr_channels*png_ptr->usr_bit_depth,png_ptr->width)+1);
|
||||||
|
|
||||||
/* set up row buffer */
|
/* set up row buffer */
|
||||||
png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size);
|
png_ptr->row_buf = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size);
|
||||||
@ -1828,9 +1828,8 @@ png_write_finish_row(png_structp png_ptr)
|
|||||||
{
|
{
|
||||||
if (png_ptr->prev_row != NULL)
|
if (png_ptr->prev_row != NULL)
|
||||||
png_memset(png_ptr->prev_row, 0,
|
png_memset(png_ptr->prev_row, 0,
|
||||||
(png_size_t) (((png_uint_32)png_ptr->usr_channels *
|
(png_size_t)(PNG_ROWBYTES(png_ptr->usr_channels*
|
||||||
(png_uint_32)png_ptr->usr_bit_depth *
|
png_ptr->usr_bit_depth,png_ptr->width))+1);
|
||||||
png_ptr->width + 7) >> 3) + 1);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2037,8 +2036,8 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
|||||||
png_pass_inc[pass] - 1 -
|
png_pass_inc[pass] - 1 -
|
||||||
png_pass_start[pass]) /
|
png_pass_start[pass]) /
|
||||||
png_pass_inc[pass];
|
png_pass_inc[pass];
|
||||||
row_info->rowbytes = ((row_info->width *
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth,
|
||||||
row_info->pixel_depth + 7) >> 3);
|
row_info->width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2064,7 +2063,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
|
|||||||
|
|
||||||
png_debug(1, "in png_write_find_filter\n");
|
png_debug(1, "in png_write_find_filter\n");
|
||||||
/* find out how many bytes offset each pixel is */
|
/* find out how many bytes offset each pixel is */
|
||||||
bpp = (row_info->pixel_depth + 7) / 8;
|
bpp = (row_info->pixel_depth + 7) >> 3;
|
||||||
|
|
||||||
prev_row = png_ptr->prev_row;
|
prev_row = png_ptr->prev_row;
|
||||||
best_row = row_buf = png_ptr->row_buf;
|
best_row = row_buf = png_ptr->row_buf;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
A set of project files is available for Netware. Get
|
A set of project files is available for Netware. Get
|
||||||
libpng-1.2.6beta4-project-netware.zip from a libpng distribution
|
libpng-1.2.5-project-netware.zip from a libpng distribution
|
||||||
site such as http://libpng.sourceforge.net
|
site such as http://libpng.sourceforge.net
|
||||||
|
|
||||||
Put the zip file in this directory (projects) and then run
|
Put the zip file in this directory (projects) and then run
|
||||||
"unzip -a libpng-1.2.6beta4-project-netware.zip"
|
"unzip -a libpng-1.2.5-project-netware.zip"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
A set of project files is available for WinCE. Get
|
A set of project files is available for WinCE. Get
|
||||||
libpng-1.2.6beta4-project-wince.zip from a libpng distribution
|
libpng-1.2.5-project-wince.zip from a libpng distribution
|
||||||
site such as http://libpng.sourceforge.net
|
site such as http://libpng.sourceforge.net
|
||||||
|
|
||||||
Put the zip file in this directory (projects) and then run
|
Put the zip file in this directory (projects) and then run
|
||||||
"unzip -a libpng-1.2.6beta4-project-wince.zip"
|
"unzip -a libpng-1.2.5-project-wince.zip"
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# Modeled after libxml-config.
|
# Modeled after libxml-config.
|
||||||
|
|
||||||
version=1.2.5
|
version=1.2.6rc1
|
||||||
prefix=""
|
prefix=""
|
||||||
libdir=""
|
libdir=""
|
||||||
libs=""
|
libs=""
|
||||||
|
@ -6,6 +6,6 @@ includedir=${exec_prefix}/include
|
|||||||
|
|
||||||
Name: libpng12
|
Name: libpng12
|
||||||
Description: Loads and saves PNG files
|
Description: Loads and saves PNG files
|
||||||
Version: 1.2.5
|
Version: 1.2.6rc1
|
||||||
Libs: -L${libdir} -lpng12 -lz -lm
|
Libs: -L${libdir} -lpng12 -lz -lm
|
||||||
Cflags: -I${includedir}/libpng12
|
Cflags: -I${includedir}/libpng12
|
||||||
|
@ -33,7 +33,7 @@ RANLIB=echo
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
@ -33,7 +33,7 @@ RANLIB=echo
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
INCPATH=$(prefix)/include
|
INCPATH=$(prefix)/include
|
||||||
|
@ -18,7 +18,7 @@ RM = rm -f
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
prefix=/usr/local
|
prefix=/usr/local
|
||||||
|
@ -12,7 +12,7 @@ ZLIBLIB=/usr/local/lib
|
|||||||
ZLIBINC=/usr/local/include
|
ZLIBINC=/usr/local/include
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
ALIGN=
|
ALIGN=
|
||||||
|
@ -79,7 +79,7 @@ CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
|||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
CYGDLL = 12
|
CYGDLL = 12
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# makefile for libpng on Darwin / Mac OS X
|
# makefile for libpng on Darwin / Mac OS X
|
||||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
# Copyright (C) 2002,2004 Glenn Randers-Pehrson
|
||||||
# Copyright (C) 2001 Christoph Pfisterer
|
# Copyright (C) 2001 Christoph Pfisterer
|
||||||
# derived from makefile.linux:
|
# derived from makefile.linux:
|
||||||
# Copyright (C) 1998, 1999 Greg Roelofs
|
# Copyright (C) 1998, 1999 Greg Roelofs
|
||||||
@ -23,7 +23,7 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
@ -85,18 +85,17 @@ $(LIBNAME).$(PNGMAJ).dylib: $(LIBNAME).$(PNGVER).dylib
|
|||||||
|
|
||||||
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
|
$(LIBNAME).$(PNGVER).dylib: $(OBJSDLL)
|
||||||
$(CC) -dynamiclib \
|
$(CC) -dynamiclib \
|
||||||
-install_name $(DL)/$(LIBNAME).$(PNGMAJ).dylib \
|
-install_name $(LIBPATH)/$(LIBNAME).$(PNGMAJ).dylib \
|
||||||
-flat_namespace -undefined suppress \
|
-current_version $(PNGVER) -compatibility_version $(PNGVER) \
|
||||||
-o $(LIBNAME).$(PNGVER).dylib \
|
-o $(LIBNAME).$(PNGVER).dylib \
|
||||||
$(OBJSDLL)
|
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||||
|
|
||||||
libpng.3.$(PNGMIN).dylib: $(OBJSDLL)
|
libpng.3.$(PNGMIN).dylib: $(OBJSDLL)
|
||||||
$(CC) -dynamiclib \
|
$(CC) -dynamiclib \
|
||||||
-install_name $(DL)/libpng.3.dylib \
|
-install_name $(LIBPATH)/libpng.3.dylib \
|
||||||
-current_version 3 -compatibility_version 3 \
|
-current_version 3 -compatibility_version 3 \
|
||||||
-flat_namespace -undefined suppress \
|
|
||||||
-o libpng.3.$(PNGMIN).dylib \
|
-o libpng.3.$(PNGMIN).dylib \
|
||||||
$(OBJSDLL)
|
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||||
|
|
||||||
pngtest: pngtest.o $(LIBNAME).dylib
|
pngtest: pngtest.o $(LIBNAME).dylib
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||||
@ -117,6 +116,7 @@ install-static: install-headers libpng.a
|
|||||||
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
||||||
cp libpng.a $(DL)/$(LIBNAME).a
|
cp libpng.a $(DL)/$(LIBNAME).a
|
||||||
chmod 644 $(DL)/$(LIBNAME).a
|
chmod 644 $(DL)/$(LIBNAME).a
|
||||||
|
$(RANLIB) $(DL)/$(LIBNAME).a
|
||||||
-@/bin/rm -f $(DL)/libpng.a
|
-@/bin/rm -f $(DL)/libpng.a
|
||||||
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
(cd $(DL); ln -sf $(LIBNAME).a libpng.a)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ ZLIBLIB=../zlib
|
|||||||
ZLIBINC=../zlib
|
ZLIBINC=../zlib
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
@ -41,7 +41,7 @@ RANLIB=ranlib
|
|||||||
#RANLIB=echo
|
#RANLIB=echo
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
|||||||
RANLIB=ranlib
|
RANLIB=ranlib
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
@ -1,197 +0,0 @@
|
|||||||
# makefile for libpng, MACOS X
|
|
||||||
# Copyright (C) 2002 Glenn Randers-Pehrson
|
|
||||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
|
||||||
# Modified by Karin Kosina <kyrah@sim.no> 20011010:
|
|
||||||
# build shared library (*.dylib)
|
|
||||||
# For conditions of distribution and use, see copyright notice in png.h
|
|
||||||
|
|
||||||
# where make install puts libpng.a and png.h
|
|
||||||
prefix=/usr/local
|
|
||||||
|
|
||||||
# Where the zlib library and include files are located
|
|
||||||
#ZLIBLIB=/usr/local/lib
|
|
||||||
#ZLIBINC=/usr/local/include
|
|
||||||
ZLIBLIB=../zlib
|
|
||||||
ZLIBINC=../zlib
|
|
||||||
|
|
||||||
CC=cc
|
|
||||||
|
|
||||||
PNGMAJ = 0
|
|
||||||
PNGMIN = 1.2.5
|
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
|
||||||
|
|
||||||
CFLAGS=-fno-common -I$(ZLIBINC) -O # -g -DPNG_DEBUG=5
|
|
||||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz
|
|
||||||
|
|
||||||
LIBNAME=libpng12
|
|
||||||
SHAREDLIB_POSTFIX=dylib
|
|
||||||
INCPATH=$(prefix)/include
|
|
||||||
LIBPATH=$(prefix)/lib
|
|
||||||
MANPATH=$(prefix)/man
|
|
||||||
BINPATH=$(prefix)/bin
|
|
||||||
|
|
||||||
# override DESTDIR= on the make install command line to easily support
|
|
||||||
# installing into a temporary location. Example:
|
|
||||||
#
|
|
||||||
# make install DESTDIR=/tmp/build/libpng
|
|
||||||
#
|
|
||||||
# If you're going to install into a temporary location
|
|
||||||
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
|
||||||
# you execute make install.
|
|
||||||
DESTDIR=
|
|
||||||
|
|
||||||
DB=$(DESTDIR)$(BINPATH)
|
|
||||||
DI=$(DESTDIR)$(INCPATH)
|
|
||||||
DL=$(DESTDIR)$(LIBPATH)
|
|
||||||
DM=$(DESTDIR)$(MANPATH)
|
|
||||||
|
|
||||||
#RANLIB=echo
|
|
||||||
RANLIB=ranlib
|
|
||||||
|
|
||||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
|
||||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
|
||||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
|
||||||
|
|
||||||
all: libpng.a pngtest shared libpng.pc libpng-config
|
|
||||||
|
|
||||||
shared: $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
|
||||||
|
|
||||||
libpng.pc:
|
|
||||||
cat scripts/libpng.pc.in | sed -e s\!@PREFIX@!$(prefix)! | \
|
|
||||||
sed -e s/-lm// > libpng.pc
|
|
||||||
|
|
||||||
libpng-config:
|
|
||||||
( cat scripts/libpng-config-head.in; \
|
|
||||||
echo prefix=\"$(prefix)\"; \
|
|
||||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
|
||||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
|
||||||
echo libs=\"-lpng12 -lz\"; \
|
|
||||||
cat scripts/libpng-config-body.in ) > libpng-config
|
|
||||||
chmod +x libpng-config
|
|
||||||
|
|
||||||
libpng.a: $(OBJS)
|
|
||||||
ar rc $@ $(OBJS)
|
|
||||||
$(RANLIB) $@
|
|
||||||
|
|
||||||
$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX): $(OBJS)
|
|
||||||
cc -dynamiclib -flat_namespace -undefined suppress -o $@ $(OBJS)
|
|
||||||
|
|
||||||
libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX): $(OBJS)
|
|
||||||
cc -dynamiclib -compatibility_version 3 -flat_namespace \
|
|
||||||
-undefined suppress -o $@ $(OBJS)
|
|
||||||
|
|
||||||
pngtest: pngtest.o libpng.a
|
|
||||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
|
||||||
|
|
||||||
test: pngtest
|
|
||||||
./pngtest
|
|
||||||
|
|
||||||
install-headers: png.h pngconf.h
|
|
||||||
-@if [ ! -d $(DI) ]; then mkdir $(DI); fi
|
|
||||||
-@if [ ! -d $(DI)/$(LIBNAME) ]; then mkdir $(DI)/$(LIBNAME); fi
|
|
||||||
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
|
||||||
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
|
||||||
-@/bin/rm -f $(DI)/png.h $(DI)/pngconf.h
|
|
||||||
-@/bin/rm -f $(DI)/libpng
|
|
||||||
(cd $(DI); ln -f -s $(LIBNAME) libpng; ln -f -s $(LIBNAME)/* .)
|
|
||||||
|
|
||||||
install-static: install-headers libpng.a
|
|
||||||
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
|
||||||
cp libpng.a $(DL)/$(LIBNAME).a
|
|
||||||
chmod 644 $(DL)/$(LIBNAME).a
|
|
||||||
-@/bin/rm -f $(DL)/libpng.a
|
|
||||||
(cd $(DL); ln -f -s $(LIBNAME).a libpng.a)
|
|
||||||
|
|
||||||
install-shared: install-headers $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.pc libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX)
|
|
||||||
-@if [ ! -d $(DL) ]; then mkdir $(DL); fi
|
|
||||||
-@/bin/rm -f \
|
|
||||||
$(DL)/$(LIBNAME).$(PNGVER)*.$(SHAREDLIB_POSTFIX)
|
|
||||||
-@/bin/rm -f $(DL)/$(LIBNAME).$(SHAREDLIB_POSTFIX)
|
|
||||||
-@/bin/rm -f libpng.$(SHAREDLIB_POSTFIX)
|
|
||||||
-@/bin/rm -f libpng.3.$(SHAREDLIB_POSTFIX)
|
|
||||||
-@/bin/rm -f libpng.3.$(PNGMIN)*.$(SHAREDLIB_POSTFIX)
|
|
||||||
cp libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) $(DL)
|
|
||||||
cp $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) $(DL)
|
|
||||||
chmod 755 $(DL)/$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX)
|
|
||||||
chmod 755 $(DL)/libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX)
|
|
||||||
(cd $(DL); \
|
|
||||||
ln -f -s libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.3.$(SHAREDLIB_POSTFIX); \
|
|
||||||
ln -f -s libpng.3.$(SHAREDLIB_POSTFIX) libpng.$(SHAREDLIB_POSTFIX); \
|
|
||||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.$(SHAREDLIB_POSTFIX); \
|
|
||||||
ln -f -s libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.3.$(SHAREDLIB_POSTFIX); \
|
|
||||||
ln -f -s $(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
|
||||||
$(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX); \
|
|
||||||
ln -f -s $(LIBNAME).$(PNGMAJ).$(SHAREDLIB_POSTFIX) \
|
|
||||||
$(LIBNAME).$(SHAREDLIB_POSTFIX))
|
|
||||||
-@if [ ! -d $(DL)/pkgconfig ]; then mkdir $(DL)/pkgconfig; fi
|
|
||||||
-@/bin/rm -f $(DL)/pkgconfig/$(LIBNAME).pc
|
|
||||||
-@/bin/rm -f $(DL)/pkgconfig/libpng.pc
|
|
||||||
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
|
||||||
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
|
||||||
(cd $(DL)/pkgconfig; ln -f -s $(LIBNAME).pc libpng.pc)
|
|
||||||
|
|
||||||
install-man: libpng.3 libpngpf.3 png.5
|
|
||||||
-@if [ ! -d $(DM) ]; then mkdir $(DM); fi
|
|
||||||
-@if [ ! -d $(DM)/man3 ]; then mkdir $(DM)/man3; fi
|
|
||||||
-@/bin/rm -f $(DM)/man3/libpng.3
|
|
||||||
-@/bin/rm -f $(DM)/man3/libpngpf.3
|
|
||||||
cp libpng.3 $(DM)/man3
|
|
||||||
cp libpngpf.3 $(DM)/man3
|
|
||||||
-@if [ ! -d $(DM)/man5 ]; then mkdir $(DM)/man5; fi
|
|
||||||
-@/bin/rm -f $(DM)/man5/png.5
|
|
||||||
cp png.5 $(DM)/man5
|
|
||||||
|
|
||||||
install-config: libpng-config
|
|
||||||
-@if [ ! -d $(DB) ]; then mkdir $(DB); fi
|
|
||||||
-@/bin/rm -f $(DB)/libpng-config
|
|
||||||
-@/bin/rm -f $(DB)/$(LIBNAME)-config
|
|
||||||
cp libpng-config $(DB)/$(LIBNAME)-config
|
|
||||||
chmod 755 $(DB)/$(LIBNAME)-config
|
|
||||||
(cd $(DB); ln -sf $(LIBNAME)-config libpng-config)
|
|
||||||
|
|
||||||
install: install-static install-shared install-man install-config
|
|
||||||
|
|
||||||
# If you installed in $(DESTDIR), test-installed won't work until you
|
|
||||||
# move the library to its final location.
|
|
||||||
|
|
||||||
test-installed:
|
|
||||||
$(CC) $(CFLAGS) \
|
|
||||||
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
|
|
||||||
-L$(ZLIBLIB) \
|
|
||||||
-o pngtesti `$(BINPATH)/libpng12-config --ldflags`
|
|
||||||
./pngtesti pngtest.png
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o libpng.a pngtest pngout.png libpng-config \
|
|
||||||
$(LIBNAME).$(PNGVER).$(SHAREDLIB_POSTFIX) \
|
|
||||||
$(LIBNAME).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.3.$(PNGMIN).$(SHAREDLIB_POSTFIX) \
|
|
||||||
libpng.pc
|
|
||||||
|
|
||||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
|
||||||
writelock:
|
|
||||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
|
||||||
|
|
||||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
||||||
|
|
||||||
png.o: png.h pngconf.h
|
|
||||||
pngerror.o: png.h pngconf.h
|
|
||||||
pngrio.o: png.h pngconf.h
|
|
||||||
pngwio.o: png.h pngconf.h
|
|
||||||
pngmem.o: png.h pngconf.h
|
|
||||||
pngset.o: png.h pngconf.h
|
|
||||||
pngget.o: png.h pngconf.h
|
|
||||||
pngread.o: png.h pngconf.h
|
|
||||||
pngrtran.o: png.h pngconf.h
|
|
||||||
pngrutil.o: png.h pngconf.h
|
|
||||||
pngtest.o: png.h pngconf.h
|
|
||||||
pngtrans.o: png.h pngconf.h
|
|
||||||
pngwrite.o: png.h pngconf.h
|
|
||||||
pngwtran.o: png.h pngconf.h
|
|
||||||
pngwutil.o: png.h pngconf.h
|
|
||||||
pngpread.o: png.h pngconf.h
|
|
||||||
|
|
@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng12
|
|||||||
|
|
||||||
LIB= png12
|
LIB= png12
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIB_MINOR= 1.2.5
|
SHLIB_MINOR= 1.2.6rc1
|
||||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
@ -13,7 +13,7 @@ INCSDIR=${LOCALBASE}/include/libpng
|
|||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SHLIB_MAJOR= 3
|
SHLIB_MAJOR= 3
|
||||||
SHLIB_MINOR= 1.2.5
|
SHLIB_MINOR= 1.2.6rc1
|
||||||
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
@ -7,7 +7,7 @@ LIBDIR= ${PREFIX}/lib
|
|||||||
MANDIR= ${PREFIX}/man/cat
|
MANDIR= ${PREFIX}/man/cat
|
||||||
|
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIB_MINOR= 1.2.5
|
SHLIB_MINOR= 1.2.6rc1
|
||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
SRCS= png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
|
||||||
|
@ -24,7 +24,7 @@ LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
|||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ ZLIBINC=../zlib
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
CC=gcc
|
CC=gcc
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
LIBNAME=libpng12
|
LIBNAME=libpng12
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
|
|
||||||
# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
|
# Where make install puts libpng.a, libpng12.so, and libpng12/png.h
|
||||||
|
@ -34,7 +34,7 @@ LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
|||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ LDFLAGS=-L. -R. -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
|||||||
RANLIB=echo
|
RANLIB=echo
|
||||||
|
|
||||||
PNGMAJ = 0
|
PNGMAJ = 0
|
||||||
PNGMIN = 1.2.5
|
PNGMIN = 1.2.6rc1
|
||||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||||
LIBNAME = libpng12
|
LIBNAME = libpng12
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
; PNG.LIB module definition file for OS/2
|
; PNG.LIB module definition file for OS/2
|
||||||
;----------------------------------------
|
;----------------------------------------
|
||||||
|
|
||||||
; Version 1.2.5
|
; Version 1.2.6rc1
|
||||||
|
|
||||||
LIBRARY PNG
|
LIBRARY PNG
|
||||||
DESCRIPTION "PNG image compression library for OS/2"
|
DESCRIPTION "PNG image compression library for OS/2"
|
||||||
@ -184,27 +184,6 @@ EXPORTS
|
|||||||
png_convert_to_rfc1123
|
png_convert_to_rfc1123
|
||||||
png_set_invalid
|
png_set_invalid
|
||||||
|
|
||||||
; Added at version 1.2.0:
|
|
||||||
png_mmx_support
|
|
||||||
png_permit_empty_plte
|
|
||||||
png_permit_mng_features
|
|
||||||
png_get_mmx_flagmask
|
|
||||||
png_get_asm_flagmask
|
|
||||||
png_get_asm_flags
|
|
||||||
png_get_mmx_bitdepth_threshold
|
|
||||||
png_get_mmx_rowbytes_threshold
|
|
||||||
png_set_asm_flags
|
|
||||||
png_init_mmx_flags
|
|
||||||
|
|
||||||
; Added at version 1.2.2:
|
|
||||||
png_handle_as_unknown
|
|
||||||
|
|
||||||
; Added at version 1.2.2 and deleted from 1.2.3:
|
|
||||||
; png_zalloc
|
|
||||||
; png_zfree
|
|
||||||
|
|
||||||
; Added at version 1.2.4
|
|
||||||
png_malloc_warn
|
|
||||||
|
|
||||||
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
|
; These are not present when libpng is compiled with PNG_NO_GLOBAL_ARRAYS
|
||||||
png_libpng_ver
|
png_libpng_ver
|
||||||
|
@ -6,7 +6,7 @@ LIBRARY
|
|||||||
DESCRIPTION "PNG image compression library for Windows"
|
DESCRIPTION "PNG image compression library for Windows"
|
||||||
|
|
||||||
EXPORTS
|
EXPORTS
|
||||||
;Version 1.2.5
|
;Version 1.2.6rc1
|
||||||
png_build_grayscale_palette @1
|
png_build_grayscale_palette @1
|
||||||
png_check_sig @2
|
png_check_sig @2
|
||||||
png_chunk_error @3
|
png_chunk_error @3
|
||||||
@ -191,30 +191,3 @@ EXPORTS
|
|||||||
png_write_init_3 @176
|
png_write_init_3 @176
|
||||||
png_info_init_3 @177
|
png_info_init_3 @177
|
||||||
png_destroy_struct @178
|
png_destroy_struct @178
|
||||||
; Added at version 1.2.0
|
|
||||||
; For use with PNG_USER_MEM_SUPPORTED
|
|
||||||
png_destroy_struct_2 @179
|
|
||||||
png_create_read_struct_2 @180
|
|
||||||
png_create_write_struct_2 @181
|
|
||||||
png_malloc_default @182
|
|
||||||
png_free_default @183
|
|
||||||
; MNG features
|
|
||||||
png_permit_mng_features @184
|
|
||||||
; MMX support
|
|
||||||
png_mmx_support @185
|
|
||||||
png_get_mmx_flagmask @186
|
|
||||||
png_get_asm_flagmask @187
|
|
||||||
png_get_asm_flags @188
|
|
||||||
png_get_mmx_bitdepth_threshold @189
|
|
||||||
png_get_mmx_rowbytes_threshold @190
|
|
||||||
png_set_asm_flags @191
|
|
||||||
png_init_mmx_flags @192
|
|
||||||
; Strip error numbers
|
|
||||||
png_set_strip_error_numbers @193
|
|
||||||
; Added at version 1.2.2
|
|
||||||
png_handle_as_unknown @194
|
|
||||||
; Added at version 1.2.2 and deleted from 1.2.3
|
|
||||||
; png_zalloc @195
|
|
||||||
; png_zfree @196
|
|
||||||
; Added at version 1.2.4
|
|
||||||
png_malloc_warn @195
|
|
||||||
|
Reference in New Issue
Block a user