Updated the bundled libpng to v1.2.33.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6592 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
63b8523126
commit
3db04d80a1
1
CHANGES
1
CHANGES
@ -1,5 +1,6 @@
|
||||
CHANGES IN FLTK 1.3.0
|
||||
|
||||
- Updated the bundled libpng to v1.2.33.
|
||||
- Fixed callback would not be called when shortcut was used with
|
||||
radio and toggle buttons in default FL_RELEASE mode.
|
||||
- Fixed a problem with TrackMouseEvent() (Windows only) that would
|
||||
|
60
png/ANNOUNCE
60
png/ANNOUNCE
@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.2.25 - February 18, 2008
|
||||
Libpng 1.2.33 - October 31, 2008
|
||||
|
||||
This is a public release of libpng, intended for use in production codes.
|
||||
|
||||
@ -8,59 +8,47 @@ Files available for download:
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
libpng-1.2.25.tar.gz
|
||||
libpng-1.2.25.tar.lzma
|
||||
libpng-1.2.33.tar.gz
|
||||
libpng-1.2.33.tar.lzma
|
||||
(Get the lzma codec from <http://tukaani.org/lzma>).
|
||||
libpng-1.2.25.tar.bz2
|
||||
libpng-1.2.33.tar.bz2
|
||||
|
||||
Source files with LF line endings (for Unix/Linux) without the
|
||||
"configure" script
|
||||
|
||||
libpng-1.2.25-no-config.tar.gz
|
||||
libpng-1.2.25-no-config.tar.lzma
|
||||
libpng-1.2.25-no-config.tar.bz2
|
||||
libpng-1.2.33-no-config.tar.gz
|
||||
libpng-1.2.33-no-config.tar.lzma
|
||||
libpng-1.2.33-no-config.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lpng1225.zip
|
||||
lpng1225.7z
|
||||
lpng1225.tar.bz2
|
||||
lpng1233.zip
|
||||
lpng1233.7z
|
||||
lpng1233.tar.bz2
|
||||
|
||||
Project files
|
||||
|
||||
libpng-1.2.25-project-netware.zip
|
||||
libpng-1.2.25-project-wince.zip
|
||||
libpng-1.2.33-project-netware.zip
|
||||
libpng-1.2.33-project-wince.zip
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.2.25-README.txt
|
||||
libpng-1.2.25-KNOWNBUGS.txt
|
||||
libpng-1.2.25-LICENSE.txt
|
||||
libpng-1.2.25-Y2K-compliance.txt
|
||||
libpng-1.2.25-1.2.24-diff.txt
|
||||
libpng-1.2.33-README.txt
|
||||
libpng-1.2.33-KNOWNBUGS.txt
|
||||
libpng-1.2.33-LICENSE.txt
|
||||
libpng-1.2.33-Y2K-compliance.txt
|
||||
libpng-1.2.33-[previous version]-diff.txt
|
||||
|
||||
Changes since the last public release (1.2.24):
|
||||
Changes since the last public release (1.2.32):
|
||||
|
||||
version 1.2.25 [February 18, 2008]
|
||||
version 1.2.33 [October 31, 2008]
|
||||
|
||||
Fixed bug with unknown chunk handling, introduced in version 1.2.17
|
||||
Prevent gamma from being applied twice.
|
||||
Fixed some continue-after-malloc-failure errors in pngset.c (David Hill)
|
||||
Check for info_ptr == NULL in png_read_info() and png_process_data().
|
||||
Check for possible use of NULL user_png_ver[] in png_create_read_struct().
|
||||
Fix overflow of "msg" in png_decompres_chunk().
|
||||
Added libpng-1.2.25.tar.lzma to distribution. Get the lzma codec
|
||||
from <http://tukaani.org/lzma>.
|
||||
Added lpng1225.7z to distribution. Get the 7-zip decoder from
|
||||
from <http://www.7-zip.org>.
|
||||
Fixed some broken links in the README file.
|
||||
Refactored png_read_push_finish_row() slightly, trying to satisfy Coverity.
|
||||
Fixed potential NULL dereference of png_ptr in png_destroy_write_struct();
|
||||
clarified potential NULL dereference of png_ptr in png_destroy_read_struct();
|
||||
fixed potential NULL dereference of info_ptr in png_handle_bKGD();
|
||||
fixed potential NULL dereference of user_png_ver[] in
|
||||
png_create_write_struct_2(). (Coverity)
|
||||
Revised makefile.darwin to fix shared library numbering.
|
||||
Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8()
|
||||
in example.c (debian bug report)
|
||||
Changed remaining "key" to "png_ptr->chunkdata" in png_handle_tEXt()
|
||||
to avoid memory leak after memory failure while reading tEXt chunk.`
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
187
png/CHANGES
187
png/CHANGES
@ -2048,7 +2048,7 @@ version 1.2.25beta03 [January 22, 2008]
|
||||
Change "if (swidth == NULL)" to "if (sheight == NULL)" in png_handle_sCAL
|
||||
(bug introduced in libpng-1.2.4/1.0.13).
|
||||
Return from png_destroy_read_struct() if png_ptr_ptr is NULL.
|
||||
Fix overflow of "msg" in png_decompres_chunk().
|
||||
Fix overflow of "msg" in png_decompress_chunk().
|
||||
|
||||
version 1.2.25beta04 [January 26, 2008]
|
||||
Work around Coverity bug report by slightly refactoring
|
||||
@ -2076,6 +2076,191 @@ version 1.2.25rc02 [February 10, 2008]
|
||||
version 1.2.25 and 1.0.31 [February 18, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.2.26beta01 [February 21, 2008]
|
||||
Added missing "(" in pngmem.c. Bug introduced in libpng-1.2.2/1.0.13
|
||||
|
||||
version 1.2.26beta02 [March 12, 2008]
|
||||
Refined error message returned from deflateInit2 in pngwutil.c
|
||||
Check IHDR length in png_push_read_chunk() before saving it.
|
||||
|
||||
version 1.2.26beta03 [March 16, 2008]
|
||||
Revised contrib/gregbook to handle premature end-of-file and file
|
||||
read errors correctly.
|
||||
|
||||
version 1.2.26beta04 [March 18, 2008]
|
||||
Free png_ptr->big_row_buf and png_ptr->prev_row before allocating
|
||||
new copies in png_read_start_row(). Bug introduced in libpng-1.2.22.
|
||||
|
||||
version 1.2.26beta05 [March 19, 2008]
|
||||
Removed extra png_free() added in libpng-1.2.26beta04.
|
||||
|
||||
version 1.2.26beta06 [March 19, 2008]
|
||||
Avoid reallocating big_row_buf and prev_row when the size does not increase.
|
||||
|
||||
version 1.2.26rc01 [March 26, 2008]
|
||||
Ifdef out some code that is unused when interlacing is not supported.
|
||||
|
||||
versions 1.0.32 and 1.2.26 [April 2, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.2.27beta01 [April 12, 2008]
|
||||
Fixed bug (introduced in libpng-1.0.5h) with handling zero-length
|
||||
unknown chunks.
|
||||
Added more information about png_set_keep_unknown_chunks() to the
|
||||
documentation.
|
||||
Reject tRNS chunk with out-of-range samples instead of masking off
|
||||
the invalid high bits as done in since libpng-1.2.19beta5.
|
||||
|
||||
version 1.2.27beta02 [April 13, 2008]
|
||||
Revised documentation about unknown chunk and user chunk handling.
|
||||
Keep tRNS chunk with out-of-range samples and issue a png_warning().
|
||||
|
||||
version 1.2.27beta03 [April 14, 2008]
|
||||
Added check for NULL ptr in TURBOC version of png_free_default().
|
||||
Removed several unnecessary checks for NULL before calling png_free().
|
||||
Revised png_set_tRNS() so that calling it twice removes and invalidates
|
||||
the previous call.
|
||||
Revised pngtest to check for out-of-range tRNS samples.
|
||||
|
||||
version 1.2.27beta04 [April 18, 2008]
|
||||
Added AC_LIBTOOL_WIN32_DLL to configure.ac
|
||||
Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.62
|
||||
|
||||
version 1.2.27beta05 [April 19, 2008]
|
||||
Added MAINTAINERCLEANFILES variable to Makefile.am
|
||||
|
||||
version 1.2.27beta06 [April 21, 2008]
|
||||
Avoid changing color_type from GRAY to RGB by
|
||||
png_set_expand_gray_1_2_4_to_8().
|
||||
|
||||
version 1.2.27rc01 [April 23, 2008]
|
||||
Fix broken URL for rfc2083 in png.5 and libpng-*.txt
|
||||
|
||||
version 1.0.33 and 1.2.27 [April 30, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.0.34 and 1.2.28 [April 30, 2008]
|
||||
Rebuilt Makefile.in, aclocal.m4, and configure with autoconf-2.61
|
||||
due to backward incompatibilities.
|
||||
Removed a stray object file from contrib/gregbook
|
||||
|
||||
version 1.2.29beta01 [May 1, 2008]
|
||||
Removed some stray *.diff and *.orig files
|
||||
|
||||
version 1.2.29beta02 [May 1, 2008]
|
||||
Reverted Makefile.in, aclocal.m4, and configure to the libpng-1.2.26
|
||||
versions.
|
||||
|
||||
version 1.2.29beta03 [May 2, 2008]
|
||||
Added --force to autogen libtoolize options and --force-missing to
|
||||
automake options.
|
||||
Changed $(ECHO) to echo in Makefile.am and Makefile.in
|
||||
Updated all configure files to autoconf-2.62
|
||||
#ifdef out pnggcrd.c code if using MSC_VER
|
||||
|
||||
version 1.2.29rc01 [May 4, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.0.35 and 1.2.29 [May 8, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.0.37 [May 9, 2008]
|
||||
Updated Makefile.in and configure (omitted version 1.0.36).
|
||||
|
||||
version 1.2.30beta01 [May 29, 2008]
|
||||
Updated libpng.pc-configure.in and libpng-config.in per debian bug reports.
|
||||
|
||||
version 1.2.30beta02 [June 25, 2008]
|
||||
Restored png_flush(png_ptr) at the end of png_write_end(), that was
|
||||
removed from libpng-1.0.9beta03.
|
||||
|
||||
version 1.2.30beta03 [July 6, 2008]
|
||||
Merged some cosmetic whitespace changes from libpng-1.4.0beta19.
|
||||
Inline call of png_get_uint_32() in png_get_uint_31(), as in 1.4.0beta19.
|
||||
Added demo of decoding vpAg and sTER chunks to pngtest.c, from 1.4.0beta19.
|
||||
Changed PNGMAJ from 0 to 12 in makefile.darwin, which does not like 0.
|
||||
Added new private function png_read_chunk_header() from 1.4.0beta19.
|
||||
Merge reading of chunk length and chunk type into a single 8-byte read.
|
||||
Merge writing of chunk length and chunk type into a single 8-byte write.
|
||||
|
||||
version 1.2.30beta04 [July 10, 2008]
|
||||
Merged more cosmetic whitespace changes from libpng-1.4.0beta19.
|
||||
|
||||
version 1.0.38rc01, 1.2.30rc01 [October 31, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.0.38rc02, 1.2.30rc02 [July 21, 2008]
|
||||
Moved local array "chunkdata" from pngrutil.c to the png_struct, so
|
||||
it will be freed by png_read_destroy() in case of a read error (Kurt
|
||||
Christensen).
|
||||
|
||||
version 1.0.38rc03, 1.2.30rc03 [July 21, 2008]
|
||||
Changed "purpose" and "buffer" to png_ptr->chunkdata to avoid memory leaking.
|
||||
|
||||
version 1.0.38rc04, 1.2.30rc04 [July 22, 2008]
|
||||
Changed "chunkdata = NULL" to "png_ptr->chunkdata = NULL" several places in
|
||||
png_decompress_chunk().
|
||||
|
||||
version 1.0.38rc05, 1.2.30rc05 [July 25, 2008]
|
||||
Changed all remaining "chunkdata" to "png_ptr->chunkdata" in
|
||||
png_decompress_chunk() and remove chunkdata from parameter list.
|
||||
Put a call to png_check_chunk_name() in png_read_chunk_header().
|
||||
Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte.
|
||||
Removed two calls to png_check_chunk_name() occuring later in the process.
|
||||
|
||||
version 1.0.38rc06, 1.2.30rc06 [July 29, 2008]
|
||||
Added a call to png_check_chunk_name() in pngpread.c
|
||||
Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte.
|
||||
|
||||
version 1.0.38r07, 1.2.30r07 [August 2, 2008]
|
||||
Changed "-Wall" to "-W -Wall" in the CFLAGS in all makefiles (Cosmin Truta)
|
||||
Declared png_ptr "volatile" in pngread.c and pngwrite.c to avoid warnings.
|
||||
Added code in pngset.c to quiet compiler warnings.
|
||||
Updated contrib/visupng/cexcept.h to version 2.0.1
|
||||
Relocated a misplaced "#endif /* PNG_NO_WRITE_FILTER */" in pngwutil.c
|
||||
|
||||
version 1.0.38r08, 1.2.30r08 [August 2, 2008]
|
||||
Enclose "volatile" declarations in #ifdef PNG_SETJMP_SUPPORTED (Cosmin).
|
||||
|
||||
version 1.0.38, 1.2.30 [August 14, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.2.31rc01 [August 19, 2008]
|
||||
Removed extra crc check at the end of png_handle_cHRM(). Bug introduced
|
||||
in libpng-1.2.30beta03 (Heiko Nitzsche).
|
||||
|
||||
version 1.2.31rc02 [August 19, 2008]
|
||||
Added PNG_WRITE_FLUSH_SUPPORTED block around new png_flush() call.
|
||||
|
||||
version 1.2.31rc03 [August 19, 2008]
|
||||
Added PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED block, off by default, around
|
||||
new png_flush().
|
||||
|
||||
version 1.0.39, 1.2.31 [August 21, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.2.32beta01 [September 6, 2008]
|
||||
Shortened tIME_string to 29 bytes in pngtest.c (bug introduced in
|
||||
libpng-1.2.22).
|
||||
Fixed off-by-one error introduced in png_push_read_zTXt() function in
|
||||
libpng-1.2.30beta04/pngpread.c (Harald van Dijk)
|
||||
These bugs have been given the vulnerability id CVE-2008-3964.
|
||||
|
||||
version 1.0.40, 1.2.32 [September 18, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.2.33beta01 [October 6, 2008]
|
||||
Revised makefile.darwin to fix shared library numbering.
|
||||
Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8()
|
||||
in example.c (debian bug report)
|
||||
|
||||
version 1.2.33rc01 [October 15, 2008]
|
||||
No changes.
|
||||
|
||||
version 1.0.41rc01, version 1.2.33rc02 [October 31, 2008]
|
||||
Changed remaining "key" to "png_ptr->chunkdata" in png_handle_tEXt()
|
||||
to avoid memory leak after memory failure while reading tEXt chunk.`
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
16
png/INSTALL
16
png/INSTALL
@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.2.25 - February 18, 2008
|
||||
Installing libpng version 1.2.33 - October 31, 2008
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
@ -44,7 +44,7 @@ to have access to the zlib.h and zconf.h include files that
|
||||
correspond to the version of zlib that's installed.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.2.25" or "lpng109" and "zlib-1.2.1"
|
||||
might be called "libpng-1.2.33" or "lpng109" and "zlib-1.2.1"
|
||||
or "zlib121") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@ -101,9 +101,9 @@ include
|
||||
CMakeLists.txt => "cmake" script
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng12.so.0.1.2.25)
|
||||
gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.25)
|
||||
(gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@ -125,14 +125,14 @@ include
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng12.so.0.1.2.25)
|
||||
creates libpng12.so.0.1.2.33)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.25)
|
||||
creates libpng12.so.0.1.2.33)
|
||||
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.25)
|
||||
creates libpng12.so.0.1.2.33)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng12.so.0.1.2.25)
|
||||
creates libpng12.so.0.1.2.33)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
Known bugs in libpng version 1.2.25
|
||||
Known bugs in libpng version 1.2.33
|
||||
|
||||
1. February 23, 2006: The custom makefiles don't build libpng with -lz.
|
||||
|
||||
|
@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
|
||||
If you modify libpng you may insert additional notices immediately following
|
||||
this sentence.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.2.25, February 18, 2008, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.2.33, October 31, 2008, are
|
||||
Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
|
||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
with the following individual added to the list of Contributing Authors
|
||||
@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
February 18, 2008
|
||||
October 31, 2008
|
||||
|
27
png/README
27
png/README
@ -1,12 +1,15 @@
|
||||
README for libpng version 1.2.25 - February 18, 2008 (shared library 12.0)
|
||||
README for libpng version 1.2.33 - October 31, 2008 (shared library 12.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
|
||||
libpng-*.tar.lzma, or libpng-*.tar.bz2 if you want UNIX-style line
|
||||
endings in the text files, or lpng*.7z lpng*.zip if you want DOS-style
|
||||
line endings.
|
||||
endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style
|
||||
line endings. You can get UNIX-style line endings from the *.zip file
|
||||
by using "unzip -a" but there seems to be no simple way to recover
|
||||
UNIX-style line endings from the *.7z file. The *.tar.lzma file is
|
||||
recommended for *NIX users instead.
|
||||
|
||||
Version 0.89 was the first official release of libpng. Don't let the
|
||||
fact that it's the first release fool you. The libpng library has been in
|
||||
@ -55,7 +58,7 @@ to set different actions based on whether the CRC error occurred in a
|
||||
critical or an ancillary chunk.
|
||||
|
||||
The changes made to the library, and bugs fixed are based on discussions
|
||||
on the PNG-implement mailing list
|
||||
on the png-mng-implement mailing list
|
||||
and not on material submitted privately to Guy, Andreas, or Glenn. They will
|
||||
forward any good suggestions to the list.
|
||||
|
||||
@ -111,14 +114,14 @@ to subscribe) or to glennrp at users.sourceforge.net
|
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses
|
||||
given in previous versions of this document. He and Andreas will read mail
|
||||
addressed to the png-implement list, however.
|
||||
addressed to the png-mng-implement list, however.
|
||||
|
||||
Please do not send general questions about PNG. Send them to
|
||||
the (png-mng-misc at lists.sourceforge.net, subscription required, visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe)
|
||||
On the other hand,
|
||||
please do not send libpng questions to that address, send them to me
|
||||
or to the png-implement list. I'll
|
||||
or to the png-mng-implement list. I'll
|
||||
get them in the end anyway. If you have a question about something
|
||||
in the PNG specification that is related to using libpng, send it
|
||||
to me. Send me any questions that start with "I was using libpng,
|
||||
@ -191,11 +194,11 @@ Files in this distribution:
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng12.so.0.1.2.25)
|
||||
gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.25)
|
||||
(gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.25,
|
||||
(gcc, creates libpng12.so.0.1.2.33,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@ -217,12 +220,12 @@ Files in this distribution:
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics
|
||||
(gcc, creates libpng12.so.0.1.2.25)
|
||||
(gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng12.so.0.1.2.25)
|
||||
(gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng12.so.0.1.2.25)
|
||||
(gcc, creates libpng12.so.0.1.2.33)
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
makefile.64sunu => Sun Ultra 64-bit makefile
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
|
@ -1,13 +1,13 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
February 18, 2008
|
||||
October 31, 2008
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.2.25 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.2.33 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
|
559
png/libpng.3
559
png/libpng.3
File diff suppressed because it is too large
Load Diff
@ -1,13 +1,17 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.2.24 - December 14, 2007
|
||||
libpng version 1.2.33 - October 31, 2008
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2007 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
For conditions of distribution and use, see copyright
|
||||
notice in png.h.
|
||||
|
||||
based on:
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.2.33 - October 31, 2008
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
|
||||
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
||||
Updated and distributed by Andreas Dilger
|
||||
@ -47,12 +51,14 @@ a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at
|
||||
The W3C and ISO documents have identical technical content.
|
||||
|
||||
The PNG-1.2 specification is available at
|
||||
<http://www.libpng.org/pub/png/documents/>
|
||||
<http://www.libpng.org/pub/png/documents/>. It is technically equivalent
|
||||
to the PNG specification (second edition) but has some additional material.
|
||||
|
||||
The PNG-1.0 specification is available
|
||||
as RFC 2083 <http://www.libpng.org/pub/png/documents/> and as a
|
||||
W3C Recommendation <http://www.w3.org/TR/REC.png.html>. Some
|
||||
additional chunks are described in the special-purpose public chunks
|
||||
W3C Recommendation <http://www.w3.org/TR/REC.png.html>.
|
||||
|
||||
Some additional chunks are described in the special-purpose public chunks
|
||||
documents at <http://www.libpng.org/pub/png/documents/>.
|
||||
|
||||
Other information
|
||||
@ -260,15 +266,19 @@ input stream. You must supply the function
|
||||
png_unknown_chunkp chunk);
|
||||
{
|
||||
/* The unknown chunk structure contains your
|
||||
chunk data: */
|
||||
chunk data, along with similar data for any other
|
||||
unknown chunks: */
|
||||
|
||||
png_byte name[5];
|
||||
png_byte *data;
|
||||
png_size_t size;
|
||||
|
||||
/* Note that libpng has already taken care of
|
||||
the CRC handling */
|
||||
|
||||
/* put your code here. Return one of the
|
||||
following: */
|
||||
/* put your code here. Search for your chunk in the
|
||||
unknown chunk structure, process it, and return one
|
||||
of the following: */
|
||||
|
||||
return (-n); /* chunk had an error */
|
||||
return (0); /* did not recognize */
|
||||
@ -288,6 +298,11 @@ you can retrieve with
|
||||
|
||||
png_get_user_chunk_ptr(png_ptr);
|
||||
|
||||
If you call the png_set_read_user_chunk_fn() function, then all unknown
|
||||
chunks will be saved when read, in case your callback function will need
|
||||
one or more of them. This behavior can be changed with the
|
||||
png_set_keep_unknown_chunks() function, described below.
|
||||
|
||||
At this point, you can set up a callback function that will be
|
||||
called after each row has been read, which you can use to control
|
||||
a progress meter or the like. It's demonstrated in pngtest.c.
|
||||
@ -332,13 +347,14 @@ Unknown-chunk handling
|
||||
Now you get to set the way the library processes unknown chunks in the
|
||||
input PNG stream. Both known and unknown chunks will be read. Normal
|
||||
behavior is that known chunks will be parsed into information in
|
||||
various info_ptr members; unknown chunks will be discarded. To change
|
||||
this, you can call:
|
||||
various info_ptr members while unknown chunks will be discarded. This
|
||||
behavior can be wasteful if your application will never use some known
|
||||
chunk types. To change this, you can call:
|
||||
|
||||
png_set_keep_unknown_chunks(png_ptr, keep,
|
||||
chunk_list, num_chunks);
|
||||
keep - 0: do not handle as unknown
|
||||
1: do not keep
|
||||
keep - 0: default unknown chunk handling
|
||||
1: ignore; do not keep
|
||||
2: keep only if safe-to-copy
|
||||
3: keep even if unsafe-to-copy
|
||||
You can use these definitions:
|
||||
@ -361,6 +377,37 @@ instances of png_set_keep_unknown_chunks(), the final instance will
|
||||
take precedence. The IHDR and IEND chunks should not be named in
|
||||
chunk_list; if they are, libpng will process them normally anyway.
|
||||
|
||||
Here is an example of the usage of png_set_keep_unknown_chunks(),
|
||||
where the private "vpAg" chunk will later be processed by a user chunk
|
||||
callback function:
|
||||
|
||||
png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'};
|
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
png_byte unused_chunks[]=
|
||||
{
|
||||
104, 73, 83, 84, (png_byte) '\0', /* hIST */
|
||||
105, 84, 88, 116, (png_byte) '\0', /* iTXt */
|
||||
112, 67, 65, 76, (png_byte) '\0', /* pCAL */
|
||||
115, 67, 65, 76, (png_byte) '\0', /* sCAL */
|
||||
115, 80, 76, 84, (png_byte) '\0', /* sPLT */
|
||||
116, 73, 77, 69, (png_byte) '\0', /* tIME */
|
||||
};
|
||||
#endif
|
||||
|
||||
...
|
||||
|
||||
#if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED)
|
||||
/* ignore all unknown chunks: */
|
||||
png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0);
|
||||
/* except for vpAg: */
|
||||
png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1);
|
||||
/* also ignore unused known chunks: */
|
||||
png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks,
|
||||
(int)sizeof(unused_chunks)/5);
|
||||
#endif
|
||||
|
||||
|
||||
The high-level read interface
|
||||
|
||||
At this point there are two ways to proceed; through the high-level
|
||||
@ -804,6 +851,7 @@ added. It expands the sample depth without changing tRNS to alpha.
|
||||
At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it
|
||||
will be removed from a future version.
|
||||
|
||||
|
||||
PNG can have files with 16 bits per channel. If you only can handle
|
||||
8 bits per channel, this will strip the pixels down to 8 bit.
|
||||
|
||||
@ -1743,6 +1791,11 @@ Some of the more important parts of the png_info are:
|
||||
can also be
|
||||
PNG_INTRAPIXEL_DIFFERENCING)
|
||||
|
||||
If you call png_set_IHDR(), the call must appear before any of the
|
||||
other png_set_*() functions, which might require access to some of
|
||||
the IHDR settings. The remaining png_set_*() functions can be called
|
||||
in any order.
|
||||
|
||||
png_set_PLTE(png_ptr, info_ptr, palette,
|
||||
num_palette);
|
||||
palette - the palette for the file
|
||||
@ -2391,6 +2444,9 @@ Your malloc_fn() must return NULL in case of failure. The png_malloc()
|
||||
function will normally call png_error() if it receives a NULL from the
|
||||
system memory allocator or from your replacement malloc_fn().
|
||||
|
||||
Your free_fn() will never be called with a NULL ptr, since libpng's
|
||||
png_free() checks for NULL before calling free_fn().
|
||||
|
||||
Input/Output in libpng is done through png_read() and png_write(),
|
||||
which currently just call fread() and fwrite(). The FILE * is stored in
|
||||
png_struct and is initialized via png_init_io(). If you wish to change
|
||||
@ -2796,13 +2852,13 @@ application:
|
||||
|
||||
IX. Y2K Compliance in libpng
|
||||
|
||||
December 14, 2007
|
||||
October 31, 2008
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.2.24 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.2.33 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
|
522
png/libpngpf.3
522
png/libpngpf.3
@ -1,266 +1,782 @@
|
||||
.TH LIBPNGPF 3 "February 18, 2008"
|
||||
.TH LIBPNGPF 3 "October 31, 2008"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.25
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.33
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||
|
||||
\fBpng_charp png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_dither (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIdither_lookup\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_read_chunk_header (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
.SH DESCRIPTION
|
||||
The functions listed above are used privately by libpng
|
||||
and are not recommended for use by applications. They are
|
||||
|
@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "February 18, 2008"
|
||||
.TH PNG 5 "October 31, 2008"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
@ -35,7 +35,7 @@ PNG 1.0 specification, October 1996:
|
||||
RFC 2083
|
||||
.IP
|
||||
.br
|
||||
ftp://ds.internic.net/rfc/rfc2083.txt
|
||||
ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt
|
||||
.br
|
||||
or (as a W3C Recommendation) at
|
||||
.br
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.2.21 October 4, 2007
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -13,7 +13,7 @@
|
||||
#include "png.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_25 Your_png_h_is_not_version_1_2_25;
|
||||
typedef version_1_2_33 Your_png_h_is_not_version_1_2_33;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h. */
|
||||
@ -380,11 +380,11 @@ if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, info_ptr->trans);
|
||||
info_ptr->trans = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_tRNS;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
info_ptr->trans = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -490,6 +490,7 @@ if (mask & PNG_FREE_SPLT)
|
||||
png_free(png_ptr, png_ptr->unknown_chunk.data);
|
||||
png_ptr->unknown_chunk.data = NULL;
|
||||
}
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
|
||||
#else
|
||||
@ -693,7 +694,7 @@ png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) "\n libpng version 1.2.25 - February 18, 2008\n\
|
||||
return ((png_charp) "\n libpng version 1.2.33 - October 31, 2008\n\
|
||||
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\n\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
|
||||
|
76
png/png.h
76
png/png.h
@ -1,7 +1,6 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.2.25 - February 18, 2008
|
||||
* libpng version 1.2.33 - October 31, 2008
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@ -9,7 +8,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.2.25 - February 18, 2008: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.2.33 - October 31, 2008: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@ -177,6 +176,42 @@
|
||||
* 1.2.24 13 10224 12.so.0.24[.0]
|
||||
* 1.2.25beta01-06 13 10225 12.so.0.25[.0]
|
||||
* 1.2.25rc01-02 13 10225 12.so.0.25[.0]
|
||||
* 1.0.31 10 10031 10.so.0.31[.0]
|
||||
* 1.2.25 13 10225 12.so.0.25[.0]
|
||||
* 1.2.26beta01-06 13 10226 12.so.0.26[.0]
|
||||
* 1.2.26rc01 13 10226 12.so.0.26[.0]
|
||||
* 1.2.26 13 10226 12.so.0.26[.0]
|
||||
* 1.0.32 10 10032 10.so.0.32[.0]
|
||||
* 1.2.27beta01-06 13 10227 12.so.0.27[.0]
|
||||
* 1.2.27rc01 13 10227 12.so.0.27[.0]
|
||||
* 1.0.33 10 10033 10.so.0.33[.0]
|
||||
* 1.2.27 13 10227 12.so.0.27[.0]
|
||||
* 1.0.34 10 10034 10.so.0.34[.0]
|
||||
* 1.2.28 13 10228 12.so.0.28[.0]
|
||||
* 1.2.29beta01-03 13 10229 12.so.0.29[.0]
|
||||
* 1.2.29rc01 13 10229 12.so.0.29[.0]
|
||||
* 1.0.35 10 10035 10.so.0.35[.0]
|
||||
* 1.2.29 13 10229 12.so.0.29[.0]
|
||||
* 1.0.37 10 10037 10.so.0.37[.0]
|
||||
* 1.2.30beta01-04 13 10230 12.so.0.30[.0]
|
||||
* 1.0.38rc01-08 10 10038 10.so.0.38[.0]
|
||||
* 1.2.30rc01-08 13 10230 12.so.0.30[.0]
|
||||
* 1.0.38 10 10038 10.so.0.38[.0]
|
||||
* 1.2.30 13 10230 12.so.0.30[.0]
|
||||
* 1.0.39rc01-03 10 10039 10.so.0.39[.0]
|
||||
* 1.2.31rc01-03 13 10231 12.so.0.31[.0]
|
||||
* 1.0.39 10 10039 10.so.0.39[.0]
|
||||
* 1.2.31 13 10231 12.so.0.31[.0]
|
||||
* 1.2.32beta01-02 13 10232 12.so.0.32[.0]
|
||||
* 1.0.40rc01 10 10040 10.so.0.40[.0]
|
||||
* 1.2.32rc01 13 10232 12.so.0.32[.0]
|
||||
* 1.0.40 10 10040 10.so.0.40[.0]
|
||||
* 1.2.32 13 10232 12.so.0.32[.0]
|
||||
* 1.2.33beta01-02 13 10233 12.so.0.33[.0]
|
||||
* 1.2.33rc01-02 13 10233 12.so.0.33[.0]
|
||||
* 1.0.41rc01 10 10041 10.so.0.41[.0]
|
||||
* 1.2.33 13 10233 12.so.0.33[.0]
|
||||
* 1.0.41 10 10041 10.so.0.41[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@ -186,7 +221,7 @@
|
||||
* to the source version x.y.z (leading zeros in y and z). Beta versions
|
||||
* were given the previous public release number plus a letter, until
|
||||
* version 1.0.6j; from then on they were given the upcoming public
|
||||
* release number plus "betaNN" or "rcN".
|
||||
* release number plus "betaNN" or "rcNN".
|
||||
*
|
||||
* Binary incompatibility exists only when applications make direct access
|
||||
* to the info_ptr or png_ptr members through png.h, and the compiled
|
||||
@ -206,7 +241,7 @@
|
||||
* If you modify libpng you may insert additional notices immediately following
|
||||
* this sentence.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.25, February 18, 2008, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.2.33, October 31, 2008, are
|
||||
* Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
|
||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
* with the following individual added to the list of Contributing Authors:
|
||||
@ -318,13 +353,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* February 18, 2008
|
||||
* October 31, 2008
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.2.25 are Y2K compliant. It is my belief that earlier
|
||||
* upward through 1.2.33 are Y2K compliant. It is my belief that earlier
|
||||
* versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has three year fields. One is a 2-byte unsigned integer
|
||||
@ -380,9 +415,9 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.25"
|
||||
#define PNG_LIBPNG_VER_STRING "1.2.33"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.2.25 - February 18, 2008\n"
|
||||
" libpng version 1.2.33 - October 31, 2008\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 0
|
||||
#define PNG_LIBPNG_VER_DLLNUM 13
|
||||
@ -390,7 +425,7 @@
|
||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 2
|
||||
#define PNG_LIBPNG_VER_RELEASE 25
|
||||
#define PNG_LIBPNG_VER_RELEASE 33
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
|
||||
|
||||
@ -418,7 +453,7 @@
|
||||
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
|
||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
|
||||
#define PNG_LIBPNG_VER 10225 /* 1.2.25 */
|
||||
#define PNG_LIBPNG_VER 10233 /* 1.2.33 */
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
/* include the compression library's header */
|
||||
@ -1189,7 +1224,7 @@ struct png_struct_def
|
||||
png_uint_32 row_number; /* current row in interlace pass */
|
||||
png_bytep prev_row; /* buffer to save previous (unfiltered) row */
|
||||
png_bytep row_buf; /* buffer to save current (unfiltered) row */
|
||||
#ifndef PNG_NO_WRITE_FILTERING
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
png_bytep sub_row; /* buffer to save "sub" row when filtering */
|
||||
png_bytep up_row; /* buffer to save "up" row when filtering */
|
||||
png_bytep avg_row; /* buffer to save "avg" row when filtering */
|
||||
@ -1426,13 +1461,20 @@ struct png_struct_def
|
||||
/* storage for unknown chunk that the library doesn't recognize. */
|
||||
png_unknown_chunk unknown_chunk;
|
||||
#endif
|
||||
|
||||
/* New members added in libpng-1.2.26 */
|
||||
png_uint_32 old_big_row_buf_size, old_prev_row_size;
|
||||
|
||||
/* New member added in libpng-1.2.30 */
|
||||
png_charp chunkdata; /* buffer for reading chunk data */
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef png_structp version_1_2_25;
|
||||
typedef png_structp version_1_2_33;
|
||||
|
||||
typedef png_struct FAR * FAR * png_structpp;
|
||||
|
||||
@ -2627,6 +2669,7 @@ 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 */
|
||||
|
||||
#ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
||||
@ -3008,8 +3051,8 @@ PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
|
||||
/* Decompress data in a chunk that uses compression */
|
||||
#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
|
||||
defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
|
||||
PNG_EXTERN png_charp png_decompress_chunk PNGARG((png_structp png_ptr,
|
||||
int comp_type, png_charp chunkdata, png_size_t chunklength,
|
||||
PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
|
||||
int comp_type, png_size_t chunklength,
|
||||
png_size_t prefix_length, png_size_t *data_length));
|
||||
#endif
|
||||
|
||||
@ -3538,6 +3581,9 @@ png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type));
|
||||
#endif /* PNG_pHYs_SUPPORTED */
|
||||
#endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */
|
||||
|
||||
/* Read the chunk header (length + type name) */
|
||||
PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
|
||||
#endif /* PNG_INTERNAL */
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.2.25 - February 18, 2008
|
||||
* libpng version 1.2.33 - October 31, 2008
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.22 [October 13, 2007]
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -15,8 +15,8 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
static void /* PRIVATE */
|
||||
png_default_error PNGARG((png_structp png_ptr,
|
||||
png_const_charp error_message));
|
||||
@ -44,16 +44,17 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
||||
{
|
||||
if (*error_message == '#')
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of error message. */
|
||||
int offset;
|
||||
for (offset=1; offset<15; offset++)
|
||||
if (*(error_message+offset) == ' ')
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<offset-1; i++)
|
||||
msg[i]=error_message[i+1];
|
||||
msg[i]='\0';
|
||||
msg[i - 1] = '\0';
|
||||
error_message=msg;
|
||||
}
|
||||
else
|
||||
@ -111,7 +112,7 @@ png_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
if (*warning_message == '#')
|
||||
{
|
||||
for (offset=1; offset<15; offset++)
|
||||
if (*(warning_message+offset) == ' ')
|
||||
if (warning_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -216,19 +217,20 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
if (*error_message == '#')
|
||||
{
|
||||
/* Strip "#nnnn " from beginning of warning message. */
|
||||
int offset;
|
||||
char error_number[16];
|
||||
for (offset=0; offset<15; offset++)
|
||||
{
|
||||
error_number[offset] = *(error_message+offset+1);
|
||||
if (*(error_message+offset) == ' ')
|
||||
error_number[offset] = error_message[offset + 1];
|
||||
if (error_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
if((offset > 1) && (offset < 15))
|
||||
{
|
||||
error_number[offset-1]='\0';
|
||||
fprintf(stderr, "libpng error no. %s: %s\n", error_number,
|
||||
error_message+offset);
|
||||
error_message + offset + 1);
|
||||
}
|
||||
else
|
||||
fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset);
|
||||
@ -276,13 +278,13 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
char warning_number[16];
|
||||
for (offset=0; offset<15; offset++)
|
||||
{
|
||||
warning_number[offset]=*(warning_message+offset+1);
|
||||
if (*(warning_message+offset) == ' ')
|
||||
warning_number[offset] = warning_message[offset + 1];
|
||||
if (warning_message[offset] == ' ')
|
||||
break;
|
||||
}
|
||||
if((offset > 1) && (offset < 15))
|
||||
{
|
||||
warning_number[offset-1]='\0';
|
||||
warning_number[offset + 1] = '\0';
|
||||
fprintf(stderr, "libpng warning no. %s: %s\n", warning_number,
|
||||
warning_message+offset);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.2.15 January 5, 2007
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
|
11
png/pngmem.c
11
png/pngmem.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.13 November 13, 2006
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -16,7 +16,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
/* Borland DOS special memory handler */
|
||||
@ -273,6 +272,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
/* free a pointer allocated by png_malloc(). In the default
|
||||
configuration, png_ptr is not used, but is passed in case it
|
||||
is needed. If ptr is NULL, return without taking any action. */
|
||||
|
||||
void PNGAPI
|
||||
png_free(png_structp png_ptr, png_voidp ptr)
|
||||
{
|
||||
@ -293,7 +293,7 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
|
||||
{
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
|
||||
if(png_ptr == NULL) return;
|
||||
if (png_ptr == NULL || ptr == NULL) return;
|
||||
|
||||
if (png_ptr->offset_table != NULL)
|
||||
{
|
||||
@ -456,7 +456,7 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
if (size > (png_uint_32)65536L)
|
||||
{
|
||||
#ifndef PNG_USER_MEM_SUPPORTED
|
||||
if(png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Cannot Allocate > 64K");
|
||||
else
|
||||
#endif
|
||||
@ -587,7 +587,8 @@ void PNGAPI
|
||||
png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
|
||||
malloc_fn, png_free_ptr free_fn)
|
||||
{
|
||||
if(png_ptr != NULL) {
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
png_ptr->mem_ptr = mem_ptr;
|
||||
png_ptr->malloc_fn = malloc_fn;
|
||||
png_ptr->free_fn = free_fn;
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.2.25 [February 18, 2008]
|
||||
* Last changed in libpng 1.2.32 [September 18, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
|
||||
/* push model modes */
|
||||
@ -213,6 +212,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
png_ptr->push_length = png_get_uint_31(png_ptr,chunk_length);
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
|
||||
}
|
||||
|
||||
@ -222,6 +222,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
|
||||
{
|
||||
if (png_ptr->push_length != 13)
|
||||
png_error(png_ptr, "Invalid IHDR length");
|
||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
||||
{
|
||||
png_push_save_buffer(png_ptr);
|
||||
@ -1018,23 +1020,21 @@ png_read_push_finish_row(png_structp png_ptr)
|
||||
png_ptr->rowbytes + 1);
|
||||
do
|
||||
{
|
||||
int pass;
|
||||
pass = png_ptr->pass;
|
||||
pass++;
|
||||
if ((pass == 1 && png_ptr->width < 5) ||
|
||||
(pass == 3 && png_ptr->width < 3) ||
|
||||
(pass == 5 && png_ptr->width < 2))
|
||||
pass++;
|
||||
png_ptr->pass++;
|
||||
if ((png_ptr->pass == 1 && png_ptr->width < 5) ||
|
||||
(png_ptr->pass == 3 && png_ptr->width < 3) ||
|
||||
(png_ptr->pass == 5 && png_ptr->width < 2))
|
||||
png_ptr->pass++;
|
||||
|
||||
if (png_ptr->pass > 7)
|
||||
png_ptr->pass--;
|
||||
if (png_ptr->pass >= 7)
|
||||
break;
|
||||
|
||||
if (pass > 7)
|
||||
pass--;
|
||||
png_ptr->pass = (png_byte) pass;
|
||||
if (pass < 7)
|
||||
{
|
||||
png_ptr->iwidth = (png_ptr->width +
|
||||
png_pass_inc[pass] - 1 -
|
||||
png_pass_start[pass]) /
|
||||
png_pass_inc[pass];
|
||||
png_pass_inc[png_ptr->pass] - 1 -
|
||||
png_pass_start[png_ptr->pass]) /
|
||||
png_pass_inc[png_ptr->pass];
|
||||
|
||||
png_ptr->irowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,
|
||||
png_ptr->iwidth) + 1;
|
||||
@ -1043,12 +1043,9 @@ png_read_push_finish_row(png_structp png_ptr)
|
||||
break;
|
||||
|
||||
png_ptr->num_rows = (png_ptr->height +
|
||||
png_pass_yinc[pass] - 1 -
|
||||
png_pass_ystart[pass]) /
|
||||
png_pass_yinc[pass];
|
||||
}
|
||||
else
|
||||
break;
|
||||
png_pass_yinc[png_ptr->pass] - 1 -
|
||||
png_pass_ystart[png_ptr->pass]) /
|
||||
png_pass_yinc[png_ptr->pass];
|
||||
|
||||
} while (png_ptr->iwidth == 0 || png_ptr->num_rows == 0);
|
||||
}
|
||||
@ -1266,8 +1263,8 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
if (text == NULL)
|
||||
{
|
||||
text = (png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out
|
||||
+ key_size + 1));
|
||||
(png_uint_32)(png_ptr->zbuf_size
|
||||
- png_ptr->zstream.avail_out + key_size + 1));
|
||||
png_memcpy(text + key_size, png_ptr->zbuf,
|
||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out);
|
||||
png_memcpy(text, key, key_size);
|
||||
@ -1281,8 +1278,8 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
tmp = text;
|
||||
text = (png_charp)png_malloc(png_ptr, text_size +
|
||||
(png_uint_32)(png_ptr->zbuf_size - png_ptr->zstream.avail_out
|
||||
+ 1));
|
||||
(png_uint_32)(png_ptr->zbuf_size
|
||||
- png_ptr->zstream.avail_out + 1));
|
||||
png_memcpy(text, tmp, text_size);
|
||||
png_free(png_ptr, tmp);
|
||||
png_memcpy(text + text_size, png_ptr->zbuf,
|
||||
@ -1467,7 +1464,6 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
length)
|
||||
{
|
||||
png_uint_32 skip=0;
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
|
||||
if (!(png_ptr->chunk_name[0] & 0x20))
|
||||
{
|
||||
@ -1498,11 +1494,18 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
png_memcpy((png_charp)png_ptr->unknown_chunk.name,
|
||||
(png_charp)png_ptr->chunk_name,
|
||||
png_sizeof(png_ptr->unknown_chunk.name));
|
||||
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name)-1]='\0';
|
||||
png_ptr->unknown_chunk.name[png_sizeof(png_ptr->unknown_chunk.name) - 1]
|
||||
= '\0';
|
||||
|
||||
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, length);
|
||||
png_ptr->unknown_chunk.size = (png_size_t)length;
|
||||
if (length == 0)
|
||||
png_ptr->unknown_chunk.data = NULL;
|
||||
else
|
||||
{
|
||||
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)length);
|
||||
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
|
||||
}
|
||||
#if defined(PNG_READ_USER_CHUNKS_SUPPORTED)
|
||||
if(png_ptr->read_user_chunk_fn != NULL)
|
||||
{
|
||||
|
146
png/pngread.c
146
png/pngread.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.25 [February 18, 2008]
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -13,7 +13,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED)
|
||||
|
||||
/* Create a PNG structure for reading, and allocate any memory needed. */
|
||||
@ -35,6 +34,9 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
{
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
volatile
|
||||
#endif
|
||||
png_structp png_ptr;
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
@ -406,38 +408,29 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
PNG_CONST PNG_zTXt;
|
||||
#endif
|
||||
#endif /* PNG_USE_LOCAL_ARRAYS */
|
||||
png_byte chunk_length[4];
|
||||
png_uint_32 length;
|
||||
|
||||
png_read_data(png_ptr, chunk_length, 4);
|
||||
length = png_get_uint_31(png_ptr,chunk_length);
|
||||
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
|
||||
png_debug2(0, "Reading %s chunk, length=%lu.\n", png_ptr->chunk_name,
|
||||
length);
|
||||
png_uint_32 length = png_read_chunk_header(png_ptr);
|
||||
PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
|
||||
|
||||
/* This should be a binary subdivision search or a hash for
|
||||
* matching the chunk name rather than a linear search.
|
||||
*/
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
if(png_ptr->mode & PNG_AFTER_IDAT)
|
||||
png_ptr->mode |= PNG_HAVE_CHUNK_AFTER_IDAT;
|
||||
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
|
||||
if (!png_memcmp(chunk_name, png_IHDR, 4))
|
||||
png_handle_IHDR(png_ptr, info_ptr, length);
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
|
||||
else if (!png_memcmp(chunk_name, png_IEND, 4))
|
||||
png_handle_IEND(png_ptr, info_ptr, length);
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name))
|
||||
else if (png_handle_as_unknown(png_ptr, chunk_name))
|
||||
{
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
png_ptr->mode |= PNG_HAVE_IDAT;
|
||||
png_handle_unknown(png_ptr, info_ptr, length);
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||
if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
png_ptr->mode |= PNG_HAVE_PLTE;
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
{
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before IDAT");
|
||||
@ -448,9 +441,9 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||
else if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
png_handle_PLTE(png_ptr, info_ptr, length);
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
{
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before IDAT");
|
||||
@ -463,71 +456,71 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
break;
|
||||
}
|
||||
#if defined(PNG_READ_bKGD_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4))
|
||||
else if (!png_memcmp(chunk_name, png_bKGD, 4))
|
||||
png_handle_bKGD(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_cHRM_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4))
|
||||
else if (!png_memcmp(chunk_name, png_cHRM, 4))
|
||||
png_handle_cHRM(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_gAMA_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4))
|
||||
else if (!png_memcmp(chunk_name, png_gAMA, 4))
|
||||
png_handle_gAMA(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_hIST_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4))
|
||||
else if (!png_memcmp(chunk_name, png_hIST, 4))
|
||||
png_handle_hIST(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_oFFs_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4))
|
||||
else if (!png_memcmp(chunk_name, png_oFFs, 4))
|
||||
png_handle_oFFs(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_pCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4))
|
||||
else if (!png_memcmp(chunk_name, png_pCAL, 4))
|
||||
png_handle_pCAL(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sCAL, 4))
|
||||
png_handle_sCAL(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_pHYs_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4))
|
||||
else if (!png_memcmp(chunk_name, png_pHYs, 4))
|
||||
png_handle_pHYs(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sBIT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sBIT, 4))
|
||||
png_handle_sBIT(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sRGB_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sRGB, 4))
|
||||
png_handle_sRGB(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_iCCP_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4))
|
||||
else if (!png_memcmp(chunk_name, png_iCCP, 4))
|
||||
png_handle_iCCP(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sPLT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sPLT, 4))
|
||||
png_handle_sPLT(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tEXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tEXt, 4))
|
||||
png_handle_tEXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tIME_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tIME, 4))
|
||||
png_handle_tIME(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tRNS_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tRNS, 4))
|
||||
png_handle_tRNS(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_zTXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_zTXt, 4))
|
||||
png_handle_zTXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_iTXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_iTXt, 4))
|
||||
png_handle_iTXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
else
|
||||
@ -703,15 +696,9 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
{
|
||||
while (!png_ptr->idat_size)
|
||||
{
|
||||
png_byte chunk_length[4];
|
||||
|
||||
png_crc_finish(png_ptr, 0);
|
||||
|
||||
png_read_data(png_ptr, chunk_length, 4);
|
||||
png_ptr->idat_size = png_get_uint_31(png_ptr,chunk_length);
|
||||
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
png_ptr->idat_size = png_read_chunk_header(png_ptr);
|
||||
if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
png_error(png_ptr, "Not enough image data");
|
||||
}
|
||||
@ -920,9 +907,6 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
void PNGAPI
|
||||
png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
png_byte chunk_length[4];
|
||||
png_uint_32 length;
|
||||
|
||||
png_debug(1, "in png_read_end\n");
|
||||
if(png_ptr == NULL) return;
|
||||
png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
|
||||
@ -986,33 +970,27 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
PNG_CONST PNG_zTXt;
|
||||
#endif
|
||||
#endif /* PNG_USE_LOCAL_ARRAYS */
|
||||
png_uint_32 length = png_read_chunk_header(png_ptr);
|
||||
PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
|
||||
|
||||
png_read_data(png_ptr, chunk_length, 4);
|
||||
length = png_get_uint_31(png_ptr,chunk_length);
|
||||
|
||||
png_reset_crc(png_ptr);
|
||||
png_crc_read(png_ptr, png_ptr->chunk_name, 4);
|
||||
|
||||
png_debug1(0, "Reading %s chunk.\n", png_ptr->chunk_name);
|
||||
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IHDR, 4))
|
||||
if (!png_memcmp(chunk_name, png_IHDR, 4))
|
||||
png_handle_IHDR(png_ptr, info_ptr, length);
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IEND, 4))
|
||||
else if (!png_memcmp(chunk_name, png_IEND, 4))
|
||||
png_handle_IEND(png_ptr, info_ptr, length);
|
||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
||||
else if (png_handle_as_unknown(png_ptr, png_ptr->chunk_name))
|
||||
else if (png_handle_as_unknown(png_ptr, chunk_name))
|
||||
{
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
{
|
||||
if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
|
||||
png_error(png_ptr, "Too many IDAT's found");
|
||||
}
|
||||
png_handle_unknown(png_ptr, info_ptr, length);
|
||||
if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||
if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
png_ptr->mode |= PNG_HAVE_PLTE;
|
||||
}
|
||||
#endif
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_IDAT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
{
|
||||
/* Zero length IDATs are legal after the last IDAT has been
|
||||
* read, but not after other chunks have been read.
|
||||
@ -1021,74 +999,74 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
png_error(png_ptr, "Too many IDAT's found");
|
||||
png_crc_finish(png_ptr, length);
|
||||
}
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_PLTE, 4))
|
||||
else if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
png_handle_PLTE(png_ptr, info_ptr, length);
|
||||
#if defined(PNG_READ_bKGD_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_bKGD, 4))
|
||||
else if (!png_memcmp(chunk_name, png_bKGD, 4))
|
||||
png_handle_bKGD(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_cHRM_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_cHRM, 4))
|
||||
else if (!png_memcmp(chunk_name, png_cHRM, 4))
|
||||
png_handle_cHRM(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_gAMA_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_gAMA, 4))
|
||||
else if (!png_memcmp(chunk_name, png_gAMA, 4))
|
||||
png_handle_gAMA(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_hIST_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_hIST, 4))
|
||||
else if (!png_memcmp(chunk_name, png_hIST, 4))
|
||||
png_handle_hIST(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_oFFs_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_oFFs, 4))
|
||||
else if (!png_memcmp(chunk_name, png_oFFs, 4))
|
||||
png_handle_oFFs(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_pCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_pCAL, 4))
|
||||
else if (!png_memcmp(chunk_name, png_pCAL, 4))
|
||||
png_handle_pCAL(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sCAL_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sCAL, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sCAL, 4))
|
||||
png_handle_sCAL(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_pHYs_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_pHYs, 4))
|
||||
else if (!png_memcmp(chunk_name, png_pHYs, 4))
|
||||
png_handle_pHYs(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sBIT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sBIT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sBIT, 4))
|
||||
png_handle_sBIT(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sRGB_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sRGB, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sRGB, 4))
|
||||
png_handle_sRGB(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_iCCP_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_iCCP, 4))
|
||||
else if (!png_memcmp(chunk_name, png_iCCP, 4))
|
||||
png_handle_iCCP(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_sPLT_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_sPLT, 4))
|
||||
else if (!png_memcmp(chunk_name, png_sPLT, 4))
|
||||
png_handle_sPLT(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tEXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tEXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tEXt, 4))
|
||||
png_handle_tEXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tIME_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tIME, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tIME, 4))
|
||||
png_handle_tIME(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_tRNS_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_tRNS, 4))
|
||||
else if (!png_memcmp(chunk_name, png_tRNS, 4))
|
||||
png_handle_tRNS(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_zTXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_zTXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_zTXt, 4))
|
||||
png_handle_zTXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
#if defined(PNG_READ_iTXt_SUPPORTED)
|
||||
else if (!png_memcmp(png_ptr->chunk_name, png_iTXt, 4))
|
||||
else if (!png_memcmp(chunk_name, png_iTXt, 4))
|
||||
png_handle_iTXt(png_ptr, info_ptr, length);
|
||||
#endif
|
||||
else
|
||||
@ -1111,9 +1089,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
|
||||
png_debug(1, "in png_destroy_read_struct\n");
|
||||
if (png_ptr_ptr != NULL)
|
||||
{
|
||||
png_ptr = *png_ptr_ptr;
|
||||
}
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
@ -1159,6 +1135,8 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
*end_info_ptr_ptr = NULL;
|
||||
}
|
||||
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr, (png_free_ptr)free_fn,
|
||||
(png_voidp)mem_ptr);
|
||||
@ -1167,6 +1145,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
#endif
|
||||
*png_ptr_ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* free all memory used by the read (old method) */
|
||||
void /* PRIVATE */
|
||||
@ -1192,6 +1171,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_free(png_ptr, png_ptr->big_row_buf);
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
#if defined(PNG_READ_DITHER_SUPPORTED)
|
||||
png_free(png_ptr, png_ptr->palette_lookup);
|
||||
png_free(png_ptr, png_ptr->dither_index);
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.2.13 November 13, 2006
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -17,7 +17,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED)
|
||||
|
||||
/* Read the data from whatever input you are using. The default routine
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.2.25 [February 18, 2008]
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED)
|
||||
|
||||
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
|
||||
@ -39,7 +38,8 @@ png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
|
||||
PNG_FLAG_CRC_CRITICAL_IGNORE;
|
||||
break;
|
||||
case PNG_CRC_WARN_DISCARD: /* not a valid action for critical data */
|
||||
png_warning(png_ptr, "Can't discard critical data on CRC error.");
|
||||
png_warning(png_ptr,
|
||||
"Can't discard critical data on CRC error.");
|
||||
case PNG_CRC_ERROR_QUIT: /* error/quit */
|
||||
case PNG_CRC_DEFAULT:
|
||||
default:
|
||||
@ -548,9 +548,7 @@ png_set_expand(png_structp png_ptr)
|
||||
png_debug(1, "in png_set_expand\n");
|
||||
if(png_ptr == NULL) return;
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
#ifdef PNG_WARN_UNINITIALIZED_ROW
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* GRR 19990627: the following three functions currently are identical
|
||||
@ -577,9 +575,7 @@ png_set_palette_to_rgb(png_structp png_ptr)
|
||||
png_debug(1, "in png_set_palette_to_rgb\n");
|
||||
if(png_ptr == NULL) return;
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
#ifdef PNG_WARN_UNINITIALIZED_ROW
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(PNG_1_0_X)
|
||||
@ -590,9 +586,7 @@ png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n");
|
||||
if(png_ptr == NULL) return;
|
||||
png_ptr->transformations |= PNG_EXPAND;
|
||||
#ifdef PNG_WARN_UNINITIALIZED_ROW
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -615,9 +609,7 @@ png_set_tRNS_to_alpha(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_tRNS_to_alpha\n");
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
#ifdef PNG_WARN_UNINITIALIZED_ROW
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
#endif
|
||||
}
|
||||
#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
|
||||
|
||||
@ -627,9 +619,7 @@ png_set_gray_to_rgb(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_gray_to_rgb\n");
|
||||
png_ptr->transformations |= PNG_GRAY_TO_RGB;
|
||||
#ifdef PNG_WARN_UNINITIALIZED_ROW
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -669,7 +659,8 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
png_ptr->transformations |= PNG_EXPAND;
|
||||
#else
|
||||
{
|
||||
png_warning(png_ptr, "Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED.");
|
||||
png_warning(png_ptr,
|
||||
"Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED.");
|
||||
png_ptr->transformations &= ~PNG_RGB_TO_GRAY;
|
||||
}
|
||||
#endif
|
||||
@ -693,7 +684,8 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
}
|
||||
png_ptr->rgb_to_gray_red_coeff = red_int;
|
||||
png_ptr->rgb_to_gray_green_coeff = green_int;
|
||||
png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768-red_int-green_int);
|
||||
png_ptr->rgb_to_gray_blue_coeff =
|
||||
(png_uint_16)(32768 - red_int - green_int);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -967,7 +959,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
/* Prevent the transformations being done again, and make sure
|
||||
* that the now spurious alpha channel is stripped - the code
|
||||
* has just reduced background composition and gamma correction
|
||||
* to a simply alpha channel strip.
|
||||
* to a simple alpha channel strip.
|
||||
*/
|
||||
png_ptr->transformations &= ~PNG_BACKGROUND;
|
||||
png_ptr->transformations &= ~PNG_GAMMA;
|
||||
@ -1138,7 +1130,8 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (png_ptr->num_trans && (png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
if (png_ptr->num_trans &&
|
||||
(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||
else
|
||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
||||
@ -1151,8 +1144,10 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
if (png_ptr->transformations & PNG_EXPAND_tRNS)
|
||||
info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
|
||||
#if 0 /* Removed from libpng-1.2.27 */
|
||||
else
|
||||
info_ptr->color_type |= PNG_COLOR_MASK_COLOR;
|
||||
#endif
|
||||
}
|
||||
if (info_ptr->bit_depth < 8)
|
||||
info_ptr->bit_depth = 8;
|
||||
@ -1280,7 +1275,7 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
char msg[50];
|
||||
|
||||
png_snprintf2(msg, 50,
|
||||
"NULL row buffer for row %ld, pass %d", png_ptr->row_number,
|
||||
"NULL row buffer for row %ld, pass %d", (long)png_ptr->row_number,
|
||||
png_ptr->pass);
|
||||
png_error(png_ptr, msg);
|
||||
#else
|
||||
@ -2217,8 +2212,10 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
||||
#if defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)
|
||||
/* reduce RGB files to grayscale, with or without alpha
|
||||
* using the equation given in Poynton's ColorFAQ at
|
||||
* <http://www.inforamp.net/~poynton/>
|
||||
* Copyright (c) 1998-01-04 Charles Poynton poynton at inforamp.net
|
||||
* <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008)
|
||||
* New link:
|
||||
* <http://www.poynton.com/notes/colour_and_gamma/>
|
||||
* Charles Poynton poynton at poynton.com
|
||||
*
|
||||
* Y = 0.212671 * R + 0.715160 * G + 0.072169 * B
|
||||
*
|
||||
|
432
png/pngrutil.c
432
png/pngrutil.c
File diff suppressed because it is too large
Load Diff
98
png/pngset.c
98
png/pngset.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.2.25 [February 18, 2008]
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -15,7 +15,6 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
#if defined(PNG_bKGD_SUPPORTED)
|
||||
@ -396,7 +395,8 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
return;
|
||||
|
||||
length = png_strlen(purpose) + 1;
|
||||
png_debug1(3, "allocating purpose for info (%lu bytes)\n", length);
|
||||
png_debug1(3, "allocating purpose for info (%lu bytes)\n",
|
||||
(unsigned long)length);
|
||||
info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_purpose == NULL)
|
||||
{
|
||||
@ -412,7 +412,8 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->pcal_nparams = (png_byte)nparams;
|
||||
|
||||
length = png_strlen(units) + 1;
|
||||
png_debug1(3, "allocating units for info (%lu bytes)\n", length);
|
||||
png_debug1(3, "allocating units for info (%lu bytes)\n",
|
||||
(unsigned long)length);
|
||||
info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_units == NULL)
|
||||
{
|
||||
@ -434,7 +435,8 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
for (i = 0; i < nparams; i++)
|
||||
{
|
||||
length = png_strlen(params[i]) + 1;
|
||||
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, length);
|
||||
png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i,
|
||||
(unsigned long)length);
|
||||
info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_params[i] == NULL)
|
||||
{
|
||||
@ -482,7 +484,8 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->scal_unit = (png_byte)unit;
|
||||
|
||||
length = png_strlen(swidth) + 1;
|
||||
png_debug1(3, "allocating unit for info (%d bytes)\n", length);
|
||||
png_debug1(3, "allocating unit for info (%u bytes)\n",
|
||||
(unsigned int)length);
|
||||
info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->scal_s_width == NULL)
|
||||
{
|
||||
@ -493,11 +496,13 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length);
|
||||
|
||||
length = png_strlen(sheight) + 1;
|
||||
png_debug1(3, "allocating unit for info (%d bytes)\n", length);
|
||||
png_debug1(3, "allocating unit for info (%u bytes)\n",
|
||||
(unsigned int)length);
|
||||
info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->scal_s_height == NULL)
|
||||
{
|
||||
png_free (png_ptr, info_ptr->scal_s_width);
|
||||
info_ptr->scal_s_width = NULL;
|
||||
png_warning(png_ptr,
|
||||
"Memory allocation failed while processing sCAL.");
|
||||
return;
|
||||
@ -700,7 +705,8 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
if (new_iccp_profile == NULL)
|
||||
{
|
||||
png_free (png_ptr, new_iccp_name);
|
||||
png_warning(png_ptr, "Insufficient memory to process iCCP profile.");
|
||||
png_warning(png_ptr,
|
||||
"Insufficient memory to process iCCP profile.");
|
||||
return;
|
||||
}
|
||||
png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
|
||||
@ -835,11 +841,13 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
}
|
||||
|
||||
textp->key = (png_charp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(key_len + text_length + lang_len + lang_key_len + 4));
|
||||
(png_uint_32)
|
||||
(key_len + text_length + lang_len + lang_key_len + 4));
|
||||
if (textp->key == NULL)
|
||||
return(1);
|
||||
png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n",
|
||||
(png_uint_32)(key_len + lang_len + lang_key_len + text_length + 4),
|
||||
(png_uint_32)
|
||||
(key_len + lang_len + lang_key_len + text_length + 4),
|
||||
(int)textp->key);
|
||||
|
||||
png_memcpy(textp->key, text_ptr[i].key,
|
||||
@ -921,30 +929,45 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
||||
* function used to do the allocation.
|
||||
*/
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||
#endif
|
||||
|
||||
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
|
||||
png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)PNG_MAX_PALETTE_LENGTH);
|
||||
if (num_trans <= PNG_MAX_PALETTE_LENGTH)
|
||||
if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
|
||||
png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans);
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_TRNS;
|
||||
#else
|
||||
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (trans_values != NULL)
|
||||
{
|
||||
int sample_max = (1 << info_ptr->bit_depth);
|
||||
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
|
||||
(int)trans_values->gray > sample_max) ||
|
||||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
|
||||
((int)trans_values->red > sample_max ||
|
||||
(int)trans_values->green > sample_max ||
|
||||
(int)trans_values->blue > sample_max)))
|
||||
png_warning(png_ptr,
|
||||
"tRNS chunk has out-of-range samples for bit_depth");
|
||||
png_memcpy(&(info_ptr->trans_values), trans_values,
|
||||
png_sizeof(png_color_16));
|
||||
if (num_trans == 0)
|
||||
num_trans = 1;
|
||||
}
|
||||
|
||||
info_ptr->num_trans = (png_uint_16)num_trans;
|
||||
if (num_trans != 0)
|
||||
{
|
||||
info_ptr->valid |= PNG_INFO_tRNS;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_TRNS;
|
||||
#else
|
||||
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -952,6 +975,13 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
void PNGAPI
|
||||
png_set_sPLT(png_structp png_ptr,
|
||||
png_infop info_ptr, png_sPLT_tp entries, int nentries)
|
||||
/*
|
||||
* entries - array of png_sPLT_t structures
|
||||
* to be added to the list of palettes
|
||||
* in the info structure.
|
||||
* nentries - number of palette structures to be
|
||||
* added.
|
||||
*/
|
||||
{
|
||||
png_sPLT_tp np;
|
||||
int i;
|
||||
@ -960,7 +990,8 @@ png_set_sPLT(png_structp png_ptr,
|
||||
return;
|
||||
|
||||
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
|
||||
(info_ptr->splt_palettes_num + nentries) * png_sizeof(png_sPLT_t));
|
||||
(info_ptr->splt_palettes_num + nentries) *
|
||||
(png_uint_32)png_sizeof(png_sPLT_t));
|
||||
if (np == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "No memory for sPLT palettes.");
|
||||
@ -988,7 +1019,7 @@ png_set_sPLT(png_structp png_ptr,
|
||||
}
|
||||
png_memcpy(to->name, from->name, length);
|
||||
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
|
||||
from->nentries * png_sizeof(png_sPLT_entry));
|
||||
(png_uint_32)(from->nentries * png_sizeof(png_sPLT_entry)));
|
||||
if (to->entries == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
@ -1024,8 +1055,8 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
return;
|
||||
|
||||
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
|
||||
(info_ptr->unknown_chunks_num + num_unknowns) *
|
||||
png_sizeof(png_unknown_chunk));
|
||||
(png_uint_32)((info_ptr->unknown_chunks_num + num_unknowns) *
|
||||
png_sizeof(png_unknown_chunk)));
|
||||
if (np == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
@ -1047,20 +1078,24 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
(png_charp)from->name,
|
||||
png_sizeof(from->name));
|
||||
to->name[png_sizeof(to->name)-1] = '\0';
|
||||
to->size = from->size;
|
||||
/* note our location in the read or write sequence */
|
||||
to->location = (png_byte)(png_ptr->mode & 0xff);
|
||||
|
||||
to->data = (png_bytep)png_malloc_warn(png_ptr, from->size);
|
||||
if (from->size == 0)
|
||||
to->data=NULL;
|
||||
else
|
||||
{
|
||||
to->data = (png_bytep)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)from->size);
|
||||
if (to->data == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Out of memory while processing unknown chunk.");
|
||||
to->size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
png_memcpy(to->data, from->data, from->size);
|
||||
to->size = from->size;
|
||||
|
||||
/* note our location in the read or write sequence */
|
||||
to->location = (png_byte)(png_ptr->mode & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1137,7 +1172,8 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
||||
return;
|
||||
old_num_chunks=png_ptr->num_chunk_list;
|
||||
new_list=(png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(5*(num_chunks+old_num_chunks)));
|
||||
(png_uint_32)
|
||||
(5*(num_chunks + old_num_chunks)));
|
||||
if(png_ptr->chunk_list != NULL)
|
||||
{
|
||||
png_memcpy(new_list, png_ptr->chunk_list,
|
||||
@ -1189,11 +1225,11 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_compression_buffer_size(png_structp png_ptr, png_uint_32 size)
|
||||
png_set_compression_buffer_size(png_structp png_ptr,
|
||||
png_uint_32 size)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if(png_ptr->zbuf)
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf_size = (png_size_t)size;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
|
||||
@ -1219,6 +1255,7 @@ png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
|
||||
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
||||
if (png_ptr != NULL)
|
||||
png_ptr->asm_flags = 0;
|
||||
asm_flags = asm_flags; /* Quiet the compiler */
|
||||
}
|
||||
|
||||
/* this function was added to libpng 1.2.0 */
|
||||
@ -1230,6 +1267,9 @@ png_set_mmx_thresholds (png_structp png_ptr,
|
||||
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
/* Quiet the compiler */
|
||||
mmx_bitdepth_threshold = mmx_bitdepth_threshold;
|
||||
mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
||||
}
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.2.17 May 15, 2007
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
|
||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
|
||||
/* turn on BGR-to-RGB mapping */
|
||||
void PNGAPI
|
||||
@ -652,8 +652,8 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp
|
||||
png_voidp PNGAPI
|
||||
png_get_user_transform_ptr(png_structp png_ptr)
|
||||
{
|
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
if (png_ptr == NULL) return (NULL);
|
||||
#if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
return ((png_voidp)png_ptr->user_transform_ptr);
|
||||
#else
|
||||
return (NULL);
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.2.13 November 13, 2006
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.25 [February 18, 2008]
|
||||
* Last changed in libpng 1.2.31 [August 19, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -112,6 +112,8 @@ png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr)
|
||||
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
||||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
|
||||
{
|
||||
if (up->size == 0)
|
||||
png_warning(png_ptr, "Writing zero-length unknown chunk");
|
||||
png_write_chunk(png_ptr, up->name, up->data, up->size);
|
||||
}
|
||||
}
|
||||
@ -391,6 +393,18 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
/* write end of PNG file */
|
||||
png_write_IEND(png_ptr);
|
||||
/* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03,
|
||||
* and restored again in libpng-1.2.30, may cause some applications that
|
||||
* do not set png_ptr->output_flush_fn to crash. If your application
|
||||
* experiences a problem, please try building libpng with
|
||||
* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to
|
||||
* png-mng-implement at lists.sf.net . This kludge will be removed
|
||||
* from libpng-1.4.0.
|
||||
*/
|
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED) && \
|
||||
defined(PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED)
|
||||
png_flush(png_ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(PNG_WRITE_tIME_SUPPORTED)
|
||||
@ -437,6 +451,9 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
||||
{
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
volatile
|
||||
#endif
|
||||
png_structp png_ptr;
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@ -1074,7 +1091,7 @@ png_write_destroy(png_structp png_ptr)
|
||||
/* free our memory. png_free checks NULL for us. */
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_free(png_ptr, png_ptr->row_buf);
|
||||
#ifndef PNG_NO_WRITE_FILTERING
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_free(png_ptr, png_ptr->sub_row);
|
||||
png_free(png_ptr, png_ptr->up_row);
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Last changed in libpng 1.2.9 April 14, 2006
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2006 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*/
|
||||
|
227
png/pngwutil.c
227
png/pngwutil.c
@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.20 Septhember 3, 2007
|
||||
* Last changed in libpng 1.2.30 [August 15, 2008]
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@ -49,6 +49,24 @@ png_save_uint_16(png_bytep buf, unsigned int i)
|
||||
buf[1] = (png_byte)(i & 0xff);
|
||||
}
|
||||
|
||||
/* Simple function to write the signature. If we have already written
|
||||
* the magic bytes of the signature, or more likely, the PNG stream is
|
||||
* being embedded into another stream and doesn't need its own signature,
|
||||
* we should call png_set_sig_bytes() to tell libpng how many of the
|
||||
* bytes have already been written.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_write_sig(png_structp png_ptr)
|
||||
{
|
||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
|
||||
/* write the rest of the 8 byte signature */
|
||||
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
||||
(png_size_t)(8 - png_ptr->sig_bytes));
|
||||
if (png_ptr->sig_bytes < 3)
|
||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
||||
}
|
||||
|
||||
/* Write a PNG chunk all at once. The type is an array of ASCII characters
|
||||
* representing the chunk name. The array must be at least 4 bytes in
|
||||
* length, and does not need to be null terminated. To be safe, pass the
|
||||
@ -64,7 +82,7 @@ png_write_chunk(png_structp png_ptr, png_bytep chunk_name,
|
||||
{
|
||||
if(png_ptr == NULL) return;
|
||||
png_write_chunk_start(png_ptr, chunk_name, (png_uint_32)length);
|
||||
png_write_chunk_data(png_ptr, data, length);
|
||||
png_write_chunk_data(png_ptr, data, (png_size_t)length);
|
||||
png_write_chunk_end(png_ptr);
|
||||
}
|
||||
|
||||
@ -76,16 +94,18 @@ void PNGAPI
|
||||
png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
|
||||
png_uint_32 length)
|
||||
{
|
||||
png_byte buf[4];
|
||||
png_debug2(0, "Writing %s chunk (%lu bytes)\n", chunk_name, length);
|
||||
png_byte buf[8];
|
||||
|
||||
png_debug2(0, "Writing %s chunk, length = %lu\n", chunk_name,
|
||||
(unsigned long)length);
|
||||
if(png_ptr == NULL) return;
|
||||
|
||||
/* write the length */
|
||||
/* write the length and the chunk name */
|
||||
png_save_uint_32(buf, length);
|
||||
png_write_data(png_ptr, buf, (png_size_t)4);
|
||||
|
||||
/* write the chunk name */
|
||||
png_write_data(png_ptr, chunk_name, (png_size_t)4);
|
||||
png_memcpy(buf + 4, chunk_name, 4);
|
||||
png_write_data(png_ptr, buf, (png_size_t)8);
|
||||
/* put the chunk name into png_ptr->chunk_name */
|
||||
png_memcpy(png_ptr->chunk_name, chunk_name, 4);
|
||||
/* reset the crc and run it over the chunk name */
|
||||
png_reset_crc(png_ptr);
|
||||
png_calculate_crc(png_ptr, chunk_name, (png_size_t)4);
|
||||
@ -103,8 +123,11 @@ png_write_chunk_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
if(png_ptr == NULL) return;
|
||||
if (data != NULL && length > 0)
|
||||
{
|
||||
png_calculate_crc(png_ptr, data, length);
|
||||
png_write_data(png_ptr, data, length);
|
||||
/* update the CRC after writing the data,
|
||||
* in case that the user I/O routine alters it.
|
||||
*/
|
||||
png_calculate_crc(png_ptr, data, length);
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,29 +139,12 @@ png_write_chunk_end(png_structp png_ptr)
|
||||
|
||||
if(png_ptr == NULL) return;
|
||||
|
||||
/* write the crc */
|
||||
/* write the crc in a single operation */
|
||||
png_save_uint_32(buf, png_ptr->crc);
|
||||
|
||||
png_write_data(png_ptr, buf, (png_size_t)4);
|
||||
}
|
||||
|
||||
/* Simple function to write the signature. If we have already written
|
||||
* the magic bytes of the signature, or more likely, the PNG stream is
|
||||
* being embedded into another stream and doesn't need its own signature,
|
||||
* we should call png_set_sig_bytes() to tell libpng how many of the
|
||||
* bytes have already been written.
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_write_sig(png_structp png_ptr)
|
||||
{
|
||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
/* write the rest of the 8 byte signature */
|
||||
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
||||
(png_size_t)8 - png_ptr->sig_bytes);
|
||||
if(png_ptr->sig_bytes < 3)
|
||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
||||
}
|
||||
|
||||
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_iCCP_SUPPORTED)
|
||||
/*
|
||||
* This pair of functions encapsulates the operation of (a) compressing a
|
||||
@ -239,20 +245,21 @@ png_text_compress(png_structp png_ptr,
|
||||
|
||||
old_ptr = comp->output_ptr;
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)(comp->max_output_ptr *
|
||||
png_sizeof (png_charpp)));
|
||||
(png_uint_32)
|
||||
(comp->max_output_ptr * png_sizeof(png_charpp)));
|
||||
png_memcpy(comp->output_ptr, old_ptr, old_max
|
||||
* png_sizeof (png_charp));
|
||||
png_free(png_ptr, old_ptr);
|
||||
}
|
||||
else
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)(comp->max_output_ptr *
|
||||
png_sizeof (png_charp)));
|
||||
(png_uint_32)
|
||||
(comp->max_output_ptr * png_sizeof(png_charp)));
|
||||
}
|
||||
|
||||
/* save the data */
|
||||
comp->output_ptr[comp->num_output_ptr] = (png_charp)png_malloc(png_ptr,
|
||||
comp->output_ptr[comp->num_output_ptr] =
|
||||
(png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
|
||||
png_ptr->zbuf_size);
|
||||
@ -291,7 +298,7 @@ png_text_compress(png_structp png_ptr,
|
||||
/* This could be optimized to realloc() */
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)(comp->max_output_ptr *
|
||||
png_sizeof (png_charpp)));
|
||||
png_sizeof(png_charp)));
|
||||
png_memcpy(comp->output_ptr, old_ptr,
|
||||
old_max * png_sizeof (png_charp));
|
||||
png_free(png_ptr, old_ptr);
|
||||
@ -304,7 +311,8 @@ png_text_compress(png_structp png_ptr,
|
||||
|
||||
/* save off the data */
|
||||
comp->output_ptr[comp->num_output_ptr] =
|
||||
(png_charp)png_malloc(png_ptr, (png_uint_32)png_ptr->zbuf_size);
|
||||
(png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
|
||||
png_ptr->zbuf_size);
|
||||
comp->num_output_ptr++;
|
||||
@ -350,7 +358,7 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
||||
for (i = 0; i < comp->num_output_ptr; i++)
|
||||
{
|
||||
png_write_chunk_data(png_ptr,(png_bytep)comp->output_ptr[i],
|
||||
png_ptr->zbuf_size);
|
||||
(png_size_t)png_ptr->zbuf_size);
|
||||
png_free(png_ptr, comp->output_ptr[i]);
|
||||
comp->output_ptr[i]=NULL;
|
||||
}
|
||||
@ -360,7 +368,7 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
||||
/* write anything left in zbuf */
|
||||
if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
|
||||
png_write_chunk_data(png_ptr, png_ptr->zbuf,
|
||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out);
|
||||
(png_size_t)(png_ptr->zbuf_size - png_ptr->zstream.avail_out));
|
||||
|
||||
/* reset zlib for another zTXt/iTXt or image data */
|
||||
deflateReset(&png_ptr->zstream);
|
||||
@ -380,6 +388,8 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_IHDR;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
png_byte buf[13]; /* buffer to store the IHDR info */
|
||||
|
||||
png_debug(1, "in png_write_IHDR\n");
|
||||
@ -494,7 +504,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
buf[12] = (png_byte)interlace_type;
|
||||
|
||||
/* write the chunk */
|
||||
png_write_chunk(png_ptr, png_IHDR, buf, (png_size_t)13);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IHDR, buf, (png_size_t)13);
|
||||
|
||||
/* initialize zlib with PNG info */
|
||||
png_ptr->zstream.zalloc = png_zalloc;
|
||||
@ -523,10 +533,19 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
png_ptr->zlib_window_bits = 15;
|
||||
if (!(png_ptr->flags & PNG_FLAG_ZLIB_CUSTOM_METHOD))
|
||||
png_ptr->zlib_method = 8;
|
||||
if (deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
|
||||
ret = deflateInit2(&png_ptr->zstream, png_ptr->zlib_level,
|
||||
png_ptr->zlib_method, png_ptr->zlib_window_bits,
|
||||
png_ptr->zlib_mem_level, png_ptr->zlib_strategy) != Z_OK)
|
||||
png_ptr->zlib_mem_level, png_ptr->zlib_strategy);
|
||||
if (ret != Z_OK)
|
||||
{
|
||||
if (ret == Z_VERSION_ERROR) png_error(png_ptr,
|
||||
"zlib failed to initialize compressor -- version error");
|
||||
if (ret == Z_STREAM_ERROR) png_error(png_ptr,
|
||||
"zlib failed to initialize compressor -- stream error");
|
||||
if (ret == Z_MEM_ERROR) png_error(png_ptr,
|
||||
"zlib failed to initialize compressor -- mem error");
|
||||
png_error(png_ptr, "zlib failed to initialize compressor");
|
||||
}
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
/* libpng is not interested in zstream.data_type */
|
||||
@ -578,7 +597,8 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
||||
png_ptr->num_palette = (png_uint_16)num_pal;
|
||||
png_debug1(3, "num_palette = %d\n", png_ptr->num_palette);
|
||||
|
||||
png_write_chunk_start(png_ptr, png_PLTE, num_pal * 3);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_PLTE,
|
||||
(png_uint_32)(num_pal * 3));
|
||||
#ifndef PNG_NO_POINTER_INDEXING
|
||||
for (i = 0, pal_ptr = palette; i < num_pal; i++, pal_ptr++)
|
||||
{
|
||||
@ -650,7 +670,7 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
"Invalid zlib compression method or flags in IDAT");
|
||||
}
|
||||
|
||||
png_write_chunk(png_ptr, png_IDAT, data, length);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IDAT, data, length);
|
||||
png_ptr->mode |= PNG_HAVE_IDAT;
|
||||
}
|
||||
|
||||
@ -662,7 +682,7 @@ png_write_IEND(png_structp png_ptr)
|
||||
PNG_IEND;
|
||||
#endif
|
||||
png_debug(1, "in png_write_IEND\n");
|
||||
png_write_chunk(png_ptr, png_IEND, png_bytep_NULL,
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,
|
||||
(png_size_t)0);
|
||||
png_ptr->mode |= PNG_HAVE_IEND;
|
||||
}
|
||||
@ -683,7 +703,7 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
|
||||
/* file_gamma is saved in 1/100,000ths */
|
||||
igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5);
|
||||
png_save_uint_32(buf, igamma);
|
||||
png_write_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
|
||||
}
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
@ -698,7 +718,7 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
|
||||
png_debug(1, "in png_write_gAMA\n");
|
||||
/* file_gamma is saved in 1/100,000ths */
|
||||
png_save_uint_32(buf, (png_uint_32)file_gamma);
|
||||
png_write_chunk(png_ptr, png_gAMA, buf, (png_size_t)4);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -718,7 +738,7 @@ png_write_sRGB(png_structp png_ptr, int srgb_intent)
|
||||
png_warning(png_ptr,
|
||||
"Invalid sRGB rendering intent specified");
|
||||
buf[0]=(png_byte)srgb_intent;
|
||||
png_write_chunk(png_ptr, png_sRGB, buf, (png_size_t)1);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_sRGB, buf, (png_size_t)1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -779,14 +799,15 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
|
||||
}
|
||||
|
||||
if (profile_len)
|
||||
profile_len = png_text_compress(png_ptr, profile, (png_size_t)profile_len,
|
||||
PNG_COMPRESSION_TYPE_BASE, &comp);
|
||||
profile_len = png_text_compress(png_ptr, profile,
|
||||
(png_size_t)profile_len, PNG_COMPRESSION_TYPE_BASE, &comp);
|
||||
|
||||
/* make sure we include the NULL after the name and the compression type */
|
||||
png_write_chunk_start(png_ptr, png_iCCP,
|
||||
(png_uint_32)name_len+profile_len+2);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_iCCP,
|
||||
(png_uint_32)(name_len + profile_len + 2));
|
||||
new_name[name_len+1]=0x00;
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 2);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_name,
|
||||
(png_size_t)(name_len + 2));
|
||||
|
||||
if (profile_len)
|
||||
png_write_compressed_data_out(png_ptr, &comp);
|
||||
@ -823,10 +844,11 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
|
||||
}
|
||||
|
||||
/* make sure we include the NULL after the name */
|
||||
png_write_chunk_start(png_ptr, png_sPLT,
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_sPLT,
|
||||
(png_uint_32)(name_len + 2 + palette_size));
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_name, name_len + 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_name,
|
||||
(png_size_t)(name_len + 1));
|
||||
png_write_chunk_data(png_ptr, (png_bytep)&spalette->depth, (png_size_t)1);
|
||||
|
||||
/* loop through each palette entry, writing appropriately */
|
||||
#ifndef PNG_NO_POINTER_INDEXING
|
||||
@ -870,7 +892,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
|
||||
png_save_uint_16(entrybuf + 6, ep[i].alpha);
|
||||
png_save_uint_16(entrybuf + 8, ep[i].frequency);
|
||||
}
|
||||
png_write_chunk_data(png_ptr, entrybuf, entry_size);
|
||||
png_write_chunk_data(png_ptr, entrybuf, (png_size_t)entry_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -931,7 +953,7 @@ png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
|
||||
buf[size++] = sbit->alpha;
|
||||
}
|
||||
|
||||
png_write_chunk(png_ptr, png_sBIT, buf, size);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_sBIT, buf, size);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -995,7 +1017,7 @@ png_write_cHRM(png_structp png_ptr, double white_x, double white_y,
|
||||
itemp = (png_uint_32)(blue_y * 100000.0 + 0.5);
|
||||
png_save_uint_32(buf + 28, itemp);
|
||||
|
||||
png_write_chunk(png_ptr, png_cHRM, buf, (png_size_t)32);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
|
||||
}
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
@ -1016,7 +1038,8 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
|
||||
{
|
||||
png_warning(png_ptr, "Invalid fixed cHRM white point specified");
|
||||
#if !defined(PNG_NO_CONSOLE_IO)
|
||||
fprintf(stderr,"white_x=%ld, white_y=%ld\n",white_x, white_y);
|
||||
fprintf(stderr, "white_x=%ld, white_y=%ld\n", (unsigned long)white_x,
|
||||
(unsigned long)white_y);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -1047,7 +1070,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
|
||||
png_save_uint_32(buf + 24, (png_uint_32)blue_x);
|
||||
png_save_uint_32(buf + 28, (png_uint_32)blue_y);
|
||||
|
||||
png_write_chunk(png_ptr, png_cHRM, buf, (png_size_t)32);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -1072,7 +1095,8 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
return;
|
||||
}
|
||||
/* write the chunk out as it is */
|
||||
png_write_chunk(png_ptr, png_tRNS, trans, (png_size_t)num_trans);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans,
|
||||
(png_size_t)num_trans);
|
||||
}
|
||||
else if (color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
@ -1084,7 +1108,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
return;
|
||||
}
|
||||
png_save_uint_16(buf, tran->gray);
|
||||
png_write_chunk(png_ptr, png_tRNS, buf, (png_size_t)2);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)2);
|
||||
}
|
||||
else if (color_type == PNG_COLOR_TYPE_RGB)
|
||||
{
|
||||
@ -1098,7 +1122,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
"Ignoring attempt to write 16-bit tRNS chunk when bit_depth is 8");
|
||||
return;
|
||||
}
|
||||
png_write_chunk(png_ptr, png_tRNS, buf, (png_size_t)6);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, buf, (png_size_t)6);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1131,7 +1155,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
return;
|
||||
}
|
||||
buf[0] = back->index;
|
||||
png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)1);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)1);
|
||||
}
|
||||
else if (color_type & PNG_COLOR_MASK_COLOR)
|
||||
{
|
||||
@ -1144,7 +1168,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
"Ignoring attempt to write 16-bit bKGD chunk when bit_depth is 8");
|
||||
return;
|
||||
}
|
||||
png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)6);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)6);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1155,7 +1179,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
return;
|
||||
}
|
||||
png_save_uint_16(buf, back->gray);
|
||||
png_write_chunk(png_ptr, png_bKGD, buf, (png_size_t)2);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_bKGD, buf, (png_size_t)2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1180,7 +1204,8 @@ png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
|
||||
return;
|
||||
}
|
||||
|
||||
png_write_chunk_start(png_ptr, png_hIST, (png_uint_32)(num_hist * 2));
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_hIST,
|
||||
(png_uint_32)(num_hist * 2));
|
||||
for (i = 0; i < num_hist; i++)
|
||||
{
|
||||
png_save_uint_16(buf, hist[i]);
|
||||
@ -1346,16 +1371,18 @@ png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,
|
||||
text_len = png_strlen(text);
|
||||
|
||||
/* make sure we include the 0 after the key */
|
||||
png_write_chunk_start(png_ptr, png_tEXt, (png_uint_32)key_len+text_len+1);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_tEXt,
|
||||
(png_uint_32)(key_len + text_len + 1));
|
||||
/*
|
||||
* We leave it to the application to meet PNG-1.0 requirements on the
|
||||
* contents of the text. PNG-1.0 through PNG-1.2 discourage the use of
|
||||
* any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.
|
||||
* The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
|
||||
*/
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key,
|
||||
(png_size_t)(key_len + 1));
|
||||
if (text_len)
|
||||
png_write_chunk_data(png_ptr, (png_bytep)text, text_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)text, (png_size_t)text_len);
|
||||
|
||||
png_write_chunk_end(png_ptr);
|
||||
png_free(png_ptr, new_key);
|
||||
@ -1387,6 +1414,7 @@ png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
|
||||
if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0)
|
||||
{
|
||||
png_warning(png_ptr, "Empty keyword in zTXt chunk");
|
||||
png_free(png_ptr, new_key);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1404,10 +1432,11 @@ png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
|
||||
&comp);
|
||||
|
||||
/* write start of chunk */
|
||||
png_write_chunk_start(png_ptr, png_zTXt, (png_uint_32)
|
||||
(key_len+text_len+2));
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_zTXt,
|
||||
(png_uint_32)(key_len+text_len + 2));
|
||||
/* write key */
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key,
|
||||
(png_size_t)(key_len + 1));
|
||||
png_free(png_ptr, new_key);
|
||||
|
||||
buf[0] = (png_byte)compression;
|
||||
@ -1472,7 +1501,7 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
/* make sure we include the compression flag, the compression byte,
|
||||
* and the NULs after the key, lang, and lang_key parts */
|
||||
|
||||
png_write_chunk_start(png_ptr, png_iTXt,
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_iTXt,
|
||||
(png_uint_32)(
|
||||
5 /* comp byte, comp flag, terminators for key, lang and lang_key */
|
||||
+ key_len
|
||||
@ -1486,7 +1515,8 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
* any non-Latin-1 characters except for NEWLINE. ISO PNG will forbid them.
|
||||
* The NUL character is forbidden by PNG-1.0 through PNG-1.2 and ISO PNG.
|
||||
*/
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key, key_len + 1);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_key,
|
||||
(png_size_t)(key_len + 1));
|
||||
|
||||
/* set the compression flag */
|
||||
if (compression == PNG_ITXT_COMPRESSION_NONE || \
|
||||
@ -1496,16 +1526,17 @@ png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
cbuf[0] = 1;
|
||||
/* set the compression method */
|
||||
cbuf[1] = 0;
|
||||
png_write_chunk_data(png_ptr, cbuf, 2);
|
||||
png_write_chunk_data(png_ptr, cbuf, (png_size_t)2);
|
||||
|
||||
cbuf[0] = 0;
|
||||
png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf), lang_len + 1);
|
||||
png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf), lang_key_len + 1);
|
||||
png_write_chunk_data(png_ptr, (new_lang ? (png_bytep)new_lang : cbuf),
|
||||
(png_size_t)(lang_len + 1));
|
||||
png_write_chunk_data(png_ptr, (lang_key ? (png_bytep)lang_key : cbuf),
|
||||
(png_size_t)(lang_key_len + 1));
|
||||
png_write_compressed_data_out(png_ptr, &comp);
|
||||
|
||||
png_write_chunk_end(png_ptr);
|
||||
png_free(png_ptr, new_key);
|
||||
if (new_lang)
|
||||
png_free(png_ptr, new_lang);
|
||||
}
|
||||
#endif
|
||||
@ -1529,7 +1560,7 @@ png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
|
||||
png_save_int_32(buf + 4, y_offset);
|
||||
buf[8] = (png_byte)unit_type;
|
||||
|
||||
png_write_chunk(png_ptr, png_oFFs, buf, (png_size_t)9);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_oFFs, buf, (png_size_t)9);
|
||||
}
|
||||
#endif
|
||||
#if defined(PNG_WRITE_pCAL_SUPPORTED)
|
||||
@ -1557,21 +1588,23 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
png_debug1(3, "pCAL units length = %d\n", (int)units_len);
|
||||
total_len = purpose_len + units_len + 10;
|
||||
|
||||
params_len = (png_uint_32p)png_malloc(png_ptr, (png_uint_32)(nparams
|
||||
*png_sizeof(png_uint_32)));
|
||||
params_len = (png_uint_32p)png_malloc(png_ptr,
|
||||
(png_uint_32)(nparams * png_sizeof(png_uint_32)));
|
||||
|
||||
/* Find the length of each parameter, making sure we don't count the
|
||||
null terminator for the last parameter. */
|
||||
for (i = 0; i < nparams; i++)
|
||||
{
|
||||
params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1);
|
||||
png_debug2(3, "pCAL parameter %d length = %lu\n", i, params_len[i]);
|
||||
png_debug2(3, "pCAL parameter %d length = %lu\n", i,
|
||||
(unsigned long) params_len[i]);
|
||||
total_len += (png_size_t)params_len[i];
|
||||
}
|
||||
|
||||
png_debug1(3, "pCAL total length = %d\n", (int)total_len);
|
||||
png_write_chunk_start(png_ptr, png_pCAL, (png_uint_32)total_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_purpose, purpose_len);
|
||||
png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len);
|
||||
png_write_chunk_data(png_ptr, (png_bytep)new_purpose,
|
||||
(png_size_t)purpose_len);
|
||||
png_save_int_32(buf, X0);
|
||||
png_save_int_32(buf + 4, X1);
|
||||
buf[8] = (png_byte)type;
|
||||
@ -1630,7 +1663,7 @@ png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
|
||||
#endif
|
||||
|
||||
png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len);
|
||||
png_write_chunk(png_ptr, png_sCAL, (png_bytep)buf, total_len);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len);
|
||||
}
|
||||
#else
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
@ -1660,7 +1693,7 @@ png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,
|
||||
png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */
|
||||
|
||||
png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len);
|
||||
png_write_chunk(png_ptr, png_sCAL, buf, total_len);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@ -1686,7 +1719,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
|
||||
png_save_uint_32(buf + 4, y_pixels_per_unit);
|
||||
buf[8] = (png_byte)unit_type;
|
||||
|
||||
png_write_chunk(png_ptr, png_pHYs, buf, (png_size_t)9);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_pHYs, buf, (png_size_t)9);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1718,7 +1751,7 @@ png_write_tIME(png_structp png_ptr, png_timep mod_time)
|
||||
buf[5] = mod_time->minute;
|
||||
buf[6] = mod_time->second;
|
||||
|
||||
png_write_chunk(png_ptr, png_tIME, buf, (png_size_t)7);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tIME, buf, (png_size_t)7);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1751,15 +1784,16 @@ png_write_start_row(png_structp png_ptr)
|
||||
png_ptr->usr_channels*png_ptr->usr_bit_depth,png_ptr->width)+1);
|
||||
|
||||
/* 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);
|
||||
png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE;
|
||||
|
||||
#ifndef PNG_NO_WRITE_FILTERING
|
||||
#ifndef PNG_NO_WRITE_FILTER
|
||||
/* set up filtering buffer, if using this filter */
|
||||
if (png_ptr->do_filter & PNG_FILTER_SUB)
|
||||
{
|
||||
png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_ptr->rowbytes + 1));
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;
|
||||
}
|
||||
|
||||
@ -1767,31 +1801,32 @@ png_write_start_row(png_structp png_ptr)
|
||||
if (png_ptr->do_filter & (PNG_FILTER_AVG | PNG_FILTER_UP | PNG_FILTER_PAETH))
|
||||
{
|
||||
/* set up previous row buffer */
|
||||
png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)buf_size);
|
||||
png_ptr->prev_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)buf_size);
|
||||
png_memset(png_ptr->prev_row, 0, buf_size);
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_UP)
|
||||
{
|
||||
png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_ptr->rowbytes + 1));
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
|
||||
}
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_AVG)
|
||||
{
|
||||
png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_ptr->rowbytes + 1));
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
|
||||
}
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_PAETH)
|
||||
{
|
||||
png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_ptr->rowbytes + 1));
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
|
||||
}
|
||||
#endif /* PNG_NO_WRITE_FILTERING */
|
||||
}
|
||||
#endif /* PNG_NO_WRITE_FILTER */
|
||||
|
||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||
/* if interlaced, we need to set up width and height of pass */
|
||||
|
Loading…
Reference in New Issue
Block a user