mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
171 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7625063dc | ||
|
|
24f40e321c | ||
|
|
0bb898a885 | ||
|
|
61a2d8a2a7 | ||
|
|
af96543688 | ||
|
|
34f5449736 | ||
|
|
484a48e221 | ||
|
|
cc5226bf2a | ||
|
|
8fbb563f4e | ||
|
|
65e6d5a34f | ||
|
|
47be2e7c3a | ||
|
|
4d694dadd8 | ||
|
|
59397f985e | ||
|
|
cc1d4d0dbc | ||
|
|
070434c045 | ||
|
|
0dc882d7c3 | ||
|
|
c3ac9a507a | ||
|
|
a6afebc718 | ||
|
|
d41915dc2a | ||
|
|
5a5ad7a5fa | ||
|
|
9dad5e37ae | ||
|
|
adde7b5c1e | ||
|
|
3bdde42e40 | ||
|
|
6b4dee12f5 | ||
|
|
355b90387b | ||
|
|
f512ca7625 | ||
|
|
16ee3e9870 | ||
|
|
c8444775b1 | ||
|
|
784d80b509 | ||
|
|
98aacb16c3 | ||
|
|
8a35e25852 | ||
|
|
97eb073189 | ||
|
|
28534bd47a | ||
|
|
2053a26873 | ||
|
|
736a230890 | ||
|
|
3926448598 | ||
|
|
11130874d4 | ||
|
|
ef5a57119a | ||
|
|
31f4e52842 | ||
|
|
0e1aad158a | ||
|
|
5f5d6d637b | ||
|
|
a2336bcf05 | ||
|
|
20e6003290 | ||
|
|
54c633b810 | ||
|
|
f0c2cc32b1 | ||
|
|
8709982e22 | ||
|
|
686d45dcfd | ||
|
|
8502e1ff25 | ||
|
|
603c9fd959 | ||
|
|
86946fdc03 | ||
|
|
af4c99b21a | ||
|
|
97d2d68428 | ||
|
|
ce5d7cb7aa | ||
|
|
c4ff4e7167 | ||
|
|
b94d24eb25 | ||
|
|
379d0160ea | ||
|
|
23c2ea38a6 | ||
|
|
d486eb18c5 | ||
|
|
a10d488a32 | ||
|
|
25d754e86d | ||
|
|
bba85637d7 | ||
|
|
94c3a45f4c | ||
|
|
221be3def1 | ||
|
|
1daf8980dd | ||
|
|
5945408a93 | ||
|
|
9a8c568e3c | ||
|
|
fb05477e11 | ||
|
|
df68ef4d5e | ||
|
|
d857ed275e | ||
|
|
14181b7f48 | ||
|
|
6916ec5fa9 | ||
|
|
acb4822f6b | ||
|
|
79fb836d66 | ||
|
|
010110a0be | ||
|
|
756f873a25 | ||
|
|
e2d740ae04 | ||
|
|
ff244b6181 | ||
|
|
d3494d172c | ||
|
|
2922c07e67 | ||
|
|
c03a949a0d | ||
|
|
377e3ca5e6 | ||
|
|
f320728911 | ||
|
|
b4a5d88e0a | ||
|
|
7ea0b3b9e2 | ||
|
|
aa3725c860 | ||
|
|
8aa84c7fce | ||
|
|
453ceae85f | ||
|
|
1f5a0b9fa6 | ||
|
|
820a8d1de9 | ||
|
|
6bb02b28a1 | ||
|
|
60ba227d57 | ||
|
|
175e21f5e1 | ||
|
|
97db6709e4 | ||
|
|
c0fc0dfc45 | ||
|
|
f3eadd1737 | ||
|
|
c4ec48281c | ||
|
|
1a006390d9 | ||
|
|
953f265513 | ||
|
|
468877578a | ||
|
|
ff14eeb4f2 | ||
|
|
5f3eabf4cd | ||
|
|
bbc70d2471 | ||
|
|
a0cafa3d0b | ||
|
|
58219ca22f | ||
|
|
50b28f3bf2 | ||
|
|
0f8345abf7 | ||
|
|
4f213e08aa | ||
|
|
8493de3cee | ||
|
|
fee6e7428f | ||
|
|
d10616d364 | ||
|
|
85d143a273 | ||
|
|
6e72bc46d3 | ||
|
|
b8eed1d830 | ||
|
|
a64ecdfa5b | ||
|
|
bcfc0ce5f6 | ||
|
|
8bc0719dde | ||
|
|
185cd6c058 | ||
|
|
afb77541b4 | ||
|
|
c4a5c2de26 | ||
|
|
87bc4b08ff | ||
|
|
65cdb3dfa8 | ||
|
|
cc411ae004 | ||
|
|
f521b99b09 | ||
|
|
b08f330d62 | ||
|
|
41ffb1c950 | ||
|
|
ebe3ea3204 | ||
|
|
d94c4516c6 | ||
|
|
b0f8d9bb97 | ||
|
|
04dfe7b3f6 | ||
|
|
547afcfc74 | ||
|
|
48afdb4eef | ||
|
|
9ee96e3ba9 | ||
|
|
0311f5412e | ||
|
|
e734eba51e | ||
|
|
7ed40716cb | ||
|
|
155889b318 | ||
|
|
4dd011f6d0 | ||
|
|
e45a5d3a32 | ||
|
|
80a1050237 | ||
|
|
54592bba4d | ||
|
|
902d4d109a | ||
|
|
d8daacf157 | ||
|
|
0da5bcb414 | ||
|
|
ac6555fa3c | ||
|
|
2af7ef63c3 | ||
|
|
6da5b35fca | ||
|
|
abd68eb92b | ||
|
|
bf451ffc9a | ||
|
|
be734f5592 | ||
|
|
9f0c080847 | ||
|
|
3a1ba773b0 | ||
|
|
849a1ab845 | ||
|
|
940de5ab02 | ||
|
|
dd9578f379 | ||
|
|
0ce807691b | ||
|
|
4f8ea5eede | ||
|
|
7869e676af | ||
|
|
af0a726689 | ||
|
|
8d9263fca6 | ||
|
|
d6a0cbaade | ||
|
|
2302a4d04f | ||
|
|
8f9a2d08ea | ||
|
|
30c73195b5 | ||
|
|
097485195c | ||
|
|
c5f6fa110a | ||
|
|
90cfcecc09 | ||
|
|
dee0e2ed0f | ||
|
|
5ad9884ff1 | ||
|
|
188eb6b426 | ||
|
|
8361f64dbf | ||
|
|
2a6227941e |
42
ANNOUNCE
42
ANNOUNCE
@@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.4.3 - June 26, 2010
|
||||
Libpng 1.4.8 - July 7, 2011
|
||||
|
||||
This is a public release of libpng, intended for use in production codes.
|
||||
|
||||
@@ -8,29 +8,39 @@ Files available for download:
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
libpng-1.4.3.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.4.3.tar.gz
|
||||
libpng-1.4.3.tar.bz2
|
||||
libpng-1.4.8.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.4.8.tar.gz
|
||||
libpng-1.4.8.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lpng143.zip
|
||||
lpng143.7z
|
||||
lpng148.7z (LZMA-compressed, recommended)
|
||||
lpng148.zip
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.4.3-README.txt
|
||||
libpng-1.4.3-LICENSE.txt
|
||||
libpng-1.4.8-README.txt
|
||||
libpng-1.4.8-LICENSE.txt
|
||||
|
||||
Changes since the last public release (1.4.2):
|
||||
Added missing quotation marks in the aix block of configure.ac
|
||||
The new "vstudio" project was missing from the zip and 7z distributions.
|
||||
Rewrote png_process_IDAT_data to consistently treat extra data as warnings
|
||||
and handle end conditions more cleanly.
|
||||
Removed the now-redundant check for out-of-bounds new_row from example.c
|
||||
Changed char *msg to PNG_CONST char *msg in pngrutil.c
|
||||
Stop memory leak when reading a malformed sCAL chunk.
|
||||
Changes since the last public release (1.4.7):
|
||||
|
||||
Undef "_ALL_SOURCE" for AIX, to prevent "jmpbuf" from being redefined.
|
||||
Copied png_debug macros from pngpriv.h into pngtest.c and removed
|
||||
"#include pngpriv.h" from pngtest.c, to avoid setting a bad example.
|
||||
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
|
||||
was introduced in libpng-1.2.20beta01.
|
||||
Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
|
||||
before IDAT.
|
||||
Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image,
|
||||
always expand to RGBA if transparency is present.
|
||||
Ported bugfix in pngrtran.c from 1.5.3: Ensure coefficients are OK for
|
||||
png_rgb_to_gray_fixed(); check for integer overflow in
|
||||
png_set_rgb_to_gray().
|
||||
Fixed uninitialized memory read in png_format_buffer() (Bug report by
|
||||
Frank Busse, related to CVE-2004-0421).
|
||||
Fixed error in "ACCURATE" 16-to-8 scaling (John Bowler).
|
||||
Check for sCAL chunk too short.
|
||||
|
||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||
|
||||
218
CHANGES
218
CHANGES
@@ -1479,7 +1479,7 @@ version 1.2.9beta5 [March 4, 2006]
|
||||
Removed trailing blanks from source files.
|
||||
Put version and date of latest change in each source file, and changed
|
||||
copyright year accordingly.
|
||||
More cleanup of configure.ac, Makefile.ac, and associated scripts.
|
||||
More cleanup of configure.ac, Makefile.am, and associated scripts.
|
||||
Restored scripts/makefile.elf which was inadvertently deleted.
|
||||
|
||||
version 1.2.9beta6 [March 6, 2006]
|
||||
@@ -2610,6 +2610,222 @@ version 1.4.3rc03 [June 23, 2010]
|
||||
version 1.4.3 [June 26, 2010]
|
||||
Updated some of the "last changed" dates.
|
||||
|
||||
version 1.4.4beta01 [July 12, 2010]
|
||||
Removed extraneous new_push_process_row.c file.
|
||||
Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
|
||||
Removed some newly-added TAB characters from pngpread.c.
|
||||
Fixed some indentation in pngpread.c and pngrutil.c
|
||||
Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
|
||||
Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
|
||||
Put "#ifndef PNG_EXTERN, #endif" around "#define PNG_EXTERN" in pngpriv.h
|
||||
|
||||
version 1.4.4beta02 [July 24, 2010]
|
||||
Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
|
||||
Moved the definition of png_snprintf() outside of the enclosing
|
||||
#ifdef blocks in pngconf.h
|
||||
Added a special case typedef of png_longjmp_ptr for WATCOM.
|
||||
|
||||
version 1.4.4beta03 [July 24, 2010]
|
||||
Removed reference to cbuilder5/* from Makefile.in and Makefile.am
|
||||
Eliminated the new special case typedef of png_longjmp_ptr for WATCOM
|
||||
and made a special case "#define PNGAPI" in pngconf.h instead.
|
||||
|
||||
version 1.4.4beta04 [July 31, 2010]
|
||||
Updated the read macros and functions from 1.5.0beta38.
|
||||
|
||||
version 1.4.4beta05 [August 6, 2010]
|
||||
Updated projects/visualc71 so it can find scripts/pnglibconf.h
|
||||
Removed unused png_mem_* defines from pngconf.h.
|
||||
Correct use of _WINDOWS_ in pngconf.h
|
||||
|
||||
version 1.4.4beta06 [August 11, 2010]
|
||||
Don't try to use version-script with cygwin/mingw.
|
||||
Revised contrib/gregbook to work under cygwin/mingw.
|
||||
|
||||
version 1.4.4beta07 [August 26, 2010]
|
||||
Updated prebuilt aclocal.m4 and ltmain.sh
|
||||
Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
|
||||
Updated CMakeLists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
|
||||
installing libpng in /usr/lib64 (Funda Wang).
|
||||
Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
|
||||
Revised CMakeLists.txt to make symlinks instead of copies when installing.
|
||||
Changed PNG_LIB_NAME from pngNN to libpngNN in CMakeLists.txt (Philip Lowman)
|
||||
Moved "#include pngusr.h" ahead of PNG_USER_PRIVATEBUILD test in pngconf.h
|
||||
Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c
|
||||
Eliminated new unnecessary #if tests regarding the sCAL chunk from pngrutil.c
|
||||
|
||||
version 1.4.4beta08 [September 2, 2010]
|
||||
Updated the xcode project to work with libpng-1.4.x and added iOS targets
|
||||
for simulator and device (Philippe Hausler).
|
||||
|
||||
version 1.4.4rc01 [September 10, 2010]
|
||||
No changes.
|
||||
|
||||
version 1.4.4rc02 [September 13, 2010]
|
||||
Revised CMakeLists.txt (Philip Lowman).
|
||||
|
||||
version 1.4.4rc03 [September 14, 2010]
|
||||
Removed an extraneous close-double-quote from CMakeLists.txt
|
||||
Eliminated another deprecated reference to png_ptr->io_ptr in pngtest.c
|
||||
|
||||
version 1.4.4rc04 [September 16, 2010]
|
||||
Fixed indentation and removed debugging message from CMakeLists.txt
|
||||
Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
|
||||
$AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
|
||||
|
||||
version 1.4.4rc05 [September 20, 2010]
|
||||
Rebuilt configure scripts with automake-1.11.1 instead of automake-1.11.
|
||||
Removed unused mkinstalldirs file.
|
||||
|
||||
version 1.4.4 [September 23, 2010]
|
||||
No changes.
|
||||
|
||||
version 1.4.5beta01 [September 25, 2010]
|
||||
Fixed possible configure.ac bug introduced in version 1.4.4rc05.
|
||||
Rebuilt configure scripts with autoconf-2.68 instead of autoconf-2.65
|
||||
|
||||
version 1.4.5beta02 [October 5, 2010]
|
||||
Reverted configure scripts to autoconf-2.65
|
||||
Fixed problem with symbols creation in Makefile.am which was assuming that
|
||||
all versions of cpp write to standard output by default (Martin Banky). The
|
||||
bug was introduced in libpng-1.2.9beta5.
|
||||
|
||||
version 1.4.5beta03 [October 8, 2010]
|
||||
Wrapped long lines in CMakeLists.txt and introduced ${libpng_public_hdrs}
|
||||
Undid Makefile.am revision of 1.4.5beta02.
|
||||
|
||||
version 1.4.5beta04 [November 8, 2010]
|
||||
Check for out-of-range text compression mode in png_set_text().
|
||||
|
||||
version 1.4.5rc01 [November 19, 2010]
|
||||
No changes.
|
||||
|
||||
version 1.4.5beta05 [November 20, 2010]
|
||||
Revised png_get_uint_32, png_get_int_32, png_get_uint_16 (Cosmin)
|
||||
Moved reading of file signature into png_read_sig (Cosmin)
|
||||
Fixed atomicity of chunk header serialization (Cosmin)
|
||||
Added test for io_state in pngtest.c (Cosmin)
|
||||
Added "#!/bin/sh" at the top of contrib/pngminim/*/gather.sh scripts.
|
||||
|
||||
version 1.4.5beta06 [November 21, 2010]
|
||||
Restored the parentheses in pngrutil.c; they are needed when the
|
||||
png_get_*int_*() functions are compiled (i.e., when PNG_USE_READ_MACROS
|
||||
is not defined).
|
||||
Make the "png_get_uint_16" macro return a png_uint_32 in libpng-1.4 for API
|
||||
compatibility.
|
||||
Changes to remove gcc warnings (John Bowler)
|
||||
Certain optional gcc warning flags resulted in warnings in libpng code.
|
||||
With these changes only -Wconversion and -Wcast-qual cannot be turned on.
|
||||
Changes are trivial rearrangements of code. -Wconversion is not possible
|
||||
for pngrutil.c (because of the widespread use of += et al on variables
|
||||
smaller than (int) or (unsigned int)) and -Wcast-qual is not possible
|
||||
with pngwio.c and pngwutil.c because the 'write' callback and zlib
|
||||
compression both fail to declare their input buffers with 'const'.
|
||||
|
||||
version 1.4.5beta07 [November 25, 2010]
|
||||
Reverted png_get_uint_16 macro to beta05 and added comment about the
|
||||
potential API incompatibility.
|
||||
|
||||
version 1.4.5rc02 [December 2, 2010]
|
||||
No changes.
|
||||
|
||||
version 1.4.5rc03 [December 3, 2010]
|
||||
Added missing vstudio/*/*.vcxproj files to the zip and 7z distributions.
|
||||
|
||||
version 1.4.5 [December 9, 2010]
|
||||
Removed PNG_NO_WRITE_GAMMA from pngminim/encoder/pngusr.h
|
||||
|
||||
version 1.4.6beta01 [December 29, 2010]
|
||||
Fixed bug in background transformation handling in pngrtran.c (it was
|
||||
looking for the flag in png_ptr->transformations instead of in
|
||||
png_ptr->flags) (David Raymond).
|
||||
|
||||
version 1.4.6beta02 [January 14, 2011]
|
||||
Fixed misspelled macros in contrib/pngminim (Cosmin).
|
||||
Updated CMakeLists.txt (Clifford Yapp).
|
||||
|
||||
version 1.4.6beta03 [January 14, 2011]
|
||||
Fixed some typecasts in png_debug statements (Cosmin).
|
||||
|
||||
version 1.4.6beta04 [January 22, 2011]
|
||||
Updated documentation of png_set|get_tRNS() (Thomas Klausner).
|
||||
Added png_const_structp and png_const_infop types, and used them in
|
||||
prototypes for most png_get_*() functions.
|
||||
In the manual, describe the png_get_IHDR() arguments in the correct order.
|
||||
Ported change in png_do_rgb_to_gray() from libpng-1.5.1, to make
|
||||
it more robust against internal libpng coding errors.
|
||||
|
||||
version 1.4.6beta05 [January 23, 2011]
|
||||
|
||||
Updated the synopses in the manual to reflect recent changes.
|
||||
Fixed a typo in the *.def files and deleted entries that are now
|
||||
declared in pngpriv.h
|
||||
|
||||
version 1.4.6beta06 [March 19, 2011]
|
||||
Updated contrib/pngsuite/README to add the word "modify".
|
||||
Added the private PNG_UNUSED() macro definition in pngconf.h.
|
||||
|
||||
version 1.4.6beta07 [March 22, 2011]
|
||||
ifdef out mask arrays in pngread.c when interlacing is not supported.
|
||||
Added attribute definition (warnings) for MSC_VER >= 1300 in pngconf.h
|
||||
Added -D_CRT_SECURE_NO_DEPRECATE to CFLAGS in makefile.vcwin32
|
||||
Fixed mistake in the descriptions of user read_transform and write_transform
|
||||
function prototypes in the manual. The row_info struct is png_row_infop.
|
||||
Added a request in the manual that applications do not use "png_" or
|
||||
"PNG_" to begin any of their own symbols.
|
||||
Fixed incorrect examples of callback prototypes in the manual, that were
|
||||
introduced in libpng-1.0.0.
|
||||
Removed "strip" from contrib/pngminim/*/makefile.
|
||||
Fixed a bug (present since libpng-1.0.7) that makes png_handle_sPLT() fail
|
||||
to compile when PNG_NO_POINTER_INDEXING is defined (Chubanov Kirill)
|
||||
|
||||
version 1.4.6rc01 [March 31, 2011]
|
||||
No changes.
|
||||
|
||||
version 1.4.6rc02 [April 6, 2011]
|
||||
Improved the optimization of the zlib CMF byte (see libpng-1.2.6beta03).
|
||||
|
||||
version 1.4.6 [April 8, 2011]
|
||||
No changes.
|
||||
|
||||
version 1.4.7rc01 [April 9, 2011]
|
||||
Relocated misplaced new declarations in pngwutil.c.
|
||||
|
||||
version 1.4.7 [April 9, 2011]
|
||||
Disabled PNG_PEDANTIC_WARNINGS for all MSC versions as in libpng-1.4.5.
|
||||
|
||||
version 1.4.8beta01 [June 4, 2011]
|
||||
Undef "_ALL_SOURCE" for AIX, to prevent "jmpbuf" from being redefined.
|
||||
Copied png_debug macros from pngpriv.h into pngtest.c and removed
|
||||
"#include pngpriv.h" from pngtest.c, to avoid setting a bad example.
|
||||
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
|
||||
was introduced in libpng-1.2.20beta01.
|
||||
Check for up->location !PNG_AFTER_IDAT when writing unknown chunks
|
||||
before IDAT.
|
||||
Ported bugfix in pngrtran.c from 1.5.3: when expanding a paletted image,
|
||||
always expand to RGBA if transparency is present.
|
||||
|
||||
version 1.4.8beta02 [June 5, 2011]
|
||||
Ported bugfix in pngrtran.c from 1.5.3: Ensure coefficients are OK for
|
||||
png_rgb_to_gray_fixed().
|
||||
|
||||
version 1.4.8beta03 [June 6, 2011]
|
||||
Check for integer overflow in png_set_rgb_to_gray().
|
||||
|
||||
version 1.4.8beta04 [June 7, 2011]
|
||||
Fixed uninitialized memory read in png_format_buffer() (Bug report by
|
||||
Frank Busse, related to CVE-2004-0421).
|
||||
|
||||
version 1.4.8beta05 [June 19, 2011]
|
||||
Fixed error in "ACCURATE" 16-to-8 scaling (John Bowler).
|
||||
Check for sCAL chunk too short.
|
||||
|
||||
version 1.4.8rc01 [June 30, 2011]
|
||||
No changes.
|
||||
|
||||
version 1.4.8 [July 7, 2011]
|
||||
No changes.
|
||||
|
||||
Send comments/corrections/commendations to glennrp at users.sourceforge.net
|
||||
or to png-mng-implement at lists.sf.net (subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement).
|
||||
|
||||
187
CMakeLists.txt
187
CMakeLists.txt
@@ -1,14 +1,25 @@
|
||||
cmake_minimum_required(VERSION 2.4.3)
|
||||
cmake_minimum_required(VERSION 2.4.4)
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
|
||||
"Choose the type of build, options are:
|
||||
None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
|
||||
Debug
|
||||
Release
|
||||
RelWithDebInfo
|
||||
MinSizeRel.")
|
||||
if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4)
|
||||
# workaround CMake 2.4.x bug
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
|
||||
"Choose the type of build, options are:
|
||||
None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
|
||||
Debug
|
||||
Release
|
||||
RelWithDebInfo
|
||||
MinSizeRel.")
|
||||
else()
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
|
||||
"Choose the type of build, options are:
|
||||
None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
|
||||
Debug
|
||||
Release
|
||||
RelWithDebInfo
|
||||
MinSizeRel.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
project(libpng C)
|
||||
@@ -22,7 +33,7 @@ enable_testing()
|
||||
|
||||
set(PNGLIB_MAJOR 1)
|
||||
set(PNGLIB_MINOR 4)
|
||||
set(PNGLIB_RELEASE 3)
|
||||
set(PNGLIB_RELEASE 8)
|
||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||
|
||||
@@ -96,12 +107,14 @@ set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
# to distinguish between debug and release lib
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
|
||||
|
||||
# OUR SOURCES
|
||||
set(libpng_sources
|
||||
set(libpng_public_hdrs
|
||||
png.h
|
||||
pngconf.h
|
||||
pngpriv.h
|
||||
)
|
||||
set(libpng_sources
|
||||
${libpng_public_hdrs}
|
||||
pngpriv.h
|
||||
png.c
|
||||
pngerror.c
|
||||
pngget.c
|
||||
@@ -167,6 +180,7 @@ if(PNG_SHARED)
|
||||
if(MSVC)
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES PREFIX "lib")
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES IMPORT_PREFIX "lib")
|
||||
endif()
|
||||
target_link_libraries(${PNG_LIB_NAME} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
@@ -179,6 +193,7 @@ if(PNG_STATIC)
|
||||
# msvc does not append 'lib' - do it here to have consistent name
|
||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES PREFIX "lib")
|
||||
endif()
|
||||
target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -190,61 +205,152 @@ if(PNG_TESTS AND PNG_SHARED)
|
||||
# does not work with msvc due to png_lib_ver issue
|
||||
add_executable(pngtest ${pngtest_sources})
|
||||
target_link_libraries(pngtest ${PNG_LIB_NAME})
|
||||
add_test(pngtest pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
|
||||
add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
|
||||
endif()
|
||||
|
||||
#
|
||||
# Set a variable with CMake code which:
|
||||
# Creates a symlink from src to dest (if possible) or alternatively
|
||||
# copies if different.
|
||||
macro(_png_generate_symlink_code CODE SRC DEST)
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set(_png_gsc_message "Copying ${SRC} to ${DEST} if needed")
|
||||
set(_png_gsc_operation "copy_if_different")
|
||||
else()
|
||||
set(_png_gsc_message "Symlinking ${SRC} to ${DEST}")
|
||||
set(_png_gsc_operation "create_symlink")
|
||||
endif()
|
||||
|
||||
set(${CODE} "
|
||||
message(STATUS \"${_png_gsc_message}\")
|
||||
execute_process(COMMAND \${CMAKE_COMMAND} -E ${_png_gsc_operation}
|
||||
\"${SRC}\" \"${DEST}\")
|
||||
")
|
||||
endmacro()
|
||||
|
||||
# CREATE PKGCONFIG FILES
|
||||
# we use the same files like ./configure, so we have to set its vars
|
||||
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(CMAKE_INSTALL_LIBDIR lib)
|
||||
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
|
||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
||||
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
||||
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
|
||||
|
||||
set(LIBS "-lz -lm")
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
|
||||
_png_generate_symlink_code(PNG_PC_INSTALL_CODE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng.pc)
|
||||
install(CODE ${PNG_PC_INSTALL_CODE})
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
|
||||
_png_generate_symlink_code(PNG_CONFIG_INSTALL_CODE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng-config)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config)
|
||||
install(CODE ${PNG_CONFIG_INSTALL_CODE})
|
||||
|
||||
# SET UP LINKS
|
||||
if(PNG_SHARED)
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 14.${PNGLIB_RELEASE}.1.4.3
|
||||
# VERSION 14.${PNGLIB_RELEASE}.1.4.8
|
||||
VERSION 14.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 14
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
if(PNG_STATIC)
|
||||
if(NOT WIN32)
|
||||
# that's uncool on win32 - it overwrites our static import lib...
|
||||
# MSVC doesn't use a different file extension for shared vs. static
|
||||
# libs. We are able to change OUTPUT_NAME to remove the _static
|
||||
# for all other platforms.
|
||||
if(NOT MSVC)
|
||||
set_target_properties(${PNG_LIB_NAME_STATIC} PROPERTIES
|
||||
OUTPUT_NAME ${PNG_LIB_NAME}
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If CMake > 2.4.x, we set a variable used below to export
|
||||
# targets to an export file.
|
||||
# TODO: Use VERSION_GREATER after our cmake_minimum_required >= 2.6.2
|
||||
if(CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 4)
|
||||
set(PNG_EXPORT_RULE EXPORT libpng)
|
||||
elseif(CMAKE_MAJOR_VERSION GREATER 2) # future proof
|
||||
set(PNG_EXPORT_RULE EXPORT libpng)
|
||||
endif()
|
||||
|
||||
# INSTALL
|
||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
if(PNG_SHARED)
|
||||
install(TARGETS ${PNG_LIB_NAME}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
${PNG_EXPORT_RULE}
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
# Create a symlink for libpng.dll.a => libpng14.dll.a on Cygwin
|
||||
if(CYGWIN)
|
||||
_png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE
|
||||
${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
|
||||
install(CODE ${PNG_SHARED_IMPLIB_INSTALL_CODE})
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
IF(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
_png_generate_symlink_code(PNG_SHARED_INSTALL_CODE
|
||||
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(CODE ${PNG_SHARED_INSTALL_CODE})
|
||||
install(FILES
|
||||
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ELSE(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
_png_generate_symlink_code(PNG_SHARED_INSTALL_CODE
|
||||
${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
install(CODE ${PNG_SHARED_INSTALL_CODE})
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF(CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PNG_STATIC)
|
||||
install(TARGETS ${PNG_LIB_NAME_STATIC}
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib)
|
||||
${PNG_EXPORT_RULE}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
if(NOT WIN32 OR CYGWIN)
|
||||
IF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
_png_generate_symlink_code(PNG_STATIC_INSTALL_CODE
|
||||
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
install(CODE ${PNG_STATIC_INSTALL_CODE})
|
||||
install(FILES
|
||||
${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ELSE(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
_png_generate_symlink_code(PNG_STATIC_INSTALL_CODE
|
||||
${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
install(CODE ${PNG_STATIC_INSTALL_CODE})
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
ENDIF(CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
|
||||
install(FILES png.h pngconf.h DESTINATION include)
|
||||
install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME})
|
||||
install(FILES ${libpng_public_hdrs} DESTINATION include)
|
||||
install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME})
|
||||
endif()
|
||||
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||
@@ -253,20 +359,29 @@ if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
|
||||
endif()
|
||||
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
|
||||
# Install man pages
|
||||
install(FILES libpng.3 libpngpf.3 DESTINATION man/man3)
|
||||
install(FILES png.5 DESTINATION man/man5)
|
||||
if(NOT PNG_MAN_DIR)
|
||||
set(PNG_MAN_DIR "share/man")
|
||||
endif()
|
||||
install(FILES libpng.3 libpngpf.3 DESTINATION ${PNG_MAN_DIR}/man3)
|
||||
install(FILES png.5 DESTINATION ${PNG_MAN_DIR}/man5)
|
||||
# Install pkg-config files
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
|
||||
DESTINATION lib/pkgconfig)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
|
||||
DESTINATION bin)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc
|
||||
DESTINATION lib/pkgconfig)
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
|
||||
DESTINATION bin)
|
||||
endif()
|
||||
|
||||
# what's with libpng.txt and all the extra files?
|
||||
# On versions of CMake that support it, create an export file CMake
|
||||
# users can include() to import our targets
|
||||
if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL )
|
||||
install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
|
||||
endif()
|
||||
|
||||
# what's with libpng-manual.txt and all the extra files?
|
||||
|
||||
|
||||
# UNINSTALL
|
||||
|
||||
7
INSTALL
7
INSTALL
@@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.4.3 - June 26, 2010
|
||||
Installing libpng version 1.4.8 - July 7, 2011
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
@@ -46,7 +46,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.4.3" or "libpng14" and "zlib-1.2.3"
|
||||
might be called "libpng-1.4.8" or "libpng14" and "zlib-1.2.3"
|
||||
or "zlib123") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@@ -62,7 +62,7 @@ Your directory structure should look like this:
|
||||
configure.ac, configure, Makefile.am, Makefile.in,
|
||||
autogen.sh, config.guess, ltmain.sh, missing,
|
||||
aclocal.m4, config.h.in, config.sub,
|
||||
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
|
||||
depcomp, install-sh, test-pngtest.sh
|
||||
contrib
|
||||
gregbook
|
||||
pngminim
|
||||
@@ -73,6 +73,7 @@ Your directory structure should look like this:
|
||||
cbuilder5 (Borland)
|
||||
visualc6 (msvc)
|
||||
visualc71
|
||||
vstudio
|
||||
xcode
|
||||
scripts
|
||||
makefile.*
|
||||
|
||||
6
LICENSE
6
LICENSE
@@ -10,8 +10,8 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are
|
||||
Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.8, July 7, 2011, are
|
||||
Copyright (c) 2004, 2006-2010 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
|
||||
|
||||
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
June 26, 2010
|
||||
July 7, 2011
|
||||
|
||||
@@ -12,13 +12,13 @@ check_PROGRAMS= pngtest
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
TESTS = test-pngtest.sh
|
||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
|
||||
# man pages
|
||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
binconfigs= libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
EXTRA_SCRIPTS= libpng-config libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
bin_SCRIPTS= @binconfigs@
|
||||
|
||||
@@ -62,7 +62,6 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
||||
EXTRA_DIST= \
|
||||
ANNOUNCE CHANGES INSTALL LICENSE README TODO \
|
||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||
${srcdir}/projects/cbuilder5/* \
|
||||
${srcdir}/projects/visualc6/* \
|
||||
${srcdir}/projects/visualc71/* \
|
||||
${srcdir}/projects/xcode/* \
|
||||
@@ -73,7 +72,7 @@ EXTRA_DIST= \
|
||||
${srcdir}/contrib/pngsuite/* \
|
||||
${srcdir}/contrib/visupng/* \
|
||||
$(TESTS) \
|
||||
example.c libpng-1.4.3.txt
|
||||
example.c libpng-1.4.8.txt
|
||||
|
||||
CLEANFILES= pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
|
||||
libpng.sym
|
||||
@@ -120,7 +119,7 @@ install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||
@set -x;\
|
||||
cd $(DESTDIR)$(libdir);\
|
||||
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib; do\
|
||||
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib dll.a; do\
|
||||
rm -f libpng.$$ext;\
|
||||
if test -f $(PNGLIB_BASENAME).$$ext; then\
|
||||
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
|
||||
|
||||
33
Makefile.in
33
Makefile.in
@@ -1,4 +1,4 @@
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
@@ -49,14 +49,14 @@ DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/libpng-config.in $(srcdir)/libpng.pc.in \
|
||||
$(top_srcdir)/configure INSTALL TODO config.guess config.sub \
|
||||
depcomp install-sh ltmain.sh missing mkinstalldirs
|
||||
depcomp install-sh ltmain.sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = libpng.pc libpng-config
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
@@ -236,7 +236,7 @@ am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
binconfigs = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
@@ -262,7 +262,6 @@ libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -289,7 +288,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
TESTS = test-pngtest.sh
|
||||
TESTS_ENVIRONMENT = srcdir=$(srcdir)
|
||||
TESTS_ENVIRONMENT = srcdir=$(srcdir)
|
||||
|
||||
# man pages
|
||||
dist_man_MANS = libpng.3 libpngpf.3 png.5
|
||||
@@ -322,7 +321,6 @@ pkgconfig_DATA = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc
|
||||
EXTRA_DIST = \
|
||||
ANNOUNCE CHANGES INSTALL LICENSE README TODO \
|
||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||
${srcdir}/projects/cbuilder5/* \
|
||||
${srcdir}/projects/visualc6/* \
|
||||
${srcdir}/projects/visualc71/* \
|
||||
${srcdir}/projects/xcode/* \
|
||||
@@ -333,7 +331,7 @@ EXTRA_DIST = \
|
||||
${srcdir}/contrib/pngsuite/* \
|
||||
${srcdir}/contrib/visupng/* \
|
||||
$(TESTS) \
|
||||
example.c libpng-1.4.3.txt
|
||||
example.c libpng-1.4.8.txt
|
||||
|
||||
CLEANFILES = pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers \
|
||||
libpng.sym
|
||||
@@ -390,7 +388,7 @@ config.h: stamp-h1
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
@@ -432,7 +430,7 @@ clean-libLTLIBRARIES:
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES)
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la: $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_DEPENDENCIES)
|
||||
$(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LINK) -rpath $(libdir) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS) $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@@ -443,7 +441,7 @@ clean-checkPROGRAMS:
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES)
|
||||
pngtest$(EXEEXT): $(pngtest_OBJECTS) $(pngtest_DEPENDENCIES)
|
||||
@rm -f pngtest$(EXEEXT)
|
||||
$(LINK) $(pngtest_OBJECTS) $(pngtest_LDADD) $(LIBS)
|
||||
install-binSCRIPTS: $(bin_SCRIPTS)
|
||||
@@ -945,7 +943,8 @@ distdir: $(DISTFILES)
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
|| find "$(distdir)" -type d ! -perm -755 \
|
||||
-exec chmod u+rwx,go+rx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
@@ -989,17 +988,17 @@ dist dist-all: distdir
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
@@ -1245,7 +1244,7 @@ install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||
@set -x;\
|
||||
cd $(DESTDIR)$(libdir);\
|
||||
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib; do\
|
||||
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ sl dylib dll.a; do\
|
||||
rm -f libpng.$$ext;\
|
||||
if test -f $(PNGLIB_BASENAME).$$ext; then\
|
||||
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
|
||||
|
||||
23
README
23
README
@@ -1,4 +1,4 @@
|
||||
README for libpng version 1.4.3 - June 26, 2010 (shared library 14.0)
|
||||
README for libpng version 1.4.8 - July 7, 2011 (shared library 14.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
@@ -114,19 +114,16 @@ given in previous versions of this document. He and Andreas will
|
||||
read mail addressed to the png-implement list, however.
|
||||
|
||||
Please do not send general questions about PNG. Send them to
|
||||
the (png-list at ccrc.wustl.edu, subscription required, write to
|
||||
majordomo at ccrc.wustl.edu with "subscribe png-list" in your message).
|
||||
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
|
||||
get them in the end anyway. If you have a question about something
|
||||
png-mng-misc at lists.sf.net (subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
|
||||
subscribe). 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,
|
||||
and ...". If in doubt, send questions to me. I'll bounce them
|
||||
to others, if necessary.
|
||||
|
||||
Please do not send suggestions on how to change PNG. We have
|
||||
been discussing PNG for nine years now, and it is official and
|
||||
been discussing PNG for sixteen years now, and it is official and
|
||||
finished. If you have suggestions for libpng, however, I'll
|
||||
gladly listen. Even if your suggestion is not used immediately,
|
||||
it may be used later.
|
||||
@@ -185,9 +182,9 @@ Files in this distribution:
|
||||
makefile.std => Generic UNIX makefile (cc, creates static
|
||||
libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@@ -209,12 +206,12 @@ Files in this distribution:
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics
|
||||
(gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
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
|
||||
|
||||
1041
aclocal.m4
vendored
1041
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
35
autogen.sh
35
autogen.sh
@@ -4,22 +4,31 @@
|
||||
#
|
||||
# WARNING: if you run this you will change the versions
|
||||
# of the tools which are used and, maybe, required!
|
||||
touch Makefile.am configure.ac
|
||||
|
||||
# You can define your own replacements in your environment.
|
||||
# $AUTOCONF, $AUTOMAKE, $AUTOHEADER, $AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
|
||||
|
||||
touch Makefile.am configure.ac
|
||||
{
|
||||
echo "running libtoolize" >&2
|
||||
libtoolize --force --copy --automake
|
||||
LT=${LIBTOOLIZE-libtoolize}
|
||||
echo "running $LT" >&2
|
||||
$LT --force --copy --automake
|
||||
} && {
|
||||
echo "running aclocal" >&2
|
||||
aclocal
|
||||
AL=${ACLOCAL-aclocal}
|
||||
echo "running $AL" >&2
|
||||
$AL
|
||||
} && {
|
||||
echo "running autoheader [ignore the warnings]" >&2
|
||||
autoheader
|
||||
AH=${AUTOHEADER-autoheader}
|
||||
echo "running $AH [ignore the warnings]" >&2
|
||||
$AH
|
||||
} && {
|
||||
echo "running automake" >&2
|
||||
automake --force-missing --foreign -a -c
|
||||
AM=${AUTOMAKE-automake}
|
||||
echo "running $AM" >&2
|
||||
$AM --force-missing --foreign -a -c
|
||||
} && {
|
||||
echo "running autoconf" >&2
|
||||
autoconf
|
||||
AC=${AUTOCONF-autoconf}
|
||||
echo "running $AC" >&2
|
||||
$AC
|
||||
} &&
|
||||
echo "autogen complete" >&2 ||
|
||||
echo "ERROR: autogen.sh failed, autogen is incomplete" >&2
|
||||
echo "autogen complete" >&2 ||
|
||||
echo "ERROR: autogen.sh failed, autogen is incomplete" >&2
|
||||
|
||||
196
config.guess
vendored
196
config.guess
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-04-27'
|
||||
timestamp='2009-11-20'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -27,16 +27,16 @@ timestamp='2009-04-27'
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit build system type.
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
| grep -q __ELF__
|
||||
then
|
||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||
# Return netbsd for either. FIX?
|
||||
@@ -333,6 +333,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
|
||||
echo i386-pc-auroraux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
@@ -656,7 +659,7 @@ EOF
|
||||
# => hppa64-hp-hpux11.23
|
||||
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
||||
grep __LP64__ >/dev/null
|
||||
grep -q __LP64__
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
@@ -807,12 +810,12 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd | genuineintel)
|
||||
authenticamd | genuineintel | EM64T)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
@@ -822,6 +825,9 @@ EOF
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
8664:Windows_NT:*)
|
||||
echo x86_64-pc-mks
|
||||
exit ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
@@ -851,6 +857,20 @@ EOF
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
@@ -873,6 +893,17 @@ EOF
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
@@ -882,78 +913,34 @@ EOF
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:*)
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#undef ${UNAME_MACHINE}
|
||||
#undef ${UNAME_MACHINE}el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
CPU=${UNAME_MACHINE}el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
CPU=${UNAME_MACHINE}
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
@@ -962,8 +949,11 @@ EOF
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
@@ -986,66 +976,6 @@ EOF
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||
exit ;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
}
|
||||
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
# earlier versions are messed up and put the nodename in both
|
||||
@@ -1074,7 +1004,7 @@ EOF
|
||||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i*86:*DOS:*:*)
|
||||
@@ -1182,7 +1112,7 @@ EOF
|
||||
rs6000:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
|
||||
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
@@ -1275,6 +1205,16 @@ EOF
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
|
||||
43
config.sub
vendored
43
config.sub
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-04-17'
|
||||
timestamp='2009-11-20'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -32,13 +32,16 @@ timestamp='2009-04-17'
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
@@ -149,10 +152,13 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray)
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
@@ -281,6 +287,7 @@ case $basic_machine in
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
@@ -288,13 +295,14 @@ case $basic_machine in
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
@@ -337,7 +345,7 @@ case $basic_machine in
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@@ -365,7 +373,7 @@ case $basic_machine in
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
@@ -374,6 +382,7 @@ case $basic_machine in
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| tron-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
@@ -467,6 +476,10 @@ case $basic_machine in
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
bluegene*)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
@@ -719,6 +732,9 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
@@ -1240,6 +1256,9 @@ case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
@@ -1260,9 +1279,9 @@ case $os in
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -kopensolaris* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
@@ -1283,7 +1302,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1613,7 +1632,7 @@ case $basic_machine in
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
-cnk*|-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
|
||||
25
configure.ac
25
configure.ac
@@ -16,17 +16,17 @@ dnl should not be necessary to regenerate configure if the time
|
||||
dnl stamps are correct
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.4.3], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.4.8], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.4.3
|
||||
dnl Version number stuff here:
|
||||
|
||||
PNGLIB_VERSION=1.4.8
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=4
|
||||
PNGLIB_RELEASE=3
|
||||
PNGLIB_RELEASE=8
|
||||
|
||||
dnl End of version number stuff
|
||||
|
||||
@@ -38,11 +38,10 @@ AC_PROG_CC
|
||||
AC_PROG_LD
|
||||
AC_PROG_CPP
|
||||
AC_CHECK_TOOL(SED, sed, :)
|
||||
AC_LIBTOOL_WIN32_DLL
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_LIBTOOL
|
||||
LT_INIT([win32-dll])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
@@ -69,6 +68,15 @@ LIBPNG_DEFINES=$LIBPNG_DEFINES
|
||||
AC_SUBST(LIBPNG_DEFINES)
|
||||
|
||||
AC_MSG_CHECKING([if libraries can be versioned])
|
||||
# Special case for PE/COFF platforms: ld reports
|
||||
# support for version-script, but doesn't actually
|
||||
# DO anything with it.
|
||||
case $host in
|
||||
*cygwin* | *mingw32* )
|
||||
have_ld_version_script=no
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
* )
|
||||
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
||||
if test "$GLD"; then
|
||||
have_ld_version_script=yes
|
||||
@@ -78,6 +86,9 @@ else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_WARN(*** You have not enabled versioned symbols.)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
|
||||
|
||||
if test "$have_ld_version_script" = "yes"; then
|
||||
|
||||
@@ -165,7 +165,7 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
|
||||
rpng is a simple PNG viewer that can display transparent PNGs with a
|
||||
specified background color; for example,
|
||||
|
||||
rpng -bgcolor #ff0000 toucan.png
|
||||
rpng -bgcolor \#ff0000 toucan.png
|
||||
|
||||
would display the image with a red background. rpng2 is a progressive
|
||||
viewer that simulates a web browser in some respects; it can display
|
||||
|
||||
@@ -138,7 +138,7 @@ int readpng2_init(mainprog_info *mainprog_ptr)
|
||||
* version recognizes more chunks, add them to this list. If a
|
||||
* future version of readpng2.c recognizes more chunks, delete them
|
||||
* from this list. */
|
||||
static const png_byte chunks_to_ignore[] = {
|
||||
static /* const */ png_byte chunks_to_ignore[] = {
|
||||
99, 72, 82, 77, '\0', /* cHRM */
|
||||
104, 73, 83, 84, '\0', /* hIST */
|
||||
105, 67, 67, 80, '\0', /* iCCP */
|
||||
|
||||
@@ -85,7 +85,33 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <windows.h>
|
||||
#ifdef __CYGWIN__
|
||||
/* getch replacement. Turns out, we don't really need this,
|
||||
* but leave it here if we ever enable any of the uses of
|
||||
* _getch in the main code
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <termio.h>
|
||||
#include <sys/ioctl.h>
|
||||
int repl_getch( void )
|
||||
{
|
||||
char ch;
|
||||
int fd = fileno(stdin);
|
||||
struct termio old_tty, new_tty;
|
||||
|
||||
ioctl(fd, TCGETA, &old_tty);
|
||||
new_tty = old_tty;
|
||||
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
|
||||
ioctl(fd, TCSETA, &new_tty);
|
||||
fread(&ch, 1, sizeof(ch), stdin);
|
||||
ioctl(fd, TCSETA, &old_tty);
|
||||
|
||||
return ch;
|
||||
}
|
||||
#define _getch repl_getch
|
||||
#else
|
||||
#include <conio.h> /* only for _getch() */
|
||||
#endif
|
||||
|
||||
/* #define DEBUG : this enables the Trace() macros */
|
||||
|
||||
@@ -153,7 +179,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
|
||||
filename = (char *)NULL;
|
||||
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
/* First reenable console output, which normally goes to the bit bucket
|
||||
* for windowed apps. Closing the console window will terminate the
|
||||
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
|
||||
@@ -162,6 +188,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
AllocConsole();
|
||||
freopen("CONOUT$", "a", stderr);
|
||||
freopen("CONOUT$", "a", stdout);
|
||||
#endif
|
||||
|
||||
|
||||
/* Next set the default value for our display-system exponent, i.e.,
|
||||
@@ -279,7 +306,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng_version_info();
|
||||
@@ -293,11 +322,15 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
"\t\t (e.g., ``#ff7700'' for orange: same as HTML colors);\n"
|
||||
"\t\t used with transparent images\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
#ifndef __CYGWIN__
|
||||
"Press Q or Esc to quit this usage screen.\n"
|
||||
#endif
|
||||
"\n", PROGNAME, default_display_exponent);
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -333,18 +366,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
#ifndef __CYGWIN__
|
||||
fprintf(stderr,
|
||||
"\n [console window: closing this window will terminate %s]\n\n",
|
||||
PROGNAME);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -417,7 +456,12 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
/* wait for the user to tell us when to quit */
|
||||
|
||||
printf(
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
|
||||
#ifndef __CYGWIN__
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
|
||||
#else
|
||||
"Done. Press mouse button 1 (within image window) to quit.\n"
|
||||
#endif
|
||||
);
|
||||
fflush(stdout);
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0)) {
|
||||
|
||||
@@ -96,7 +96,33 @@
|
||||
#include <time.h>
|
||||
#include <math.h> /* only for PvdM background code */
|
||||
#include <windows.h>
|
||||
#ifdef __CYGWIN__
|
||||
/* getch replacement. Turns out, we don't really need this,
|
||||
* but leave it here if we ever enable any of the uses of
|
||||
* _getch in the main code
|
||||
*/
|
||||
#include <unistd.h>
|
||||
#include <termio.h>
|
||||
#include <sys/ioctl.h>
|
||||
int repl_getch( void )
|
||||
{
|
||||
char ch;
|
||||
int fd = fileno(stdin);
|
||||
struct termio old_tty, new_tty;
|
||||
|
||||
ioctl(fd, TCGETA, &old_tty);
|
||||
new_tty = old_tty;
|
||||
new_tty.c_lflag &= ~(ICANON | ECHO | ISIG);
|
||||
ioctl(fd, TCSETA, &new_tty);
|
||||
fread(&ch, 1, sizeof(ch), stdin);
|
||||
ioctl(fd, TCSETA, &old_tty);
|
||||
|
||||
return ch;
|
||||
}
|
||||
#define _getch repl_getch
|
||||
#else
|
||||
#include <conio.h> /* only for _getch() */
|
||||
#endif
|
||||
|
||||
/* all for PvdM background code: */
|
||||
#ifndef PI
|
||||
@@ -270,7 +296,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
filename = (char *)NULL;
|
||||
memset(&rpng2_info, 0, sizeof(mainprog_info));
|
||||
|
||||
|
||||
#ifndef __CYGWIN__
|
||||
/* Next reenable console output, which normally goes to the bit bucket
|
||||
* for windowed apps. Closing the console window will terminate the
|
||||
* app. Thanks to David.Geldreich@realviz.com for supplying the magical
|
||||
@@ -279,7 +305,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
AllocConsole();
|
||||
freopen("CONOUT$", "a", stderr);
|
||||
freopen("CONOUT$", "a", stdout);
|
||||
|
||||
#endif
|
||||
|
||||
/* Set the default value for our display-system exponent, i.e., the
|
||||
* product of the CRT exponent and the exponent corresponding to
|
||||
@@ -413,7 +439,9 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
/* print usage screen if any errors up to this point */
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, "\n%s %s: %s\n\n", PROGNAME, VERSION, appname);
|
||||
readpng2_version_info();
|
||||
@@ -432,16 +460,23 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
" -timing\tenables delay for every block read, to simulate modem\n"
|
||||
"\t\t download of image (~36 Kbps)\n"
|
||||
"\nPress Q, Esc or mouse button 1 after image is displayed to quit.\n"
|
||||
#ifndef __CYGWIN__
|
||||
"Press Q or Esc to quit this usage screen. ",
|
||||
#else
|
||||
,
|
||||
#endif
|
||||
PROGNAME,
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
|
||||
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__)) && \
|
||||
!(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||
(int)strlen(PROGNAME), " ",
|
||||
#endif
|
||||
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat);
|
||||
fflush(stderr);
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -478,18 +513,24 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PSTR cmd, int showmode)
|
||||
|
||||
|
||||
if (error) {
|
||||
#ifndef __CYGWIN__
|
||||
int ch;
|
||||
#endif
|
||||
|
||||
fprintf(stderr, PROGNAME ": aborting.\n");
|
||||
#ifndef __CYGWIN__
|
||||
do
|
||||
ch = _getch();
|
||||
while (ch != 'q' && ch != 'Q' && ch != 0x1B);
|
||||
#endif
|
||||
exit(2);
|
||||
} else {
|
||||
fprintf(stderr, "\n%s %s: %s\n", PROGNAME, VERSION, appname);
|
||||
#ifndef __CYGWIN__
|
||||
fprintf(stderr,
|
||||
"\n [console window: closing this window will terminate %s]\n\n",
|
||||
PROGNAME);
|
||||
#endif
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
@@ -1132,7 +1173,12 @@ static void rpng2_win_finish_display()
|
||||
|
||||
rpng2_info.state = kDone;
|
||||
printf(
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n");
|
||||
#ifndef __CYGWIN__
|
||||
"Done. Press Q, Esc or mouse button 1 (within image window) to quit.\n"
|
||||
#else
|
||||
"Done. Press mouse button 1 (within image window) to quit.\n"
|
||||
#endif
|
||||
);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
cp ../../pngminus/png2pnm.c pngm2pnm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
|
||||
@@ -34,7 +34,6 @@ all: pngm2pnm$(E)
|
||||
|
||||
pngm2pnm$(E): $(OBJS)
|
||||
$(LD) -o pngm2pnm$(E) $(OBJS)
|
||||
strip pngm2pnm$(E)
|
||||
|
||||
clean:
|
||||
$(RM) pngm2pnm$(O)
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
#ifndef MINRDPNGCONF_H
|
||||
#define MINRDPNGCONF_H
|
||||
|
||||
#ifdef NJET
|
||||
/* No 16-bit support beyond reading with strip_16 */
|
||||
#endif
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
@@ -42,6 +38,7 @@
|
||||
#define PNG_NO_READ_gAMA
|
||||
#define PNG_NO_READ_hIST
|
||||
#define PNG_NO_READ_iCCP
|
||||
#define PNG_NO_READ_oFFs
|
||||
#define PNG_NO_READ_pCAL
|
||||
#define PNG_NO_READ_pHYs
|
||||
#define PNG_NO_READ_sBIT
|
||||
@@ -55,7 +52,6 @@
|
||||
#define PNG_NO_READ_EMPTY_PLTE
|
||||
#define PNG_NO_READ_OPT_PLTE
|
||||
#define PNG_NO_READ_STRIP_ALPHA
|
||||
#define PNG_NO_READ_oFFs
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
|
||||
@@ -32,7 +32,6 @@ all: pnm2pngm$(E)
|
||||
|
||||
pnm2pngm$(E): $(OBJS)
|
||||
$(LD) -o pnm2pngm$(E) $(OBJS)
|
||||
strip pnm2pngm$(E)
|
||||
|
||||
clean:
|
||||
$(RM) pnm2pngm$(O)
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
|
||||
#define PNG_NO_WRITE_BACKGROUND
|
||||
#define PNG_NO_WRITE_BGR
|
||||
#define PNG_NO_WRITE_GAMMA
|
||||
#define PNG_NO_WRITE_QUANTIZE
|
||||
#define PNG_NO_WRITE_INVERT
|
||||
#define PNG_NO_WRITE_SHIFT
|
||||
@@ -71,6 +70,6 @@
|
||||
#define PNG_NO_EASY_ACCESS
|
||||
#define PNG_NO_USER_LIMITS
|
||||
#define PNG_NO_SET_USER_LIMITS
|
||||
#define PNG_NO_TIME_RFC1143
|
||||
#define PNG_NO_TIME_RFC1123
|
||||
|
||||
#endif /* MINWRPNGCONF_H */
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] .
|
||||
cp ../../gregbook/COPYING ../../gregbook/LICENSE .
|
||||
cp ../../../*.h .
|
||||
|
||||
@@ -50,7 +50,6 @@ all: rpng2-x$(E)
|
||||
|
||||
rpng2-x$(E): $(OBJS)
|
||||
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
|
||||
strip rpng2-x$(E)
|
||||
|
||||
clean:
|
||||
$(RM) rpng2-x$(O)
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define PNG_NO_READ_cHRM
|
||||
#define PNG_NO_READ_hIST
|
||||
#define PNG_NO_READ_iCCP
|
||||
#define PNG_NO_READ_oFFs
|
||||
#define PNG_NO_READ_pCAL
|
||||
#define PNG_NO_READ_pHYs
|
||||
#define PNG_NO_READ_sBIT
|
||||
@@ -46,7 +47,6 @@
|
||||
#define PNG_NO_READ_EMPTY_PLTE
|
||||
#define PNG_NO_READ_OPT_PLTE
|
||||
#define PNG_NO_READ_STRIP_ALPHA
|
||||
#define PNG_NO_READ_oFFs
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
@@ -63,6 +63,6 @@
|
||||
#define PNG_NO_EASY_ACCESS
|
||||
#define PNG_NO_USER_LIMITS
|
||||
#define PNG_NO_SET_USER_LIMITS
|
||||
#define PNG_NO_TIME_RFC1143
|
||||
#define PNG_NO_TIME_RFC1123
|
||||
|
||||
#endif /* MINPRDPNGCONF_H */
|
||||
|
||||
@@ -1,41 +1,58 @@
|
||||
|
||||
pngsuite
|
||||
--------
|
||||
(c) Willem van Schaik, 1999
|
||||
(c) Willem van Schaik, 1999, 2011
|
||||
|
||||
Permission to use, copy, and distribute these images for any purpose and
|
||||
without fee is hereby granted.
|
||||
Permission to use, copy, modify, and distribute these images for any
|
||||
purpose and without fee is hereby granted.
|
||||
|
||||
These 15 images are part of the much larger PngSuite test-set of
|
||||
The 15 "bas*.png" images are part of the much larger PngSuite test-set of
|
||||
images, available for developers of PNG supporting software. The
|
||||
complete set, available at http:/www.schaik.com/pngsuite/, contains
|
||||
a variety of images to test interlacing, gamma settings, ancillary
|
||||
chunks, etc.
|
||||
|
||||
The "ft*.png" images are "free/libre" replacements for the transparent
|
||||
corresponding t*.png images in the PngSuite.
|
||||
|
||||
The images in this directory represent the basic PNG color-types:
|
||||
grayscale (1-16 bit deep), full color (8 or 16 bit), paletted
|
||||
(1-8 bit) and grayscale or color images with alpha channel. You
|
||||
can use them to test the proper functioning of PNG software.
|
||||
|
||||
filename depth type
|
||||
filename depth type
|
||||
------------ ------ --------------
|
||||
basn0g01.png 1-bit grayscale
|
||||
basn0g02.png 2-bit grayscale
|
||||
basn0g04.png 4-bit grayscale
|
||||
basn0g08.png 8-bit grayscale
|
||||
basn0g16.png 16-bit grayscale
|
||||
basn2c08.png 8-bit truecolor
|
||||
basn2c16.png 16-bit truecolor
|
||||
basn3p01.png 1-bit paletted
|
||||
basn3p02.png 2-bit paletted
|
||||
basn3p04.png 4-bit paletted
|
||||
basn3p08.png 8-bit paletted
|
||||
basn4a08.png 8-bit gray with alpha
|
||||
basn4a16.png 16-bit gray with alpha
|
||||
basn6a08.png 8-bit RGBA
|
||||
basn6a16.png 16-bit RGBA
|
||||
basn0g01.png 1-bit grayscale
|
||||
basn0g02.png 2-bit grayscale
|
||||
basn0g04.png 4-bit grayscale
|
||||
basn0g08.png 8-bit grayscale
|
||||
basn0g16.png 16-bit grayscale
|
||||
basn2c08.png 8-bit truecolor
|
||||
basn2c16.png 16-bit truecolor
|
||||
basn3p01.png 1-bit paletted
|
||||
basn3p02.png 2-bit paletted
|
||||
basn3p04.png 4-bit paletted
|
||||
basn3p08.png 8-bit paletted
|
||||
basn4a08.png 8-bit gray with alpha
|
||||
basn4a16.png 16-bit gray with alpha
|
||||
basn6a08.png 8-bit RGBA
|
||||
basn6a16.png 16-bit RGBA
|
||||
|
||||
Here is the correct result of typing "pngtest -m *.png" in
|
||||
ftbbn0g04.png 4-bit grayscale, black bKGD
|
||||
ftbbn2c16.png 16-bit truecolor, black bKGD
|
||||
ftbbn3p08.png 8-bit paletted, black bKGD
|
||||
ftbgn2c16.png 16-bit truecolor, gray bKGD
|
||||
ftbgn3p08.png 8-bit paletted, gray bKGD
|
||||
ftbrn2c08.png 8-bit truecolor, red bKGD
|
||||
ftbwn0g16.png 16-bit gray, white bKGD
|
||||
ftbwn3p08.png 8-bit paletted, white bKGD
|
||||
ftbyn3p08.png 8-bit paletted, yellow bKGD
|
||||
ftp0n0g08.png 8-bit grayscale, opaque
|
||||
ftp0n2c08.png 8-bit truecolor, opaque
|
||||
ftp0n3p08.png 8-bit paletted, opaque
|
||||
ftp1n3p08.png 8-bit paletted, no bKGD
|
||||
|
||||
Here is the correct result of typing "pngtest -m bas*.png" in
|
||||
this directory:
|
||||
|
||||
Testing basn0g01.png: PASS (524 zero samples)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.4.3 - June 26, 2010
|
||||
libpng version 1.4.8 - July 7, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
This document is released under the libpng license.
|
||||
For conditions of distribution and use, see the disclaimer
|
||||
@@ -11,9 +11,9 @@ libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010
|
||||
libpng versions 0.97, January 1998, through 1.4.8 - July 7, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
||||
Updated and distributed by Andreas Dilger
|
||||
@@ -278,7 +278,7 @@ Setting up callback code
|
||||
You can set up a callback function to handle any unknown chunks in the
|
||||
input stream. You must supply the function
|
||||
|
||||
read_chunk_callback(png_ptr ptr,
|
||||
read_chunk_callback(png_structp png_ptr,
|
||||
png_unknown_chunkp chunk);
|
||||
{
|
||||
/* The unknown chunk structure contains your
|
||||
@@ -324,8 +324,8 @@ 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.
|
||||
You must supply a function
|
||||
|
||||
void read_row_callback(png_ptr ptr, png_uint_32 row,
|
||||
int pass);
|
||||
void read_row_callback(png_structp png_ptr,
|
||||
png_uint_32 row, int pass);
|
||||
{
|
||||
/* put your code here */
|
||||
}
|
||||
@@ -576,15 +576,17 @@ in until png_read_end() has read the chunk data following the image.
|
||||
PNG_COLOR_MASK_COLOR
|
||||
PNG_COLOR_MASK_ALPHA
|
||||
|
||||
interlace_type - (PNG_INTERLACE_NONE or
|
||||
PNG_INTERLACE_ADAM7)
|
||||
|
||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||
for PNG 1.0)
|
||||
|
||||
filter_method - (must be PNG_FILTER_TYPE_BASE
|
||||
for PNG 1.0, and can also be
|
||||
PNG_INTRAPIXEL_DIFFERENCING if
|
||||
the PNG datastream is embedded in
|
||||
a MNG-1.0 datastream)
|
||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||
for PNG 1.0)
|
||||
interlace_type - (PNG_INTERLACE_NONE or
|
||||
PNG_INTERLACE_ADAM7)
|
||||
|
||||
Any or all of interlace_type, compression_type, or
|
||||
filter_method can be NULL if you are
|
||||
@@ -605,11 +607,11 @@ in until png_read_end() has read the chunk data following the image.
|
||||
info_ptr);
|
||||
color_type = png_get_color_type(png_ptr,
|
||||
info_ptr);
|
||||
filter_method = png_get_filter_type(png_ptr,
|
||||
interlace_type = png_get_interlace_type(png_ptr,
|
||||
info_ptr);
|
||||
compression_type = png_get_compression_type(png_ptr,
|
||||
info_ptr);
|
||||
interlace_type = png_get_interlace_type(png_ptr,
|
||||
filter_method = png_get_filter_type(png_ptr,
|
||||
info_ptr);
|
||||
|
||||
channels = png_get_channels(png_ptr, info_ptr);
|
||||
@@ -658,14 +660,14 @@ pointer into the info_ptr is returned for any complex types.
|
||||
|
||||
png_get_iCCP(png_ptr, info_ptr, &name,
|
||||
&compression_type, &profile, &proflen);
|
||||
name - The profile name.
|
||||
compression - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
name - The profile name.
|
||||
compression_type - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
|
||||
png_get_sBIT(png_ptr, info_ptr, &sig_bit);
|
||||
sig_bit - the number of significant bits for
|
||||
@@ -678,11 +680,11 @@ pointer into the info_ptr is returned for any complex types.
|
||||
&num_trans, &trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
num_trans - number of transparent entries
|
||||
(PNG_INFO_tRNS)
|
||||
trans_color - graylevel or color sample values of
|
||||
the single transparent color for
|
||||
non-paletted images (PNG_INFO_tRNS)
|
||||
num_trans - number of transparent entries
|
||||
(PNG_INFO_tRNS)
|
||||
|
||||
png_get_hIST(png_ptr, info_ptr, &hist);
|
||||
(PNG_INFO_hIST)
|
||||
@@ -903,7 +905,7 @@ things.
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
|
||||
As of libpng version 1.4.3, not all possible expansions are supported.
|
||||
As of libpng version 1.4.8, not all possible expansions are supported.
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
indexed with depth<8, other numerals represent the color type, "T" means
|
||||
@@ -1233,8 +1235,8 @@ with
|
||||
|
||||
You must supply the function
|
||||
|
||||
void read_transform_fn(png_ptr ptr, row_info_ptr
|
||||
row_info, png_bytep data)
|
||||
void read_transform_fn(png_structp png_ptr, png_row_infop
|
||||
row_info, png_bytep data)
|
||||
|
||||
See pngtest.c for a working example. Your function will be called
|
||||
after all of the other transformations have been processed.
|
||||
@@ -1757,7 +1759,7 @@ called after each row has been written, which you can use to control
|
||||
a progress meter or the like. It's demonstrated in pngtest.c.
|
||||
You must supply a function
|
||||
|
||||
void write_row_callback(png_ptr, png_uint_32 row,
|
||||
void write_row_callback(png_structp png_ptr, png_uint_32 row,
|
||||
int pass);
|
||||
{
|
||||
/* put your code here */
|
||||
@@ -1932,14 +1934,14 @@ width, height, bit_depth, and color_type must be the same in each call.
|
||||
|
||||
png_set_iCCP(png_ptr, info_ptr, name, compression_type,
|
||||
profile, proflen);
|
||||
name - The profile name.
|
||||
compression - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
name - The profile name.
|
||||
compression_type - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
|
||||
png_set_sBIT(png_ptr, info_ptr, sig_bit);
|
||||
sig_bit - the number of significant bits for
|
||||
@@ -2314,7 +2316,7 @@ with
|
||||
|
||||
You must supply the function
|
||||
|
||||
void write_transform_fn(png_ptr ptr, row_info_ptr
|
||||
void write_transform_fn(png_structp png_ptr, png_row_infop
|
||||
row_info, png_bytep data)
|
||||
|
||||
See pngtest.c for a working example. Your function will be called
|
||||
@@ -3122,6 +3124,12 @@ deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8() because the former function also
|
||||
expanded palette images.
|
||||
|
||||
Macros for png_get_uint_16, png_get_uint_32, and png_get_int_32
|
||||
were added and are used by default instead of the corresponding
|
||||
functions. Unfortunately,
|
||||
from libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
@@ -3149,7 +3157,8 @@ The png_zalloc() function no longer zeroes out the memory that it
|
||||
allocates.
|
||||
|
||||
Support for dithering was disabled by default in libpng-1.4.0, because
|
||||
been well tested and doesn't actually "dither". The code was not
|
||||
it has not been well tested and doesn't actually "dither".
|
||||
The code was not
|
||||
removed, however, and could be enabled by building libpng with
|
||||
PNG_READ_DITHER_SUPPORTED defined. In libpng-1.4.2, this support
|
||||
was reenabled, but the function was renamed png_set_quantize() to
|
||||
@@ -3272,9 +3281,10 @@ above the comment that says
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
|
||||
The names of all exported functions and variables begin
|
||||
with "png_", and all publicly visible C preprocessor
|
||||
macros begin with "PNG_".
|
||||
To avoid polluting the global namespace, the names of all exported
|
||||
functions and variables begin with "png_", and all publicly visible C
|
||||
preprocessor macros begin with "PNG_". We request that applications that
|
||||
use libpng *not* begin any of their own symbols with either of these strings.
|
||||
|
||||
We put a space after each comma and after each semicolon
|
||||
in "for" statments, and we put spaces before and after each
|
||||
@@ -3297,13 +3307,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
XIII. Y2K Compliance in libpng
|
||||
|
||||
June 26, 2010
|
||||
July 7, 2011
|
||||
|
||||
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.4.3 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.8 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
|
||||
396
libpng.3
396
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "June 26, 2010"
|
||||
.TH LIBPNG 3 "July 7, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.8
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@@ -12,7 +12,15 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
|
||||
\fBvoid png_benign_errors (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_calloc (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -48,7 +56,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_structp png_create_read_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
\fBpng_structp png_create_read_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -56,7 +64,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_structp png_create_write_struct_2(png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
\fBpng_structp png_create_write_struct_2 (png_const_charp \fP\fIuser_png_ver\fP\fB, png_voidp \fP\fIerror_ptr\fP\fB, png_error_ptr \fP\fIerror_fn\fP\fB, png_error_ptr \fP\fIwarn_fn\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_data_freer (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIfreer\fP\fB, png_uint_32 \fImask)\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -72,6 +84,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_err (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -84,7 +100,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_free_default(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP
|
||||
\fBvoid png_free_default (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fIptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -92,75 +108,81 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_bit_depth (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_bKGD (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_channels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_channels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_cHRM (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_cHRM_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_chunk_cache_max (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_chunk_cache_max (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_color_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fI\fB
|
||||
|
||||
\fBpng_alloc_size_t png_get_chunk_malloc_max (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_color_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_compression_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_compression_buffer_size (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_copyright (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_compression_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_get_error_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_copyright (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_filter_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_get_error_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP
|
||||
\fBpng_byte png_get_filter_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_gAMA (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_header_ver (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_gAMA_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_header_version (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_header_ver (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP
|
||||
\fBpng_byte png_get_header_version (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_hIST (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_iCCP (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_bytepp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -168,11 +190,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_image_height (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_image_height (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_image_width (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_image_width (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -180,7 +202,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_interlace_type (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_const_bytep png_get_io_chunk_name (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -188,81 +214,105 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_libpng_ver (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_io_state (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_alloc_size_t png_get_chunk_malloc_max (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_libpng_ver (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_get_mem_ptr(png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_get_mem_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_oFFs (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_pCAL (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_pHYs (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBfloat png_get_pixel_aspect_ratio (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBfloat png_get_pixel_aspect_ratio (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_pHYs_dpi (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_get_progressive_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_fixed_point png_get_pixel_aspect_ratio_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_byte png_get_rgb_to_gray_status (png_structp \fIpng_ptr)
|
||||
|
||||
\fBpng_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_get_progressive_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_PLTE (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_bytep png_get_signature (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_byte png_get_rgb_to_gray_status (png_const_structp \fIpng_ptr)
|
||||
|
||||
\fBpng_uint_32 png_get_rowbytes (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP
|
||||
\fBpng_bytepp png_get_rows (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_sBIT (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP
|
||||
\fBvoid png_get_sCAL (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, double* \fP\fIwidth\fP\fB, double* \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP
|
||||
\fBvoid png_get_sCAL_fixed (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, png_fixed_pointp \fP\fIwidth\fP\fB, png_fixed_pointp \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_color\fP\fB);\fP
|
||||
\fBvoid png_get_sCAL_s (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int* \fP\fIunit\fP\fB, png_charpp \fP\fIwidth\fP\fB, png_charpp \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_bytep png_get_signature (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_sPLT (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_sRGB (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_text (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_tIME (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_tRNS (png_const_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans_alpha\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_color\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -272,7 +322,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_uint_31 (png_bytep \fIbuf\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_uint_31 (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIbuf\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -282,51 +332,75 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_unknown_chunks (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_get_user_chunk_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_user_height_max( png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_user_height_max (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_get_user_transform_ptr (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_user_width_max (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_user_width_max (png_const_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_valid (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBfloat png_get_x_offset_inches (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_fixed_point png_get_x_offset_inches_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_x_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_int_32 png_get_x_offset_microns (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_int_32 png_get_x_offset_pixels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_x_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_y_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_uint_32 png_get_x_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBfloat png_get_y_offset_inches (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_fixed_point png_get_y_offset_inches_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_y_offset_microns (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_int_32 png_get_y_offset_pixels (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_y_pixels_per_inch (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_y_pixels_per_meter (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -334,6 +408,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_info_init_3 (png_infopp \fP\fIinfo_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_init_io (png_structp \fP\fIpng_ptr\fP\fB, FILE \fI*fp\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -342,15 +420,15 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_malloc_default(png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
|
||||
\fBpng_voidp png_malloc_default (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidp png_memcpy (png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_size_t \fIsize\fP\fB);\fP
|
||||
\fBpng_voidp png_malloc_warn (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidp png_memset (png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_size_t \fIsize\fP\fB);\fP
|
||||
\fBpng_uint_32 png_permit_mng_features (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fImng_features_permitted\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -390,7 +468,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP
|
||||
\fBint png_reset_zstream (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -410,6 +492,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_background_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, png_uint_32 \fIbackground_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_benign_errors (png_structp \fP\fIpng_ptr\fP\fB, int \fIallowed\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_bgr (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -462,7 +552,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_expand_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBvoid png_set_expand_gray_1_2_4_to_8 (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -478,6 +568,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_filter_heuristics_fixed (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_fixed_point_p \fP\fIfilter_weights\fP\fB, png_fixed_point_p \fIfilter_costs\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_flush (png_structp \fP\fIpng_ptr\fP\fB, int \fInrows\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -486,6 +580,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_gamma_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIscreen_gamma\fP\fB, png_uint_32 \fIdefault_file_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -494,7 +592,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBvoid png_set_gray_1_2_4_to_8 (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -506,7 +604,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP
|
||||
\fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_const_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_const_bytep \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -542,7 +640,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_mem_fn(png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
\fBvoid png_set_compression_buffer_size (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_mem_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fImem_ptr\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_free_ptr \fIfree_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -558,7 +660,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_palette_to_rgb(png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBvoid png_set_palette_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -590,6 +692,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_read_user_transform_fn (png_structp \fP\fIpng_ptr\fP\fB, png_user_transform_ptr \fIread_user_transform_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -598,7 +704,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_fixed_point \fP\fIred\fP\fB, png_fixed_point \fIgreen\fP\fB);\fP
|
||||
\fBvoid png_set_rgb_to_gray_fixed (png_structp \fP\fIpng_ptr\fP\fB, int error_action png_uint_32 \fP\fIred\fP\fB, png_uint_32 \fIgreen\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -610,7 +716,15 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
|
||||
\fBvoid png_set_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_sCAL_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, png_fixed_point \fP\fIwidth\fP\fB, png_fixed_point \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -642,6 +756,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_strip_error_numbers (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIstrip_mode\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_swap (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -658,11 +776,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_color\fP\fB);\fP
|
||||
\fBvoid png_set_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fItrans_alpha\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_color\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_tRNS_to_alpha(png_structp \fIpng_ptr\fP\fB);\fP
|
||||
\fBvoid png_set_tRNS_to_alpha (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -670,11 +788,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_unknown_chunk_location(png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_read_user_chunk_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIuser_chunk_ptr\fP\fB, png_user_chunk_ptr \fIread_user_chunk_fn\fP\fB);\fP
|
||||
\fBvoid png_set_unknown_chunk_location (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fP\fIchunk\fP\fB, int \fIlocation\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -698,10 +812,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_compression_buffer_size(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_sig_cmp (png_bytep \fP\fIsig\fP\fB, png_size_t \fP\fIstart\fP\fB, png_size_t \fInum_to_check\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -781,14 +891,14 @@ library supports encoding, decoding, and various manipulations of
|
||||
the Portable Network Graphics (PNG) format image files. It uses the
|
||||
.IR zlib(3)
|
||||
compression library.
|
||||
Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.4.3 - June 26, 2010
|
||||
libpng version 1.4.8 - July 7, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
This document is released under the libpng license.
|
||||
For conditions of distribution and use, see the disclaimer
|
||||
@@ -796,9 +906,9 @@ libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.4.3 - June 26, 2010
|
||||
libpng versions 0.97, January 1998, through 1.4.8 - July 7, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
libpng 1.0 beta 6 version 0.96 May 28, 1997
|
||||
Updated and distributed by Andreas Dilger
|
||||
@@ -1063,7 +1173,7 @@ instead of setting a flag to be acted upon later.
|
||||
You can set up a callback function to handle any unknown chunks in the
|
||||
input stream. You must supply the function
|
||||
|
||||
read_chunk_callback(png_ptr ptr,
|
||||
read_chunk_callback(png_structp png_ptr,
|
||||
png_unknown_chunkp chunk);
|
||||
{
|
||||
/* The unknown chunk structure contains your
|
||||
@@ -1109,8 +1219,8 @@ 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.
|
||||
You must supply a function
|
||||
|
||||
void read_row_callback(png_ptr ptr, png_uint_32 row,
|
||||
int pass);
|
||||
void read_row_callback(png_structp png_ptr,
|
||||
png_uint_32 row, int pass);
|
||||
{
|
||||
/* put your code here */
|
||||
}
|
||||
@@ -1361,15 +1471,17 @@ in until png_read_end() has read the chunk data following the image.
|
||||
PNG_COLOR_MASK_COLOR
|
||||
PNG_COLOR_MASK_ALPHA
|
||||
|
||||
interlace_type - (PNG_INTERLACE_NONE or
|
||||
PNG_INTERLACE_ADAM7)
|
||||
|
||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||
for PNG 1.0)
|
||||
|
||||
filter_method - (must be PNG_FILTER_TYPE_BASE
|
||||
for PNG 1.0, and can also be
|
||||
PNG_INTRAPIXEL_DIFFERENCING if
|
||||
the PNG datastream is embedded in
|
||||
a MNG-1.0 datastream)
|
||||
compression_type - (must be PNG_COMPRESSION_TYPE_BASE
|
||||
for PNG 1.0)
|
||||
interlace_type - (PNG_INTERLACE_NONE or
|
||||
PNG_INTERLACE_ADAM7)
|
||||
|
||||
Any or all of interlace_type, compression_type, or
|
||||
filter_method can be NULL if you are
|
||||
@@ -1390,11 +1502,11 @@ in until png_read_end() has read the chunk data following the image.
|
||||
info_ptr);
|
||||
color_type = png_get_color_type(png_ptr,
|
||||
info_ptr);
|
||||
filter_method = png_get_filter_type(png_ptr,
|
||||
interlace_type = png_get_interlace_type(png_ptr,
|
||||
info_ptr);
|
||||
compression_type = png_get_compression_type(png_ptr,
|
||||
info_ptr);
|
||||
interlace_type = png_get_interlace_type(png_ptr,
|
||||
filter_method = png_get_filter_type(png_ptr,
|
||||
info_ptr);
|
||||
|
||||
channels = png_get_channels(png_ptr, info_ptr);
|
||||
@@ -1443,14 +1555,14 @@ pointer into the info_ptr is returned for any complex types.
|
||||
|
||||
png_get_iCCP(png_ptr, info_ptr, &name,
|
||||
&compression_type, &profile, &proflen);
|
||||
name - The profile name.
|
||||
compression - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
name - The profile name.
|
||||
compression_type - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
|
||||
png_get_sBIT(png_ptr, info_ptr, &sig_bit);
|
||||
sig_bit - the number of significant bits for
|
||||
@@ -1463,11 +1575,11 @@ pointer into the info_ptr is returned for any complex types.
|
||||
&num_trans, &trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
num_trans - number of transparent entries
|
||||
(PNG_INFO_tRNS)
|
||||
trans_color - graylevel or color sample values of
|
||||
the single transparent color for
|
||||
non-paletted images (PNG_INFO_tRNS)
|
||||
num_trans - number of transparent entries
|
||||
(PNG_INFO_tRNS)
|
||||
|
||||
png_get_hIST(png_ptr, info_ptr, &hist);
|
||||
(PNG_INFO_hIST)
|
||||
@@ -1688,7 +1800,7 @@ things.
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
|
||||
As of libpng version 1.4.3, not all possible expansions are supported.
|
||||
As of libpng version 1.4.8, not all possible expansions are supported.
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
indexed with depth<8, other numerals represent the color type, "T" means
|
||||
@@ -2018,8 +2130,8 @@ with
|
||||
|
||||
You must supply the function
|
||||
|
||||
void read_transform_fn(png_ptr ptr, row_info_ptr
|
||||
row_info, png_bytep data)
|
||||
void read_transform_fn(png_structp png_ptr, png_row_infop
|
||||
row_info, png_bytep data)
|
||||
|
||||
See pngtest.c for a working example. Your function will be called
|
||||
after all of the other transformations have been processed.
|
||||
@@ -2542,7 +2654,7 @@ called after each row has been written, which you can use to control
|
||||
a progress meter or the like. It's demonstrated in pngtest.c.
|
||||
You must supply a function
|
||||
|
||||
void write_row_callback(png_ptr, png_uint_32 row,
|
||||
void write_row_callback(png_structp png_ptr, png_uint_32 row,
|
||||
int pass);
|
||||
{
|
||||
/* put your code here */
|
||||
@@ -2717,14 +2829,14 @@ width, height, bit_depth, and color_type must be the same in each call.
|
||||
|
||||
png_set_iCCP(png_ptr, info_ptr, name, compression_type,
|
||||
profile, proflen);
|
||||
name - The profile name.
|
||||
compression - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
name - The profile name.
|
||||
compression_type - The compression type; always
|
||||
PNG_COMPRESSION_TYPE_BASE for PNG 1.0.
|
||||
You may give NULL to this argument to
|
||||
ignore it.
|
||||
profile - International Color Consortium color
|
||||
profile data. May contain NULs.
|
||||
proflen - length of profile data in bytes.
|
||||
|
||||
png_set_sBIT(png_ptr, info_ptr, sig_bit);
|
||||
sig_bit - the number of significant bits for
|
||||
@@ -3099,7 +3211,7 @@ with
|
||||
|
||||
You must supply the function
|
||||
|
||||
void write_transform_fn(png_ptr ptr, row_info_ptr
|
||||
void write_transform_fn(png_structp png_ptr, png_row_infop
|
||||
row_info, png_bytep data)
|
||||
|
||||
See pngtest.c for a working example. Your function will be called
|
||||
@@ -3907,6 +4019,12 @@ deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8() because the former function also
|
||||
expanded palette images.
|
||||
|
||||
Macros for png_get_uint_16, png_get_uint_32, and png_get_int_32
|
||||
were added and are used by default instead of the corresponding
|
||||
functions. Unfortunately,
|
||||
from libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
@@ -3934,7 +4052,8 @@ The png_zalloc() function no longer zeroes out the memory that it
|
||||
allocates.
|
||||
|
||||
Support for dithering was disabled by default in libpng-1.4.0, because
|
||||
been well tested and doesn't actually "dither". The code was not
|
||||
it has not been well tested and doesn't actually "dither".
|
||||
The code was not
|
||||
removed, however, and could be enabled by building libpng with
|
||||
PNG_READ_DITHER_SUPPORTED defined. In libpng-1.4.2, this support
|
||||
was reenabled, but the function was renamed png_set_quantize() to
|
||||
@@ -4057,9 +4176,10 @@ above the comment that says
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
|
||||
The names of all exported functions and variables begin
|
||||
with "png_", and all publicly visible C preprocessor
|
||||
macros begin with "PNG_".
|
||||
To avoid polluting the global namespace, the names of all exported
|
||||
functions and variables begin with "png_", and all publicly visible C
|
||||
preprocessor macros begin with "PNG_". We request that applications that
|
||||
use libpng *not* begin any of their own symbols with either of these strings.
|
||||
|
||||
We put a space after each comma and after each semicolon
|
||||
in "for" statments, and we put spaces before and after each
|
||||
@@ -4082,13 +4202,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
.SH XIII. Y2K Compliance in libpng
|
||||
|
||||
June 26, 2010
|
||||
July 7, 2011
|
||||
|
||||
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.4.3 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.8 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
|
||||
@@ -4272,6 +4392,22 @@ the first widely used release:
|
||||
1.4.3beta01-05 14 10403 14.so.14.3[.0]
|
||||
1.4.3rc01-03 14 10403 14.so.14.3[.0]
|
||||
1.4.3 14 10403 14.so.14.3[.0]
|
||||
1.4.4beta01-08 14 10404 14.so.14.4[.0]
|
||||
1.4.4rc01-05 14 10404 14.so.14.4[.0]
|
||||
1.4.4 14 10404 14.so.14.4[.0]
|
||||
1.4.5beta01-04 14 10405 14.so.14.5[.0]
|
||||
1.4.5rc01 14 10405 14.so.14.5[.0]
|
||||
1.4.5beta05-07 14 10405 14.so.14.5[.0]
|
||||
1.4.5rc02-03 14 10405 14.so.14.5[.0]
|
||||
1.4.5 14 10405 14.so.14.5[.0]
|
||||
1.4.6beta01-07 14 10406 14.so.14.6[.0]
|
||||
1.4.6rc01 14 10406 14.so.14.6[.0]
|
||||
1.4.6 14 10406 14.so.14.6[.0]
|
||||
1.4.7rc01 14 10407 14.so.14.7[.0]
|
||||
1.4.7 14 10407 14.so.14.7[.0]
|
||||
1.4.8beta01-05 14 10408 14.so.14.8[.0]
|
||||
1.4.8rc01 14 10408 14.so.14.8[.0]
|
||||
1.4.8 14 10408 14.so.14.8[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -4284,7 +4420,7 @@ version 1.0.6j; from then on they were given the upcoming public
|
||||
release number plus "betaNN" or "rcN".
|
||||
|
||||
.SH "SEE ALSO"
|
||||
libpngpf(3), png(5)
|
||||
.BR "png"(5), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
|
||||
.LP
|
||||
.IR libpng :
|
||||
.IP
|
||||
@@ -4327,7 +4463,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.4.3 - June 26, 2010:
|
||||
Libpng version 1.4.8 - July 7, 2011:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@@ -4350,7 +4486,7 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.3, June 26, 2010, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.8, July 7, 2011, are
|
||||
Copyright (c) 2004,2006-2007 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
|
||||
@@ -4449,7 +4585,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
June 26, 2010
|
||||
July 7, 2011
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
16
libpngpf.3
16
libpngpf.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "June 26, 2010"
|
||||
.TH LIBPNGPF 3 "July 7, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.8
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
@@ -581,32 +581,26 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.3
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\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
|
||||
@@ -803,6 +797,6 @@ are listed alphabetically here as an aid to libpng maintainers.
|
||||
See png.h for more information on these functions.
|
||||
|
||||
.SH SEE ALSO
|
||||
libpng(3), png(5)
|
||||
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
|
||||
.SH AUTHOR
|
||||
Glenn Randers-Pehrson
|
||||
|
||||
162
mkinstalldirs
162
mkinstalldirs
@@ -1,162 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
for d
|
||||
do
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
@@ -1,204 +0,0 @@
|
||||
void /* PRIVATE */
|
||||
png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
png_ptr->row_info.color_type = png_ptr->color_type;
|
||||
png_ptr->row_info.width = png_ptr->iwidth;
|
||||
png_ptr->row_info.channels = png_ptr->channels;
|
||||
png_ptr->row_info.bit_depth = png_ptr->bit_depth;
|
||||
png_ptr->row_info.pixel_depth = png_ptr->pixel_depth;
|
||||
|
||||
png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth,
|
||||
png_ptr->row_info.width);
|
||||
|
||||
png_read_filter_row(png_ptr, &(png_ptr->row_info),
|
||||
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
|
||||
(int)(png_ptr->row_buf[0]));
|
||||
|
||||
png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1);
|
||||
|
||||
if (png_ptr->transformations || (png_ptr->flags&PNG_FLAG_STRIP_ALPHA))
|
||||
png_do_read_transformations(png_ptr);
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
/* Blow up interlaced rows to full size */
|
||||
if (png_ptr->interlaced && (png_ptr->transformations & PNG_INTERLACE))
|
||||
{
|
||||
if (png_ptr->pass < 6)
|
||||
/* old interface (pre-1.0.9):
|
||||
png_do_read_interlace(&(png_ptr->row_info),
|
||||
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
|
||||
*/
|
||||
png_do_read_interlace(png_ptr);
|
||||
|
||||
switch (png_ptr->pass)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 8 && png_ptr->pass == 0; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr); /* Updates png_ptr->pass */
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 2) /* Pass 1 might be empty */
|
||||
{
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 4 && png_ptr->height <= 4)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 6 && png_ptr->height <= 4)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 1:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 8 && png_ptr->pass == 1; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 2) /* Skip top 4 generated rows */
|
||||
{
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 4) /* Pass 3 might be empty */
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4 && png_ptr->pass == 3; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 4) /* Skip top two generated rows */
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 6) /* Pass 5 might be empty */
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 5:
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2 && png_ptr->pass == 5; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 6) /* Skip top generated row */
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
|
||||
if (png_ptr->pass != 6)
|
||||
break;
|
||||
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
4
png.5
4
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "June 26, 2010"
|
||||
.TH PNG 5 "July 7, 2011"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
@@ -18,7 +18,7 @@ gamma and chromaticity data for improved color matching on heterogeneous
|
||||
platforms.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.IR libpng(3), zlib(3), deflate(5), and zlib(5)
|
||||
.BR "libpng"(3), " libpngpf"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)
|
||||
.LP
|
||||
PNG specification (second edition), November 2003:
|
||||
.IP
|
||||
|
||||
30
png.c
30
png.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.4.2 [May 6, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [March 8, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -17,11 +17,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_4_3 Your_png_h_is_not_version_1_4_3;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h.
|
||||
*/
|
||||
typedef version_1_4_8 Your_png_h_is_not_version_1_4_8;
|
||||
|
||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
||||
* of the PNG file signature. If the PNG data is embedded into another
|
||||
@@ -543,21 +539,21 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
||||
#endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */
|
||||
|
||||
png_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
png_get_copyright(png_const_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
#ifdef PNG_STRING_COPYRIGHT
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
return ((png_charp) PNG_STRING_NEWLINE \
|
||||
"libpng version 1.4.3 - June 26, 2010" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.4.8 - July 7, 2011" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||
PNG_STRING_NEWLINE);
|
||||
#else
|
||||
return ((png_charp) "libpng version 1.4.3 - June 26, 2010\
|
||||
return ((png_charp) "libpng version 1.4.8 - July 7, 2011\
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
|
||||
@@ -574,23 +570,23 @@ png_get_copyright(png_structp png_ptr)
|
||||
* it is guaranteed that png.c uses the correct version of png.h.
|
||||
*/
|
||||
png_charp PNGAPI
|
||||
png_get_libpng_ver(png_structp png_ptr)
|
||||
png_get_libpng_ver(png_const_structp png_ptr)
|
||||
{
|
||||
/* Version of *.c files used when building libpng */
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
||||
}
|
||||
|
||||
png_charp PNGAPI
|
||||
png_get_header_ver(png_structp png_ptr)
|
||||
png_get_header_ver(png_const_structp png_ptr)
|
||||
{
|
||||
/* Version of *.h files used when building libpng */
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
return ((png_charp) PNG_LIBPNG_VER_STRING);
|
||||
}
|
||||
|
||||
png_charp PNGAPI
|
||||
png_get_header_version(png_structp png_ptr)
|
||||
png_get_header_version(png_const_structp png_ptr)
|
||||
{
|
||||
/* Returns longer string containing both version and date */
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
@@ -678,7 +674,7 @@ png_convert_size(size_t size)
|
||||
*/
|
||||
|
||||
void /* PRIVATE */
|
||||
png_64bit_product (long v1, long v2, unsigned long *hi_product,
|
||||
png_64bit_product(long v1, long v2, unsigned long *hi_product,
|
||||
unsigned long *lo_product)
|
||||
{
|
||||
int a, b, c, d;
|
||||
|
||||
137
pngconf.h
137
pngconf.h
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.4.3 - June 26, 2010
|
||||
* libpng version 1.4.8 - July 7, 2011
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -44,14 +44,14 @@
|
||||
* includes the resource compiler for Windows DLL configurations.
|
||||
*/
|
||||
#ifdef PNG_USER_CONFIG
|
||||
# include "pngusr.h"
|
||||
# ifndef PNG_USER_PRIVATEBUILD
|
||||
# define PNG_USER_PRIVATEBUILD
|
||||
# endif
|
||||
# include "pngusr.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If you create a private DLL you need to define in "pngusr.h" the followings:
|
||||
* If you create a private DLL you should define in "pngusr.h" the following:
|
||||
* #define PNG_USER_PRIVATEBUILD <Describes by whom and why this version of
|
||||
* the DLL was built>
|
||||
* e.g. #define PNG_USER_PRIVATEBUILD "Build by MyCompany for xyz reasons."
|
||||
@@ -59,7 +59,7 @@
|
||||
* distinguish your DLL from those of the official release. These
|
||||
* correspond to the trailing letters that come after the version
|
||||
* number and must match your private DLL name>
|
||||
* e.g. // private DLL "libpng13gx.dll"
|
||||
* e.g. // private DLL "libpng14gx.dll"
|
||||
* #define PNG_USER_DLLFNAME_POSTFIX "gx"
|
||||
*
|
||||
* The following macros are also at your disposal if you want to complete the
|
||||
@@ -84,6 +84,18 @@
|
||||
|
||||
/* End of material added to libpng-1.2.8 */
|
||||
|
||||
/* Added at libpng-1.4.6 */
|
||||
#ifndef PNG_UNUSED
|
||||
/* Unused formal parameter warnings are silenced using the following macro
|
||||
* which is expected to have no bad effects on performance (optimizing
|
||||
* compilers will probably remove it entirely). Note that if you replace
|
||||
* it with something other than whitespace, you must include the terminating
|
||||
* semicolon.
|
||||
*/
|
||||
# define PNG_UNUSED(param) (void)param;
|
||||
#endif
|
||||
/* End of material added to libpng-1.4.6 */
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
|
||||
/* This is the size of the compression buffer, and thus the size of
|
||||
@@ -269,11 +281,19 @@
|
||||
* #define PNG_NO_STDIO
|
||||
*/
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
# define PNG_NO_CONSOLE_IO
|
||||
# define PNG_NO_STDIO
|
||||
# define PNG_NO_TIME_RFC1123
|
||||
# ifdef PNG_DEBUG
|
||||
# undef PNG_DEBUG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(PNG_NO_STDIO) && !defined(PNG_STDIO_SUPPORTED)
|
||||
# define PNG_STDIO_SUPPORTED
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PNG_BUILD_DLL
|
||||
# if !defined(PNG_CONSOLE_IO_SUPPORTED) && !defined(PNG_NO_CONSOLE_IO)
|
||||
# define PNG_NO_CONSOLE_IO
|
||||
@@ -439,7 +459,7 @@
|
||||
|
||||
/* The following uses const char * instead of char * for error
|
||||
* and warning message functions, so some compilers won't complain.
|
||||
* If you do not want to use const, define PNG_NO_CONST here.
|
||||
* If you do not want to use const, define PNG_NO_CONST.
|
||||
*/
|
||||
|
||||
#ifndef PNG_CONST
|
||||
@@ -454,8 +474,10 @@
|
||||
* library that you will not be using. I wish I could figure out how to
|
||||
* automate this, but I can't do that without making it seriously hard
|
||||
* on the users. So if you are not using an ability, change the #define
|
||||
* to and #undef, and that part of the library will not be compiled. If
|
||||
* your linker can't find a function, you may want to make sure the
|
||||
* to an #undef, or pass in PNG_NO_feature and that part of the library
|
||||
* will not be compiled.
|
||||
|
||||
* If your linker can't find a function, you may want to make sure the
|
||||
* ability is defined here. Some of these depend upon some others being
|
||||
* defined. I haven't figured out all the interactions here, so you may
|
||||
* have to experiment awhile to get everything to compile. If you are
|
||||
@@ -1114,7 +1136,7 @@ typedef unsigned char png_byte;
|
||||
#else
|
||||
typedef size_t png_size_t;
|
||||
#endif
|
||||
#define png_sizeof(x) sizeof(x)
|
||||
#define png_sizeof(x) (sizeof (x))
|
||||
|
||||
/* The following is needed for medium model support. It cannot be in the
|
||||
* pngpriv.h header. Needs modification for other compilers besides
|
||||
@@ -1236,6 +1258,13 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# define PNG_DLL
|
||||
#endif
|
||||
|
||||
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
|
||||
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
|
||||
* Don't ignore those warnings; you must also reset the default calling
|
||||
* convention in your compiler to match your PNGAPI, and you must build
|
||||
* zlib and your applications the same way you build libpng.
|
||||
*/
|
||||
|
||||
#ifdef __CYGWIN__
|
||||
# undef PNGAPI
|
||||
# define PNGAPI __cdecl
|
||||
@@ -1243,14 +1272,11 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# define PNG_IMPEXP
|
||||
#endif
|
||||
|
||||
#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */
|
||||
|
||||
/* If you define PNGAPI, e.g., with compiler option "-DPNGAPI=__stdcall",
|
||||
* you may get warnings regarding the linkage of png_zalloc and png_zfree.
|
||||
* Don't ignore those warnings; you must also reset the default calling
|
||||
* convention in your compiler to match your PNGAPI, and you must build
|
||||
* zlib and your applications the same way you build libpng.
|
||||
*/
|
||||
#ifdef __WATCOMC__
|
||||
# ifndef PNGAPI
|
||||
# define PNGAPI
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) && !defined(PNG_MODULEDEF)
|
||||
# ifndef PNG_NO_MODULEDEF
|
||||
@@ -1335,6 +1361,8 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# define PNG_EXPORT(type,symbol) PNG_IMPEXP type PNGAPI symbol
|
||||
#endif
|
||||
|
||||
#define PNG_USE_LOCAL_ARRAYS /* Not used in libpng, defined for legacy apps */
|
||||
|
||||
/* Support for compiler specific function attributes. These are used
|
||||
* so that where compiler support is available incorrect use of API
|
||||
* functions in png.h will generate compiler warnings.
|
||||
@@ -1363,15 +1391,15 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# endif
|
||||
# ifndef PNG_ALLOCATED
|
||||
# define PNG_ALLOCATED __attribute__((__malloc__))
|
||||
# endif
|
||||
# ifndef PNG_DEPRECATED
|
||||
# define PNG_DEPRECATED __attribute__((__deprecated__))
|
||||
# endif
|
||||
|
||||
/* This specifically protects structure members that should only be
|
||||
* accessed from within the library, therefore should be empty during
|
||||
* a library build.
|
||||
*/
|
||||
# ifndef PNG_DEPRECATED
|
||||
# define PNG_DEPRECATED __attribute__((__deprecated__))
|
||||
# endif
|
||||
# ifndef PNG_DEPSTRUCT
|
||||
# define PNG_DEPSTRUCT __attribute__((__deprecated__))
|
||||
# endif
|
||||
@@ -1412,7 +1440,7 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
|
||||
/* memory model/platform independent fns */
|
||||
#ifndef PNG_ABORT
|
||||
# ifdef _WINDOWS_
|
||||
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
|
||||
# define PNG_ABORT() ExitProcess(0)
|
||||
# else
|
||||
# define PNG_ABORT() abort()
|
||||
@@ -1433,7 +1461,8 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# define png_memset _fmemset
|
||||
# define png_sprintf sprintf
|
||||
#else
|
||||
# ifdef _WINDOWS_ /* Favor Windows over C runtime fns */
|
||||
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_))
|
||||
# /* Favor Windows over C runtime fns */
|
||||
# define CVT_PTR(ptr) (ptr)
|
||||
# define CVT_PTR_NOCHECK(ptr) (ptr)
|
||||
# define png_strcpy lstrcpyA
|
||||
@@ -1453,31 +1482,32 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
# define png_memcpy memcpy
|
||||
# define png_memset memset
|
||||
# define png_sprintf sprintf
|
||||
# ifndef PNG_NO_SNPRINTF
|
||||
# ifdef _MSC_VER
|
||||
# define png_snprintf _snprintf /* Added to v 1.2.19 */
|
||||
# define png_snprintf2 _snprintf
|
||||
# define png_snprintf6 _snprintf
|
||||
# else
|
||||
# define png_snprintf snprintf /* Added to v 1.2.19 */
|
||||
# define png_snprintf2 snprintf
|
||||
# define png_snprintf6 snprintf
|
||||
# endif
|
||||
# else
|
||||
/* You don't have or don't want to use snprintf(). Caution: Using
|
||||
* sprintf instead of snprintf exposes your application to accidental
|
||||
* or malevolent buffer overflows. If you don't have snprintf()
|
||||
* as a general rule you should provide one (you can get one from
|
||||
* Portable OpenSSH).
|
||||
*/
|
||||
# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
|
||||
# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
|
||||
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
|
||||
sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef PNG_NO_SNPRINTF
|
||||
# ifdef _MSC_VER
|
||||
# define png_snprintf _snprintf /* Added to v 1.2.19 */
|
||||
# define png_snprintf2 _snprintf
|
||||
# define png_snprintf6 _snprintf
|
||||
# else
|
||||
# define png_snprintf snprintf /* Added to v 1.2.19 */
|
||||
# define png_snprintf2 snprintf
|
||||
# define png_snprintf6 snprintf
|
||||
# endif
|
||||
#else
|
||||
/* You don't have or don't want to use snprintf(). Caution: Using
|
||||
* sprintf instead of snprintf exposes your application to accidental
|
||||
* or malevolent buffer overflows. If you don't have snprintf()
|
||||
* as a general rule you should provide one (you can get one from
|
||||
* Portable OpenSSH).
|
||||
*/
|
||||
# define png_snprintf(s1,n,fmt,x1) png_sprintf(s1,fmt,x1)
|
||||
# define png_snprintf2(s1,n,fmt,x1,x2) png_sprintf(s1,fmt,x1,x2)
|
||||
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
|
||||
png_sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
|
||||
#endif
|
||||
|
||||
/* png_alloc_size_t is guaranteed to be no smaller than png_size_t,
|
||||
* and no smaller than png_uint_32. Casts from png_size_t or png_uint_32
|
||||
* to png_alloc_size_t are not necessary; in fact, it is recommended
|
||||
@@ -1488,22 +1518,19 @@ typedef char FAR * FAR * FAR * png_charppp;
|
||||
* to encounter practical situations that require such conversions.
|
||||
*/
|
||||
#if defined(__TURBOC__) && !defined(__FLAT__)
|
||||
# define png_mem_alloc farmalloc
|
||||
# define png_mem_free farfree
|
||||
typedef unsigned long png_alloc_size_t;
|
||||
#else
|
||||
# if defined(_MSC_VER) && defined(MAXSEG_64K)
|
||||
# define png_mem_alloc(s) halloc(s, 1)
|
||||
# define png_mem_free hfree
|
||||
typedef unsigned long png_alloc_size_t;
|
||||
# else
|
||||
# if defined(_WINDOWS_) && (!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
|
||||
# define png_mem_alloc(s) HeapAlloc(GetProcessHeap(), 0, s)
|
||||
# define png_mem_free(p) HeapFree(GetProcessHeap(), 0, p)
|
||||
typedef DWORD png_alloc_size_t;
|
||||
/* This is an attempt to detect an old Windows system where (int) is
|
||||
* actually 16 bits, in that case png_malloc must have an argument with a
|
||||
* bigger size to accomodate the requirements of the library.
|
||||
*/
|
||||
# if (defined(_Windows) || defined(_WINDOWS) || defined(_WINDOWS_)) && \
|
||||
(!defined(INT_MAX) || INT_MAX <= 0x7ffffffeL)
|
||||
typedef DWORD png_alloc_size_t;
|
||||
# else
|
||||
# define png_mem_alloc malloc
|
||||
# define png_mem_free free
|
||||
typedef png_size_t png_alloc_size_t;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
30
pngerror.c
30
pngerror.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [January 3, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -87,12 +87,17 @@ png_error(png_structp png_ptr, png_const_charp error_message)
|
||||
void PNGAPI
|
||||
png_err(png_structp png_ptr)
|
||||
{
|
||||
/* Prior to 1.4.8 the error_fn received a NULL pointer, expressed
|
||||
* erroneously as '\0', instead of the empty string "". This was
|
||||
* apparently an error, introduced in libpng-1.2.20, and png_default_error
|
||||
* will crash in this case.
|
||||
*/
|
||||
if (png_ptr != NULL && png_ptr->error_fn != NULL)
|
||||
(*(png_ptr->error_fn))(png_ptr, '\0');
|
||||
(*(png_ptr->error_fn))(png_ptr, "");
|
||||
|
||||
/* If the custom handler doesn't exist, or if it returns,
|
||||
use the default handler, which will not return. */
|
||||
png_default_error(png_ptr, '\0');
|
||||
png_default_error(png_ptr, "");
|
||||
}
|
||||
#endif /* PNG_ERROR_TEXT_SUPPORTED */
|
||||
|
||||
@@ -181,8 +186,13 @@ png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp
|
||||
{
|
||||
buffer[iout++] = ':';
|
||||
buffer[iout++] = ' ';
|
||||
png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT);
|
||||
buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0';
|
||||
|
||||
iin = 0;
|
||||
while (iin < PNG_MAX_ERROR_TEXT-1 && error_message[iin] != '\0')
|
||||
buffer[iout++] = error_message[iin++];
|
||||
|
||||
/* iin < PNG_MAX_ERROR_TEXT, so the following is safe: */
|
||||
buffer[iout] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,7 +316,7 @@ png_default_error(png_structp png_ptr, png_const_charp error_message)
|
||||
/* Here if not setjmp support or if png_ptr is null. */
|
||||
PNG_ABORT();
|
||||
#ifndef PNG_CONSOLE_IO_SUPPORTED
|
||||
error_message = error_message; /* Make compiler happy */
|
||||
PNG_UNUSED(error_message) /* Make compiler happy */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -352,9 +362,9 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
#else
|
||||
warning_message = warning_message; /* Make compiler happy */
|
||||
PNG_UNUSED(warning_message) /* Make compiler happy */
|
||||
#endif
|
||||
png_ptr = png_ptr; /* Make compiler happy */
|
||||
PNG_UNUSED(png_ptr) /* Make compiler happy */
|
||||
}
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
@@ -380,7 +390,7 @@ png_set_error_fn(png_structp png_ptr, png_voidp error_ptr,
|
||||
* pointer before png_write_destroy and png_read_destroy are called.
|
||||
*/
|
||||
png_voidp PNGAPI
|
||||
png_get_error_ptr(png_structp png_ptr)
|
||||
png_get_error_ptr(png_const_structp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
122
pngget.c
122
pngget.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.4.2 [May 6, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [April 8, 2010]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -18,7 +18,8 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
|
||||
png_get_valid(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_uint_32 flag)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return(info_ptr->valid & flag);
|
||||
@@ -28,7 +29,7 @@ png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
|
||||
}
|
||||
|
||||
png_size_t PNGAPI
|
||||
png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_rowbytes(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return(info_ptr->rowbytes);
|
||||
@@ -39,7 +40,7 @@ png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#ifdef PNG_INFO_IMAGE_SUPPORTED
|
||||
png_bytepp PNGAPI
|
||||
png_get_rows(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_rows(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return(info_ptr->row_pointers);
|
||||
@@ -52,7 +53,7 @@ png_get_rows(png_structp png_ptr, png_infop info_ptr)
|
||||
#ifdef PNG_EASY_ACCESS_SUPPORTED
|
||||
/* Easy access to info, added in libpng-0.99 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_image_width(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_image_width(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->width;
|
||||
@@ -61,7 +62,7 @@ png_get_image_width(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_image_height(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_image_height(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->height;
|
||||
@@ -70,7 +71,7 @@ png_get_image_height(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_bit_depth(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_bit_depth(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->bit_depth;
|
||||
@@ -79,7 +80,7 @@ png_get_bit_depth(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_color_type(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_color_type(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->color_type;
|
||||
@@ -88,7 +89,7 @@ png_get_color_type(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_filter_type(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_filter_type(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->filter_type;
|
||||
@@ -97,7 +98,7 @@ png_get_filter_type(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_interlace_type(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_interlace_type(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->interlace_type;
|
||||
@@ -106,7 +107,7 @@ png_get_interlace_type(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_compression_type(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return info_ptr->compression_type;
|
||||
@@ -115,7 +116,7 @@ png_get_compression_type(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_x_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
@@ -136,7 +137,7 @@ png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_y_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
@@ -157,7 +158,7 @@ png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_pixels_per_meter(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
@@ -180,7 +181,7 @@ png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
float PNGAPI
|
||||
png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_pixel_aspect_ratio(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
@@ -204,7 +205,7 @@ png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr)
|
||||
#endif
|
||||
|
||||
png_int_32 PNGAPI
|
||||
png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_x_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
#ifdef PNG_oFFs_SUPPORTED
|
||||
@@ -226,7 +227,7 @@ png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_int_32 PNGAPI
|
||||
png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_y_offset_microns(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
|
||||
@@ -248,7 +249,7 @@ png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_int_32 PNGAPI
|
||||
png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_x_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
|
||||
@@ -270,7 +271,7 @@ png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_int_32 PNGAPI
|
||||
png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_y_offset_pixels(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
|
||||
@@ -293,35 +294,35 @@ png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
png_uint_32 PNGAPI
|
||||
png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr)
|
||||
*.0254 +.5));
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_x_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr)
|
||||
*.0254 +.5));
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_y_pixels_per_inch(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr)
|
||||
*.0254 +.5));
|
||||
}
|
||||
|
||||
float PNGAPI
|
||||
png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_x_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
return ((float)png_get_x_offset_microns(png_ptr, info_ptr)
|
||||
*.00003937);
|
||||
}
|
||||
|
||||
float PNGAPI
|
||||
png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_y_offset_inches(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
return ((float)png_get_y_offset_microns(png_ptr, info_ptr)
|
||||
*.00003937);
|
||||
@@ -329,7 +330,7 @@ png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_pHYs_dpi(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
|
||||
{
|
||||
png_uint_32 retval = 0;
|
||||
@@ -369,7 +370,7 @@ png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif /* PNG_EASY_ACCESS_SUPPORTED */
|
||||
|
||||
png_byte PNGAPI
|
||||
png_get_channels(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_channels(png_const_structp png_ptr, png_const_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return(info_ptr->channels);
|
||||
@@ -378,7 +379,7 @@ png_get_channels(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
|
||||
png_bytep PNGAPI
|
||||
png_get_signature(png_structp png_ptr, png_infop info_ptr)
|
||||
png_get_signature(png_const_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
return(info_ptr->signature);
|
||||
@@ -388,7 +389,7 @@ png_get_signature(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
#ifdef PNG_bKGD_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_bKGD(png_const_structp png_ptr, png_infop info_ptr,
|
||||
png_color_16p *background)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD)
|
||||
@@ -406,7 +407,7 @@ png_get_bKGD(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_cHRM_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_cHRM(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
double *white_x, double *white_y, double *red_x, double *red_y,
|
||||
double *green_x, double *green_y, double *blue_x, double *blue_y)
|
||||
{
|
||||
@@ -437,7 +438,7 @@ png_get_cHRM(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_cHRM_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x,
|
||||
png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y,
|
||||
png_fixed_point *blue_x, png_fixed_point *blue_y)
|
||||
@@ -472,7 +473,7 @@ png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_gAMA_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
|
||||
png_get_gAMA(png_const_structp png_ptr, png_const_infop info_ptr, double *file_gamma)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "gAMA");
|
||||
|
||||
@@ -487,7 +488,7 @@ png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_gAMA_fixed(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_fixed_point *int_file_gamma)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "gAMA");
|
||||
@@ -505,7 +506,8 @@ png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_sRGB_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
|
||||
png_get_sRGB(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
int *file_srgb_intent)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "sRGB");
|
||||
|
||||
@@ -521,7 +523,7 @@ png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent)
|
||||
|
||||
#ifdef PNG_iCCP_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_iCCP(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_charpp name, int *compression_type,
|
||||
png_charpp profile, png_uint_32 *proflen)
|
||||
{
|
||||
@@ -545,7 +547,7 @@ png_get_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_sPLT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sPLT(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_sPLT(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_sPLT_tpp spalettes)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
|
||||
@@ -559,7 +561,8 @@ png_get_sPLT(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_hIST_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist)
|
||||
png_get_hIST(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_uint_16p *hist)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "hIST");
|
||||
|
||||
@@ -614,7 +617,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_oFFs_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_oFFs(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "oFFs");
|
||||
@@ -633,7 +636,7 @@ png_get_oFFs(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_pCAL_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_pCAL(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams,
|
||||
png_charp *units, png_charpp *params)
|
||||
{
|
||||
@@ -659,7 +662,7 @@ png_get_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
#ifdef PNG_sCAL_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_sCAL(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
int *unit, double *width, double *height)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL &&
|
||||
@@ -675,7 +678,7 @@ png_get_sCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
#else
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_sCAL_s(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
int *unit, png_charpp width, png_charpp height)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL &&
|
||||
@@ -694,7 +697,7 @@ png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_pHYs_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_pHYs(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_pHYs(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)
|
||||
{
|
||||
png_uint_32 retval = 0;
|
||||
@@ -727,7 +730,8 @@ png_get_pHYs(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
|
||||
png_get_PLTE(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_colorp *palette,
|
||||
int *num_palette)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "PLTE");
|
||||
@@ -745,7 +749,8 @@ png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette,
|
||||
|
||||
#ifdef PNG_sBIT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
|
||||
png_get_sBIT(png_const_structp png_ptr, png_infop info_ptr,
|
||||
png_color_8p *sig_bit)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "sBIT");
|
||||
|
||||
@@ -761,8 +766,8 @@ png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)
|
||||
|
||||
#ifdef PNG_TEXT_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
|
||||
int *num_text)
|
||||
png_get_text(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_textp *text_ptr, int *num_text)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
|
||||
{
|
||||
@@ -786,7 +791,8 @@ png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
|
||||
|
||||
#ifdef PNG_tIME_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
|
||||
png_get_tIME(png_const_structp png_ptr, png_infop info_ptr,
|
||||
png_timep *mod_time)
|
||||
{
|
||||
png_debug1(1, "in %s retrieval function", "tIME");
|
||||
|
||||
@@ -802,7 +808,7 @@ png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)
|
||||
|
||||
#ifdef PNG_tRNS_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_tRNS(png_const_structp png_ptr, png_infop info_ptr,
|
||||
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
|
||||
{
|
||||
png_uint_32 retval = 0;
|
||||
@@ -844,7 +850,7 @@ png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
|
||||
png_get_unknown_chunks(png_const_structp png_ptr, png_const_infop info_ptr,
|
||||
png_unknown_chunkpp unknowns)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL)
|
||||
@@ -858,7 +864,7 @@ png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
||||
png_byte PNGAPI
|
||||
png_get_rgb_to_gray_status (png_structp png_ptr)
|
||||
png_get_rgb_to_gray_status(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0);
|
||||
}
|
||||
@@ -866,14 +872,14 @@ png_get_rgb_to_gray_status (png_structp png_ptr)
|
||||
|
||||
#ifdef PNG_USER_CHUNKS_SUPPORTED
|
||||
png_voidp PNGAPI
|
||||
png_get_user_chunk_ptr(png_structp png_ptr)
|
||||
png_get_user_chunk_ptr(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr? png_ptr->user_chunk_ptr : NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
png_size_t PNGAPI
|
||||
png_get_compression_buffer_size(png_structp png_ptr)
|
||||
png_get_compression_buffer_size(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr ? png_ptr->zbuf_size : 0L);
|
||||
}
|
||||
@@ -883,24 +889,24 @@ png_get_compression_buffer_size(png_structp png_ptr)
|
||||
/* These functions were added to libpng 1.2.6 and were enabled
|
||||
* by default in libpng-1.4.0 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_user_width_max (png_structp png_ptr)
|
||||
png_get_user_width_max(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr? png_ptr->user_width_max : 0);
|
||||
}
|
||||
png_uint_32 PNGAPI
|
||||
png_get_user_height_max (png_structp png_ptr)
|
||||
png_get_user_height_max(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr? png_ptr->user_height_max : 0);
|
||||
}
|
||||
/* This function was added to libpng 1.4.0 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_chunk_cache_max (png_structp png_ptr)
|
||||
png_get_chunk_cache_max(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr? png_ptr->user_chunk_cache_max : 0);
|
||||
}
|
||||
/* This function was added to libpng 1.4.1 */
|
||||
png_alloc_size_t PNGAPI
|
||||
png_get_chunk_malloc_max (png_structp png_ptr)
|
||||
png_get_chunk_malloc_max(png_const_structp png_ptr)
|
||||
{
|
||||
return (png_ptr?
|
||||
png_ptr->user_chunk_malloc_max : 0);
|
||||
@@ -910,13 +916,13 @@ png_get_chunk_malloc_max (png_structp png_ptr)
|
||||
/* These functions were added to libpng 1.4.0 */
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_io_state (png_structp png_ptr)
|
||||
png_get_io_state(png_const_structp png_ptr)
|
||||
{
|
||||
return png_ptr->io_state;
|
||||
}
|
||||
|
||||
png_bytep PNGAPI
|
||||
png_get_io_chunk_name (png_structp png_ptr)
|
||||
png_get_io_chunk_name(png_structp png_ptr)
|
||||
{
|
||||
return png_ptr->chunk_name;
|
||||
}
|
||||
|
||||
6
pngmem.c
6
pngmem.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.4.2 [May 6, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [April 8, 2010]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -601,7 +601,7 @@ png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr
|
||||
* pointer before png_write_destroy and png_read_destroy are called.
|
||||
*/
|
||||
png_voidp PNGAPI
|
||||
png_get_mem_ptr(png_structp png_ptr)
|
||||
png_get_mem_ptr(png_const_structp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
|
||||
81
pngpread.c
81
pngpread.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.4.3 [June 26, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [March 8, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -843,7 +843,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
||||
* or the stream marked as finished.
|
||||
*/
|
||||
while (png_ptr->zstream.avail_in > 0 &&
|
||||
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
||||
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -872,49 +872,49 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
||||
/* Check for any failure before proceeding. */
|
||||
if (ret != Z_OK && ret != Z_STREAM_END)
|
||||
{
|
||||
/* Terminate the decompression. */
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
/* Terminate the decompression. */
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
|
||||
/* This may be a truncated stream (missing or
|
||||
* damaged end code). Treat that as a warning.
|
||||
*/
|
||||
* damaged end code). Treat that as a warning.
|
||||
*/
|
||||
if (png_ptr->row_number >= png_ptr->num_rows ||
|
||||
png_ptr->pass > 6)
|
||||
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
||||
else
|
||||
png_error(png_ptr, "Decompression error in IDAT");
|
||||
png_ptr->pass > 6)
|
||||
png_warning(png_ptr, "Truncated compressed data in IDAT");
|
||||
else
|
||||
png_error(png_ptr, "Decompression error in IDAT");
|
||||
|
||||
/* Skip the check on unprocessed input */
|
||||
/* Skip the check on unprocessed input */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Did inflate output any data? */
|
||||
if (png_ptr->zstream.next_out != png_ptr->row_buf)
|
||||
{
|
||||
/* Is this unexpected data after the last row?
|
||||
* If it is, artificially terminate the LZ output
|
||||
* here.
|
||||
*/
|
||||
/* Is this unexpected data after the last row?
|
||||
* If it is, artificially terminate the LZ output
|
||||
* here.
|
||||
*/
|
||||
if (png_ptr->row_number >= png_ptr->num_rows ||
|
||||
png_ptr->pass > 6)
|
||||
png_ptr->pass > 6)
|
||||
{
|
||||
/* Extra data. */
|
||||
png_warning(png_ptr, "Extra compressed data in IDAT");
|
||||
/* Extra data. */
|
||||
png_warning(png_ptr, "Extra compressed data in IDAT");
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
/* Do no more processing; skip the unprocessed
|
||||
* input check below.
|
||||
*/
|
||||
/* Do no more processing; skip the unprocessed
|
||||
* input check below.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Do we have a complete row? */
|
||||
if (png_ptr->zstream.avail_out == 0)
|
||||
png_push_process_row(png_ptr);
|
||||
/* Do we have a complete row? */
|
||||
if (png_ptr->zstream.avail_out == 0)
|
||||
png_push_process_row(png_ptr);
|
||||
}
|
||||
|
||||
/* And check for the end of the stream. */
|
||||
if (ret == Z_STREAM_END)
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
}
|
||||
|
||||
/* All the data should have been processed, if anything
|
||||
@@ -988,7 +988,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
|
||||
if (png_ptr->pass == 6 && png_ptr->height <= 4)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -1028,7 +1028,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
|
||||
for (i = 0; i < 4 && png_ptr->pass == 2; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -1078,13 +1078,13 @@ png_push_process_row(png_structp png_ptr)
|
||||
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
if (png_ptr->pass == 6) /* Pass 5 might be empty */
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -1103,12 +1103,14 @@ png_push_process_row(png_structp png_ptr)
|
||||
|
||||
if (png_ptr->pass == 6) /* Skip top generated row */
|
||||
{
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
case 6:
|
||||
{
|
||||
png_push_have_row(png_ptr, png_ptr->row_buf + 1);
|
||||
@@ -1117,7 +1119,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
if (png_ptr->pass != 6)
|
||||
break;
|
||||
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -1202,7 +1204,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
png_error(png_ptr, "Out of place tEXt");
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
}
|
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K
|
||||
@@ -1300,7 +1302,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
png_error(png_ptr, "Out of place zTXt");
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
}
|
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K
|
||||
@@ -1501,7 +1503,7 @@ png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
png_error(png_ptr, "Out of place iTXt");
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
}
|
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K
|
||||
@@ -1635,8 +1637,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
)
|
||||
#endif
|
||||
png_chunk_error(png_ptr, "unknown critical chunk");
|
||||
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||
@@ -1726,7 +1727,7 @@ png_push_have_row(png_structp png_ptr, png_bytep row)
|
||||
}
|
||||
|
||||
void PNGAPI
|
||||
png_progressive_combine_row (png_structp png_ptr,
|
||||
png_progressive_combine_row(png_structp png_ptr,
|
||||
png_bytep old_row, png_bytep new_row)
|
||||
{
|
||||
PNG_CONST int FARDATA png_pass_dsp_mask[7] =
|
||||
@@ -1755,7 +1756,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr,
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_get_progressive_ptr(png_structp png_ptr)
|
||||
png_get_progressive_ptr(png_const_structp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
|
||||
36
pngpriv.h
36
pngpriv.h
@@ -1,9 +1,9 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* libpng version 1.4.3 - June 26, 2010
|
||||
* libpng version 1.4.8 - July 7, 2011
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -26,16 +26,27 @@
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
|
||||
#if defined(_AIX) && defined(_ALL_SOURCE)
|
||||
/* On AIX if _ALL_SOURCE is defined standard header files (including
|
||||
* stdlib.h) define identifiers that are not permitted by the ANSI and
|
||||
* POSIX standards. In particular 'jmpbuf' is #defined and this will
|
||||
* prevent compilation of libpng. The following prevents this:
|
||||
*/
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef PNG_EXTERN
|
||||
/* The functions exported by PNG_EXTERN are internal functions, which
|
||||
* aren't usually used outside the library (as far as I know), so it is
|
||||
* debatable if they should be exported at all. In the future, when it
|
||||
* is possible to have run-time registry of chunk-handling functions,
|
||||
* some of these will be made available again.
|
||||
#define PNG_EXTERN extern
|
||||
# define PNG_EXTERN extern
|
||||
*/
|
||||
#define PNG_EXTERN
|
||||
# define PNG_EXTERN
|
||||
#endif
|
||||
|
||||
/* Other defines specific to compilers can go here. Try to keep
|
||||
* them inside an appropriate ifdef/endif pair for portability.
|
||||
@@ -75,10 +86,6 @@
|
||||
#if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \
|
||||
defined(_WIN32) || defined(__WIN32__)
|
||||
# include <windows.h> /* defines _WINDOWS_ macro */
|
||||
/* I have no idea why is this necessary... */
|
||||
# ifdef _MSC_VER
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Various modes of operation. Note that after an init, mode is set to
|
||||
@@ -292,6 +299,9 @@ PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
|
||||
png_size_t length));
|
||||
|
||||
/* Read and check the PNG file signature */
|
||||
PNG_EXTERN void png_read_sig PNGARG((png_structp png_ptr, png_infop info_ptr));
|
||||
|
||||
/* Read the chunk header (length + type name) */
|
||||
PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
|
||||
|
||||
@@ -672,7 +682,7 @@ PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
PNG_EXTERN void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif /* PNG_READ_iCCP_SUPPORTED */
|
||||
|
||||
@@ -707,7 +717,7 @@ PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
PNG_EXTERN void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif /* PNG_READ_sPLT_SUPPORTED */
|
||||
|
||||
@@ -828,14 +838,14 @@ PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
|
||||
int filter_type));
|
||||
|
||||
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
|
||||
extern void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_infop end_info_ptr));
|
||||
|
||||
/* Free any memory used in png_ptr struct (old method - NOT DLL EXPORTED) */
|
||||
extern void png_write_destroy PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_write_destroy PNGARG((png_structp png_ptr));
|
||||
|
||||
#ifdef USE_FAR_KEYWORD /* memory model conversion function */
|
||||
extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
|
||||
PNG_EXTERN void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
|
||||
int check));
|
||||
#endif /* USE_FAR_KEYWORD */
|
||||
|
||||
|
||||
63
pngread.c
63
pngread.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.1 [February 25, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [March 8, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -214,34 +214,12 @@ void PNGAPI
|
||||
png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
png_debug(1, "in png_read_info");
|
||||
|
||||
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
/* If we haven't checked all of the PNG signature bytes, do so now. */
|
||||
if (png_ptr->sig_bytes < 8)
|
||||
{
|
||||
png_size_t num_checked = png_ptr->sig_bytes,
|
||||
num_to_check = 8 - num_checked;
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_SIGNATURE;
|
||||
#endif
|
||||
|
||||
png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check);
|
||||
png_ptr->sig_bytes = 8;
|
||||
|
||||
if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
|
||||
{
|
||||
if (num_checked < 4 &&
|
||||
png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
|
||||
png_error(png_ptr, "Not a PNG file");
|
||||
else
|
||||
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
||||
}
|
||||
if (num_checked < 3)
|
||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
||||
}
|
||||
/* Read and check the PNG file signature. */
|
||||
png_read_sig(png_ptr, info_ptr);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@@ -426,7 +404,7 @@ void PNGAPI
|
||||
png_read_update_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
png_debug(1, "in png_read_update_info");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
|
||||
@@ -448,7 +426,7 @@ void PNGAPI
|
||||
png_start_read_image(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_start_read_image");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
|
||||
@@ -461,14 +439,16 @@ void PNGAPI
|
||||
png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
{
|
||||
PNG_IDAT;
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
PNG_CONST int png_pass_dsp_mask[7] = {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55,
|
||||
0xff};
|
||||
PNG_CONST int png_pass_mask[7] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
||||
int ret;
|
||||
|
||||
#endif
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
|
||||
png_debug2(1, "in png_read_row (row %lu, pass %d)",
|
||||
(unsigned long) png_ptr->row_number, png_ptr->pass);
|
||||
|
||||
@@ -524,6 +504,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if ((png_ptr->row_number & 0x07) || png_ptr->width < 5)
|
||||
{
|
||||
@@ -534,6 +515,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if ((png_ptr->row_number & 0x07) != 4)
|
||||
{
|
||||
@@ -544,6 +526,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if ((png_ptr->row_number & 3) || png_ptr->width < 3)
|
||||
{
|
||||
@@ -554,6 +537,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if ((png_ptr->row_number & 3) != 2)
|
||||
{
|
||||
@@ -564,6 +548,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if ((png_ptr->row_number & 1) || png_ptr->width < 2)
|
||||
{
|
||||
@@ -574,6 +559,8 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
case 6:
|
||||
if (!(png_ptr->row_number & 1))
|
||||
{
|
||||
@@ -724,7 +711,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
png_bytepp dp;
|
||||
|
||||
png_debug(1, "in png_read_rows");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
rp = row;
|
||||
@@ -775,7 +762,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
png_bytepp rp;
|
||||
|
||||
png_debug(1, "in png_read_image");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
@@ -813,7 +800,7 @@ void PNGAPI
|
||||
png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
png_debug(1, "in png_read_end");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */
|
||||
@@ -993,7 +980,7 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
|
||||
#endif
|
||||
|
||||
png_debug(1, "in png_destroy_read_struct");
|
||||
|
||||
|
||||
if (png_ptr_ptr != NULL)
|
||||
png_ptr = *png_ptr_ptr;
|
||||
if (png_ptr == NULL)
|
||||
@@ -1069,7 +1056,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
png_debug(1, "in png_read_destroy");
|
||||
|
||||
|
||||
if (info_ptr != NULL)
|
||||
png_info_destroy(png_ptr, info_ptr);
|
||||
|
||||
@@ -1352,8 +1339,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
|
||||
transforms = transforms; /* Quiet compiler warnings */
|
||||
params = params;
|
||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
||||
PNG_UNUSED(params)
|
||||
|
||||
}
|
||||
#endif /* PNG_INFO_IMAGE_SUPPORTED */
|
||||
|
||||
6
pngrio.c
6
pngrio.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.4.1 [February 25, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [January 14, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -33,7 +33,7 @@ void /* PRIVATE */
|
||||
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_debug1(4, "reading %d bytes", (int)length);
|
||||
|
||||
|
||||
if (png_ptr->read_data_fn != NULL)
|
||||
(*(png_ptr->read_data_fn))(png_ptr, data, length);
|
||||
else
|
||||
|
||||
140
pngrtran.c
140
pngrtran.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.4.2 [May 6, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -26,7 +26,7 @@ void PNGAPI
|
||||
png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
|
||||
{
|
||||
png_debug(1, "in png_set_crc_action");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
@@ -98,7 +98,7 @@ png_set_background(png_structp png_ptr,
|
||||
int need_expand, double background_gamma)
|
||||
{
|
||||
png_debug(1, "in png_set_background");
|
||||
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN)
|
||||
@@ -660,10 +660,21 @@ void PNGAPI
|
||||
png_set_rgb_to_gray(png_structp png_ptr, int error_action, double red,
|
||||
double green)
|
||||
{
|
||||
int red_fixed = (int)((float)red*100000.0 + 0.5);
|
||||
int green_fixed = (int)((float)green*100000.0 + 0.5);
|
||||
int red_fixed, green_fixed;
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
if (red > 21474.83647 || red < -21474.83648 ||
|
||||
green > 21474.83647 || green < -21474.83648)
|
||||
{
|
||||
png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients");
|
||||
red_fixed = -1;
|
||||
green_fixed = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
red_fixed = (int)((float)red*100000.0 + 0.5);
|
||||
green_fixed = (int)((float)green*100000.0 + 0.5);
|
||||
}
|
||||
png_set_rgb_to_gray_fixed(png_ptr, error_action, red_fixed, green_fixed);
|
||||
}
|
||||
#endif
|
||||
@@ -686,6 +697,11 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
break;
|
||||
|
||||
case 3: png_ptr->transformations |= PNG_RGB_TO_GRAY_ERR;
|
||||
break;
|
||||
|
||||
default:
|
||||
png_error(png_ptr, "invalid error action in png_set_rgb_to_gray");
|
||||
break;
|
||||
}
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||
@@ -698,27 +714,38 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
}
|
||||
#endif
|
||||
{
|
||||
png_uint_16 red_int, green_int;
|
||||
if (red < 0 || green < 0)
|
||||
{
|
||||
red_int = 6968; /* .212671 * 32768 + .5 */
|
||||
green_int = 23434; /* .715160 * 32768 + .5 */
|
||||
}
|
||||
else if (red + green < 100000L)
|
||||
if (red >= 0 && green >= 0 && red + green <= 100000L)
|
||||
{
|
||||
png_uint_16 red_int, green_int;
|
||||
|
||||
red_int = (png_uint_16)(((png_uint_32)red*32768L)/100000L);
|
||||
green_int = (png_uint_16)(((png_uint_32)green*32768L)/100000L);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
png_warning(png_ptr, "ignoring out of range rgb_to_gray coefficients");
|
||||
red_int = 6968;
|
||||
green_int = 23434;
|
||||
if (red >= 0 && green >= 0)
|
||||
png_warning(png_ptr,
|
||||
"ignoring out of range rgb_to_gray coefficients");
|
||||
|
||||
/* Use the defaults, from the cHRM chunk if set, else the built in Rec
|
||||
* 709 values (which correspond to sRGB, so we don't have to worry
|
||||
* about the sRGB chunk!)
|
||||
*/
|
||||
if (png_ptr->rgb_to_gray_red_coeff == 0 &&
|
||||
png_ptr->rgb_to_gray_green_coeff == 0 &&
|
||||
png_ptr->rgb_to_gray_blue_coeff == 0)
|
||||
{
|
||||
png_ptr->rgb_to_gray_red_coeff = 6968; /* .212671 * 32768 + .5 */
|
||||
png_ptr->rgb_to_gray_green_coeff = 23434; /* .715160 * 32768 + .5 */
|
||||
png_ptr->rgb_to_gray_blue_coeff = 2366;
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -828,6 +855,8 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
case 8:
|
||||
|
||||
case 16:
|
||||
@@ -1001,7 +1030,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
*/
|
||||
png_ptr->transformations &= ~PNG_BACKGROUND;
|
||||
png_ptr->transformations &= ~PNG_GAMMA;
|
||||
png_ptr->transformations |= PNG_STRIP_ALPHA;
|
||||
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
|
||||
}
|
||||
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
|
||||
else
|
||||
@@ -1028,6 +1057,9 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
gs = 1.0 / (png_ptr->background_gamma *
|
||||
png_ptr->screen_gamma);
|
||||
break;
|
||||
|
||||
default:
|
||||
png_error(png_ptr, "invalid background gamma type");
|
||||
}
|
||||
|
||||
png_ptr->background_1.gray = (png_uint_16)(pow(
|
||||
@@ -1121,7 +1153,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
|
||||
/* Handled alpha, still need to strip the channel. */
|
||||
png_ptr->transformations &= ~PNG_BACKGROUND;
|
||||
png_ptr->transformations |= PNG_STRIP_ALPHA;
|
||||
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
|
||||
}
|
||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
|
||||
|
||||
@@ -1171,8 +1203,7 @@ 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)
|
||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
|
||||
else
|
||||
info_ptr->color_type = PNG_COLOR_TYPE_RGB;
|
||||
@@ -1626,6 +1657,9 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
row_info->bit_depth = 8;
|
||||
row_info->pixel_depth = (png_byte)(8 * row_info->channels);
|
||||
@@ -1682,6 +1716,9 @@ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
|
||||
|
||||
switch (row_info->bit_depth)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
png_bytep bp;
|
||||
@@ -1762,32 +1799,18 @@ png_do_chop(png_row_infop row_info, png_bytep row)
|
||||
for (i = 0; i<istop; i++, sp += 2, dp++)
|
||||
{
|
||||
#ifdef PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||
/* This does a more accurate scaling of the 16-bit color
|
||||
* value, rather than a simple low-byte truncation.
|
||||
*
|
||||
* What the ideal calculation should be:
|
||||
* *dp = (((((png_uint_32)(*sp) << 8) |
|
||||
* (png_uint_32)(*(sp + 1))) * 255 + 127)
|
||||
* / (png_uint_32)65535L;
|
||||
*
|
||||
* GRR: no, I think this is what it really should be:
|
||||
* *dp = (((((png_uint_32)(*sp) << 8) |
|
||||
* (png_uint_32)(*(sp + 1))) + 128L)
|
||||
* / (png_uint_32)257L;
|
||||
*
|
||||
* GRR: here's the exact calculation with shifts:
|
||||
* temp = (((png_uint_32)(*sp) << 8) |
|
||||
* (png_uint_32)(*(sp + 1))) + 128L;
|
||||
* *dp = (temp - (temp >> 8)) >> 8;
|
||||
*
|
||||
* Approximate calculation with shift/add instead of multiply/divide:
|
||||
* *dp = ((((png_uint_32)(*sp) << 8) |
|
||||
* (png_uint_32)((int)(*(sp + 1)) - *sp)) + 128) >> 8;
|
||||
*
|
||||
* What we actually do to avoid extra shifting and conversion:
|
||||
*/
|
||||
|
||||
*dp = *sp + ((((int)(*(sp + 1)) - *sp) > 128) ? 1 : 0);
|
||||
/* This does a more accurate scaling of the 16-bit color
|
||||
* value, rather than a simple low-byte truncation.
|
||||
*
|
||||
* Prior to libpng-1.4.8 and 1.5.4, the calculation here was
|
||||
* incorrect, so if you used ACCURATE_SCALE you will now see
|
||||
* a slightly different result. In libpng-1.5.4 and
|
||||
* later you will need to use the new png_set_scale_16_to_8()
|
||||
* API to obtain accurate 16-to-8 scaling.
|
||||
*/
|
||||
png_int_32 tmp = *sp; /* must be signed! */
|
||||
tmp += (((int)sp[1] - tmp + 128) * 65535) >> 24;
|
||||
*dp = (png_byte)tmp;
|
||||
#else
|
||||
/* Simply discard the low order byte */
|
||||
*dp = *sp;
|
||||
@@ -2274,7 +2297,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row)
|
||||
|
||||
png_debug(1, "in png_do_rgb_to_gray");
|
||||
|
||||
if (
|
||||
if (!(row_info->color_type & PNG_COLOR_MASK_PALETTE) &&
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
@@ -2798,6 +2821,9 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3230,6 +3256,9 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (row_info->color_type & PNG_COLOR_MASK_ALPHA)
|
||||
@@ -3428,6 +3457,9 @@ png_do_gamma(png_row_infop row_info, png_bytep row,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3522,6 +3554,9 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
row_info->bit_depth = 8;
|
||||
row_info->pixel_depth = 8;
|
||||
@@ -3672,6 +3707,9 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
row_info->bit_depth = 8;
|
||||
|
||||
211
pngrutil.c
211
pngrutil.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.3 [June 26, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -23,50 +23,98 @@
|
||||
png_uint_32 PNGAPI
|
||||
png_get_uint_31(png_structp png_ptr, png_bytep buf)
|
||||
{
|
||||
png_uint_32 i = png_get_uint_32(buf);
|
||||
if (i > PNG_UINT_31_MAX)
|
||||
png_error(png_ptr, "PNG unsigned integer out of range");
|
||||
return (i);
|
||||
}
|
||||
#ifndef PNG_USE_READ_MACROS
|
||||
/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_uint_32(png_bytep buf)
|
||||
{
|
||||
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
|
||||
((png_uint_32)(*(buf + 1)) << 16) +
|
||||
((png_uint_32)(*(buf + 2)) << 8) +
|
||||
(png_uint_32)(*(buf + 3));
|
||||
png_uint_32 val = png_get_uint_32(buf);
|
||||
|
||||
return (i);
|
||||
if (val > PNG_UINT_31_MAX)
|
||||
png_error(png_ptr, "PNG unsigned integer out of range");
|
||||
return (val);
|
||||
}
|
||||
|
||||
#ifndef PNG_USE_READ_MACROS
|
||||
/* The parentheses around "PNGAPI function_name" in the following three
|
||||
* functions are necessary because they allow the macros to co-exist with
|
||||
* these (unused but exported) functions.
|
||||
*/
|
||||
|
||||
/* Grab an unsigned 32-bit integer from a buffer in big-endian format. */
|
||||
png_uint_32 (PNGAPI
|
||||
png_get_uint_32)(png_bytep buf)
|
||||
{
|
||||
png_uint_32 uval = png_get_uint_32(buf);
|
||||
if ((uval & 0x80000000L) == 0) /* non-negative */
|
||||
return uval;
|
||||
|
||||
uval = (uval ^ 0xffffffffL) + 1; /* 2's complement: -x = ~x+1 */
|
||||
return -(png_int_32)uval;
|
||||
}
|
||||
|
||||
/* Grab a signed 32-bit integer from a buffer in big-endian format. The
|
||||
* data is stored in the PNG file in two's complement format, and it is
|
||||
* assumed that the machine format for signed integers is the same.
|
||||
* data is stored in the PNG file in two's complement format and there
|
||||
* is no guarantee that a 'png_int_32' is exactly 32 bits, therefore
|
||||
* the following code does a two's complement to native conversion.
|
||||
*/
|
||||
png_int_32 PNGAPI
|
||||
png_get_int_32(png_bytep buf)
|
||||
png_int_32 (PNGAPI
|
||||
png_get_int_32)(png_bytep buf)
|
||||
{
|
||||
png_int_32 i = ((png_int_32)(*buf) << 24) +
|
||||
((png_int_32)(*(buf + 1)) << 16) +
|
||||
((png_int_32)(*(buf + 2)) << 8) +
|
||||
(png_int_32)(*(buf + 3));
|
||||
png_uint_32 uval = png_get_uint_32(buf);
|
||||
if ((uval & 0x80000000L) == 0) /* non-negative */
|
||||
return uval;
|
||||
|
||||
return (i);
|
||||
uval = (uval ^ 0xffffffffL) + 1; /* 2's complement: -x = ~x+1 */
|
||||
return -(png_int_32)uval;
|
||||
}
|
||||
|
||||
/* Grab an unsigned 16-bit integer from a buffer in big-endian format. */
|
||||
png_uint_16 PNGAPI
|
||||
png_get_uint_16(png_bytep buf)
|
||||
png_uint_16 (PNGAPI
|
||||
png_get_uint_16)(png_bytep buf)
|
||||
{
|
||||
png_uint_16 i = (png_uint_16)(((png_uint_16)(*buf) << 8) +
|
||||
(png_uint_16)(*(buf + 1)));
|
||||
/* ANSI-C requires an int value to accomodate at least 16 bits so this
|
||||
* works and allows the compiler not to worry about possible narrowing
|
||||
* on 32 bit systems. (Pre-ANSI systems did not make integers smaller
|
||||
* than 16 bits either.)
|
||||
*/
|
||||
unsigned int val =
|
||||
((unsigned int)(*buf) << 8) +
|
||||
((unsigned int)(*(buf + 1)));
|
||||
|
||||
return (i);
|
||||
return (png_uint_16)val;
|
||||
}
|
||||
#endif /* PNG_USE_READ_MACROS */
|
||||
|
||||
/* Read and check the PNG file signature */
|
||||
void /* PRIVATE */
|
||||
png_read_sig(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
png_size_t num_checked, num_to_check;
|
||||
|
||||
/* Exit if the user application does not expect a signature. */
|
||||
if (png_ptr->sig_bytes >= 8)
|
||||
return;
|
||||
|
||||
num_checked = png_ptr->sig_bytes;
|
||||
num_to_check = 8 - num_checked;
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_SIGNATURE;
|
||||
#endif
|
||||
|
||||
/* The signature must be serialized in a single I/O call. */
|
||||
png_read_data(png_ptr, &(info_ptr->signature[num_checked]), num_to_check);
|
||||
png_ptr->sig_bytes = 8;
|
||||
|
||||
if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
|
||||
{
|
||||
if (num_checked < 4 &&
|
||||
png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
|
||||
png_error(png_ptr, "Not a PNG file");
|
||||
|
||||
else
|
||||
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
||||
}
|
||||
if (num_checked < 3)
|
||||
png_ptr->mode |= PNG_HAVE_PNG_SIGNATURE;
|
||||
}
|
||||
|
||||
/* Read the chunk header (length + type name).
|
||||
* Put the type name into png_ptr->chunk_name, and return the length.
|
||||
*/
|
||||
@@ -77,32 +125,31 @@ png_read_chunk_header(png_structp png_ptr)
|
||||
png_uint_32 length;
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that the chunk header is being read.
|
||||
* PNG_IO_CHUNK_HDR requires a single I/O call.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_HDR;
|
||||
#endif
|
||||
|
||||
/* Read the length and the chunk name */
|
||||
/* Read the length and the chunk name.
|
||||
* This must be performed in a single I/O call.
|
||||
*/
|
||||
png_read_data(png_ptr, buf, 8);
|
||||
length = png_get_uint_31(png_ptr, buf);
|
||||
|
||||
/* Put the chunk name into png_ptr->chunk_name */
|
||||
/* Put the chunk name into png_ptr->chunk_name. */
|
||||
png_memcpy(png_ptr->chunk_name, buf + 4, 4);
|
||||
|
||||
png_debug2(0, "Reading %s chunk, length = %lu",
|
||||
png_ptr->chunk_name, length);
|
||||
png_ptr->chunk_name, (unsigned long)length);
|
||||
|
||||
/* Reset the crc and run it over the chunk name */
|
||||
/* Reset the crc and run it over the chunk name. */
|
||||
png_reset_crc(png_ptr);
|
||||
png_calculate_crc(png_ptr, png_ptr->chunk_name, 4);
|
||||
|
||||
/* Check to see if chunk name is valid */
|
||||
/* Check to see if chunk name is valid. */
|
||||
png_check_chunk_name(png_ptr, png_ptr->chunk_name);
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that chunk data will (possibly) be read.
|
||||
* PNG_IO_CHUNK_DATA does NOT require a specific number of I/O calls.
|
||||
/* It is unspecified how many I/O calls will be performed
|
||||
* during the serialization of the chunk data.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
|
||||
#endif
|
||||
@@ -116,6 +163,7 @@ png_crc_read(png_structp png_ptr, png_bytep buf, png_size_t length)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
png_read_data(png_ptr, buf, length);
|
||||
png_calculate_crc(png_ptr, buf, length);
|
||||
}
|
||||
@@ -135,6 +183,7 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
|
||||
{
|
||||
png_crc_read(png_ptr, png_ptr->zbuf, png_ptr->zbuf_size);
|
||||
}
|
||||
|
||||
if (i)
|
||||
{
|
||||
png_crc_read(png_ptr, png_ptr->zbuf, i);
|
||||
@@ -149,11 +198,13 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
|
||||
{
|
||||
png_chunk_warning(png_ptr, "CRC error");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
png_chunk_benign_error(png_ptr, "CRC error");
|
||||
return (0);
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -176,6 +227,7 @@ png_crc_error(png_structp png_ptr)
|
||||
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
|
||||
need_crc = 0;
|
||||
}
|
||||
|
||||
else /* critical */
|
||||
{
|
||||
if (png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE)
|
||||
@@ -183,11 +235,10 @@ png_crc_error(png_structp png_ptr)
|
||||
}
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that the chunk CRC is being read */
|
||||
/* PNG_IO_CHUNK_CRC requires the I/O to be done at once */
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_CRC;
|
||||
#endif
|
||||
|
||||
/* The chunk CRC must be serialized in a single I/O call. */
|
||||
png_read_data(png_ptr, crc_bytes, 4);
|
||||
|
||||
if (need_crc)
|
||||
@@ -195,6 +246,7 @@ png_crc_error(png_structp png_ptr)
|
||||
crc = png_get_uint_32(crc_bytes);
|
||||
return ((int)(crc != png_ptr->crc));
|
||||
}
|
||||
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
@@ -234,6 +286,7 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
|
||||
if (avail < copy) copy = avail;
|
||||
png_memcpy(output + count, png_ptr->zbuf, copy);
|
||||
}
|
||||
|
||||
count += avail;
|
||||
}
|
||||
|
||||
@@ -267,9 +320,11 @@ png_inflate(png_structp png_ptr, const png_byte *data, png_size_t size,
|
||||
case Z_BUF_ERROR:
|
||||
msg = "Buffer error in compressed datastream in %s chunk";
|
||||
break;
|
||||
|
||||
case Z_DATA_ERROR:
|
||||
msg = "Data error in compressed datastream in %s chunk";
|
||||
break;
|
||||
|
||||
default:
|
||||
msg = "Incomplete compressed datastream in %s chunk";
|
||||
break;
|
||||
@@ -369,6 +424,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
png_warning(png_ptr, "png_inflate logic error");
|
||||
png_free(png_ptr, text);
|
||||
}
|
||||
|
||||
else
|
||||
png_warning(png_ptr, "Not enough memory to decompress chunk");
|
||||
}
|
||||
@@ -647,7 +703,7 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
png_crc_finish(png_ptr, length);
|
||||
|
||||
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
@@ -1128,20 +1184,20 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
if (profile_size > profile_length)
|
||||
{
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char umsg[50];
|
||||
#endif
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_warning(png_ptr, "Ignoring truncated iCCP profile");
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
{
|
||||
char umsg[50];
|
||||
|
||||
png_snprintf(umsg, 50, "declared profile size = %lu",
|
||||
(unsigned long)profile_size);
|
||||
png_warning(png_ptr, umsg);
|
||||
png_snprintf(umsg, 50, "actual profile length = %lu",
|
||||
(unsigned long)profile_length);
|
||||
png_warning(png_ptr, umsg);
|
||||
}
|
||||
png_snprintf(umsg, 50, "declared profile size = %lu",
|
||||
(unsigned long)profile_size);
|
||||
png_warning(png_ptr, umsg);
|
||||
png_snprintf(umsg, 50, "actual profile length = %lu",
|
||||
(unsigned long)profile_length);
|
||||
png_warning(png_ptr, umsg);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -1160,9 +1216,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_bytep entry_start;
|
||||
png_sPLT_t new_palette;
|
||||
#ifdef PNG_POINTER_INDEXING_SUPPORTED
|
||||
png_sPLT_entryp pp;
|
||||
#endif
|
||||
int data_length, entry_size, i;
|
||||
png_uint_32 skip = 0;
|
||||
png_size_t slength;
|
||||
@@ -1301,7 +1355,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
pp[i].blue = png_get_uint_16(entry_start); entry_start += 2;
|
||||
pp[i].alpha = png_get_uint_16(entry_start); entry_start += 2;
|
||||
}
|
||||
pp->frequency = png_get_uint_16(entry_start); entry_start += 2;
|
||||
pp[i].frequency = png_get_uint_16(entry_start); entry_start += 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1670,7 +1724,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)",
|
||||
length + 1);
|
||||
(unsigned long)(length + 1));
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
@@ -1807,8 +1861,16 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Need unit type, width, \0, height: minimum 4 bytes */
|
||||
else if (length < 4)
|
||||
{
|
||||
png_warning(png_ptr, "sCAL chunk too short");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
|
||||
png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)",
|
||||
length + 1);
|
||||
(unsigned long)(length + 1));
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
@@ -1875,9 +1937,6 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_warning(png_ptr, "malformed height string in sCAL chunk");
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
png_free(png_ptr, swidth);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#else
|
||||
@@ -1888,9 +1947,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_warning(png_ptr, "Out of memory while processing sCAL chunk height");
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
png_free(png_ptr, swidth);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
png_memcpy(sheight, ep, png_strlen(ep));
|
||||
@@ -2454,7 +2511,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_crc_finish(png_ptr, skip);
|
||||
|
||||
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2910,7 +2967,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
|
||||
}
|
||||
#ifndef PNG_READ_PACKSWAP_SUPPORTED
|
||||
transformations = transformations; /* Silence compiler warning */
|
||||
PNG_UNUSED(transformations) /* Silence compiler warning */
|
||||
#endif
|
||||
}
|
||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||
@@ -2920,7 +2977,8 @@ png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row,
|
||||
png_bytep prev_row, int filter)
|
||||
{
|
||||
png_debug(1, "in png_read_filter_row");
|
||||
png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter);
|
||||
png_debug2(2, "row = %lu, filter = %d",
|
||||
(unsigned long)png_ptr->row_number, filter);
|
||||
switch (filter)
|
||||
{
|
||||
case PNG_FILTER_VALUE_NONE:
|
||||
@@ -3111,17 +3169,10 @@ png_read_finish_row(png_structp png_ptr)
|
||||
{
|
||||
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");
|
||||
|
||||
}
|
||||
png_ptr->zstream.avail_in = (uInt)png_ptr->zbuf_size;
|
||||
png_ptr->zstream.next_in = png_ptr->zbuf;
|
||||
@@ -3368,13 +3419,13 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
|
||||
png_memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1);
|
||||
|
||||
png_debug1(3, "width = %lu,", png_ptr->width);
|
||||
png_debug1(3, "height = %lu,", png_ptr->height);
|
||||
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
|
||||
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
|
||||
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
|
||||
png_debug1(3, "width = %lu,", (unsigned long)png_ptr->width);
|
||||
png_debug1(3, "height = %lu,", (unsigned long)png_ptr->height);
|
||||
png_debug1(3, "iwidth = %lu,", (unsigned long)png_ptr->iwidth);
|
||||
png_debug1(3, "num_rows = %lu,", (unsigned long)png_ptr->num_rows);
|
||||
png_debug1(3, "rowbytes = %lu,", (unsigned long)png_ptr->rowbytes);
|
||||
png_debug1(3, "irowbytes = %lu",
|
||||
PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
|
||||
(unsigned long)PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->iwidth) + 1);
|
||||
|
||||
png_ptr->flags |= PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
|
||||
19
pngset.c
19
pngset.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.4.1 [February 25, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [January 14, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -690,6 +690,13 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
if (text_ptr[i].key == NULL)
|
||||
continue;
|
||||
|
||||
if (text_ptr[i].compression < PNG_TEXT_COMPRESSION_NONE ||
|
||||
text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST)
|
||||
{
|
||||
png_warning(png_ptr, "text compression mode is out of range");
|
||||
continue;
|
||||
}
|
||||
|
||||
key_len = png_strlen(text_ptr[i].key);
|
||||
|
||||
if (text_ptr[i].compression <= 0)
|
||||
@@ -1004,7 +1011,7 @@ png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features)
|
||||
png_permit_mng_features(png_structp png_ptr, png_uint_32 mng_features)
|
||||
{
|
||||
png_debug(1, "in png_permit_mng_features");
|
||||
|
||||
@@ -1118,7 +1125,7 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
/* This function was added to libpng 1.2.6 */
|
||||
void PNGAPI
|
||||
png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
|
||||
png_set_user_limits(png_structp png_ptr, png_uint_32 user_width_max,
|
||||
png_uint_32 user_height_max)
|
||||
{
|
||||
/* Images with dimensions larger than these limits will be
|
||||
@@ -1133,7 +1140,7 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
|
||||
|
||||
/* This function was added to libpng 1.4.0 */
|
||||
void PNGAPI
|
||||
png_set_chunk_cache_max (png_structp png_ptr,
|
||||
png_set_chunk_cache_max(png_structp png_ptr,
|
||||
png_uint_32 user_chunk_cache_max)
|
||||
{
|
||||
if (png_ptr)
|
||||
@@ -1142,7 +1149,7 @@ png_set_chunk_cache_max (png_structp png_ptr,
|
||||
|
||||
/* This function was added to libpng 1.4.1 */
|
||||
void PNGAPI
|
||||
png_set_chunk_malloc_max (png_structp png_ptr,
|
||||
png_set_chunk_malloc_max(png_structp png_ptr,
|
||||
png_alloc_size_t user_chunk_malloc_max)
|
||||
{
|
||||
if (png_ptr)
|
||||
|
||||
163
pngtest.c
163
pngtest.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* Last changed in libpng 1.4.1 [February 25, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -31,8 +31,13 @@
|
||||
* of files at once by typing "pngtest -m file1.png file2.png ..."
|
||||
*/
|
||||
|
||||
#include "zlib.h"
|
||||
#include "png.h"
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Copied from pngpriv.h but only used in error messages below. */
|
||||
#ifndef PNG_ZBUF_SIZE
|
||||
# define PNG_ZBUF_SIZE 8192
|
||||
#endif
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
@@ -47,6 +52,16 @@
|
||||
# define PNG_DEBUG 0
|
||||
#endif
|
||||
|
||||
#if PNG_DEBUG > 1
|
||||
# define pngtest_debug(m) ((void)fprintf(stderr, m "\n"))
|
||||
# define pngtest_debug1(m,p1) ((void)fprintf(stderr, m "\n", p1))
|
||||
# define pngtest_debug2(m,p1,p2) ((void)fprintf(stderr, m "\n", p1, p2))
|
||||
#else
|
||||
# define pngtest_debug(m) ((void)0)
|
||||
# define pngtest_debug1(m,p1) ((void)0)
|
||||
# define pngtest_debug2(m,p1,p2) ((void)0)
|
||||
#endif
|
||||
|
||||
#if !PNG_DEBUG
|
||||
# define SINGLE_ROWBUF_ALLOC /* Makes buffer overruns easier to nail */
|
||||
#endif
|
||||
@@ -263,6 +278,48 @@ static int wrote_question = 0;
|
||||
* than changing the library.
|
||||
*/
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
void
|
||||
pngtest_check_io_state(png_structp png_ptr, png_size_t data_length,
|
||||
png_uint_32 io_op);
|
||||
void
|
||||
pngtest_check_io_state(png_structp png_ptr, png_size_t data_length,
|
||||
png_uint_32 io_op)
|
||||
{
|
||||
png_uint_32 io_state = png_get_io_state(png_ptr);
|
||||
int err = 0;
|
||||
|
||||
/* Check if the current operation (reading / writing) is as expected. */
|
||||
if ((io_state & PNG_IO_MASK_OP) != io_op)
|
||||
png_error(png_ptr, "Incorrect operation in I/O state");
|
||||
|
||||
/* Check if the buffer size specific to the current location
|
||||
* (file signature / header / data / crc) is as expected.
|
||||
*/
|
||||
switch (io_state & PNG_IO_MASK_LOC)
|
||||
{
|
||||
case PNG_IO_SIGNATURE:
|
||||
if (data_length > 8)
|
||||
err = 1;
|
||||
break;
|
||||
case PNG_IO_CHUNK_HDR:
|
||||
if (data_length != 8)
|
||||
err = 1;
|
||||
break;
|
||||
case PNG_IO_CHUNK_DATA:
|
||||
break; /* no restrictions here */
|
||||
case PNG_IO_CHUNK_CRC:
|
||||
if (data_length != 4)
|
||||
err = 1;
|
||||
break;
|
||||
default:
|
||||
err = 1; /* uninitialized */
|
||||
}
|
||||
if (err)
|
||||
png_error(png_ptr, "Bad I/O state or buffer size");
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef USE_FAR_KEYWORD
|
||||
static void
|
||||
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
@@ -281,8 +338,12 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
|
||||
if (check != length)
|
||||
{
|
||||
png_error(png_ptr, "Read Error!");
|
||||
png_error(png_ptr, "Read Error");
|
||||
}
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
pngtest_check_io_state(png_ptr, length, PNG_IO_READING);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
/* This is the model-independent version. Since the standard I/O library
|
||||
@@ -302,7 +363,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
|
||||
/* Check if data really is near. If so, use usual code. */
|
||||
n_data = (png_byte *)CVT_PTR_NOCHECK(data);
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr));
|
||||
if ((png_bytep)n_data == data)
|
||||
{
|
||||
check = fread(n_data, 1, length, io_ptr);
|
||||
@@ -328,7 +389,11 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
while (remaining != 0);
|
||||
}
|
||||
if (check != length)
|
||||
png_error(png_ptr, "read Error");
|
||||
png_error(png_ptr, "Read Error");
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
pngtest_check_io_state(png_ptr, length, PNG_IO_READING);
|
||||
#endif
|
||||
}
|
||||
#endif /* USE_FAR_KEYWORD */
|
||||
|
||||
@@ -337,7 +402,7 @@ static void
|
||||
pngtest_flush(png_structp png_ptr)
|
||||
{
|
||||
/* Do nothing; fflush() is said to be just a waste of energy. */
|
||||
png_ptr = png_ptr; /* Stifle compiler warning */
|
||||
PNG_UNUSED(png_ptr) /* Stifle compiler warning */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -351,12 +416,18 @@ static void
|
||||
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_size_t check;
|
||||
png_FILE_p io_ptr;
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_get_io_ptr(png_ptr));
|
||||
|
||||
check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
|
||||
check = fwrite(data, 1, length, io_ptr);
|
||||
if (check != length)
|
||||
{
|
||||
png_error(png_ptr, "Write Error");
|
||||
}
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
pngtest_check_io_state(png_ptr, length, PNG_IO_WRITING);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
/* This is the model-independent version. Since the standard I/O library
|
||||
@@ -405,6 +476,10 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_error(png_ptr, "Write Error");
|
||||
}
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
pngtest_check_io_state(png_ptr, length, PNG_IO_WRITING);
|
||||
#endif
|
||||
}
|
||||
#endif /* USE_FAR_KEYWORD */
|
||||
|
||||
@@ -467,16 +542,16 @@ static int maximum_allocation = 0;
|
||||
static int total_allocation = 0;
|
||||
static int num_allocations = 0;
|
||||
|
||||
png_voidp png_debug_malloc
|
||||
png_voidp pngtest_debug_malloc
|
||||
PNGARG((png_structp png_ptr, png_alloc_size_t size));
|
||||
void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
void pngtest_debug_free PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
|
||||
png_voidp
|
||||
png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
pngtest_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
|
||||
/* png_malloc has already tested for NULL; png_create_struct calls
|
||||
* png_debug_malloc directly, with png_ptr == NULL which is OK
|
||||
* pngtest_debug_malloc directly, with png_ptr == NULL which is OK
|
||||
*/
|
||||
|
||||
if (size == 0)
|
||||
@@ -499,13 +574,13 @@ png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
pinfo->pointer = png_malloc(png_ptr, size);
|
||||
/* Restore malloc_fn and free_fn */
|
||||
png_set_mem_fn(png_ptr,
|
||||
NULL, png_debug_malloc, png_debug_free);
|
||||
NULL, pngtest_debug_malloc, pngtest_debug_free);
|
||||
if (size != 0 && pinfo->pointer == NULL)
|
||||
{
|
||||
current_allocation -= size;
|
||||
total_allocation -= size;
|
||||
png_error(png_ptr,
|
||||
"out of memory in pngtest->png_debug_malloc");
|
||||
"out of memory in pngtest->pngtest_debug_malloc");
|
||||
}
|
||||
pinfo->next = pinformation;
|
||||
pinformation = pinfo;
|
||||
@@ -520,10 +595,10 @@ png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
|
||||
/* Free a pointer. It is removed from the list at the same time. */
|
||||
void
|
||||
png_debug_free(png_structp png_ptr, png_voidp ptr)
|
||||
pngtest_debug_free(png_structp png_ptr, png_voidp ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
fprintf(STDERR, "NULL pointer to png_debug_free.\n");
|
||||
fprintf(STDERR, "NULL pointer to pngtest_debug_free.\n");
|
||||
if (ptr == 0)
|
||||
{
|
||||
#if 0 /* This happens all the time. */
|
||||
@@ -682,12 +757,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
return (1);
|
||||
}
|
||||
|
||||
png_debug(0, "Allocating read and write structures");
|
||||
pngtest_debug("Allocating read and write structures");
|
||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||
read_ptr =
|
||||
png_create_read_struct_2(PNG_LIBPNG_VER_STRING, NULL,
|
||||
NULL, NULL, NULL,
|
||||
(png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
|
||||
(png_malloc_ptr)pngtest_debug_malloc, (png_free_ptr)pngtest_debug_free);
|
||||
#else
|
||||
read_ptr =
|
||||
png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
@@ -710,7 +785,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||
write_ptr =
|
||||
png_create_write_struct_2(PNG_LIBPNG_VER_STRING, NULL,
|
||||
NULL, NULL, NULL, png_debug_malloc, png_debug_free);
|
||||
NULL, NULL, NULL, pngtest_debug_malloc, pngtest_debug_free);
|
||||
#else
|
||||
write_ptr =
|
||||
png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
@@ -720,7 +795,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
pngtest_warning);
|
||||
#endif
|
||||
#endif
|
||||
png_debug(0, "Allocating read_info, write_info and end_info structures");
|
||||
pngtest_debug("Allocating read_info, write_info and end_info structures");
|
||||
read_info_ptr = png_create_info_struct(read_ptr);
|
||||
end_info_ptr = png_create_info_struct(read_ptr);
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
@@ -729,7 +804,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
png_debug(0, "Setting jmpbuf for read struct");
|
||||
pngtest_debug("Setting jmpbuf for read struct");
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
#else
|
||||
@@ -753,7 +828,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_debug(0, "Setting jmpbuf for write struct");
|
||||
pngtest_debug("Setting jmpbuf for write struct");
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
#else
|
||||
@@ -776,7 +851,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
png_debug(0, "Initializing input and output streams");
|
||||
pngtest_debug("Initializing input and output streams");
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
png_init_io(read_ptr, fpin);
|
||||
# ifdef PNG_WRITE_SUPPORTED
|
||||
@@ -836,10 +911,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
NULL, 0);
|
||||
#endif
|
||||
|
||||
png_debug(0, "Reading info struct");
|
||||
pngtest_debug("Reading info struct");
|
||||
png_read_info(read_ptr, read_info_ptr);
|
||||
|
||||
png_debug(0, "Transferring info struct");
|
||||
pngtest_debug("Transferring info struct");
|
||||
{
|
||||
int interlace_type, compression_type, filter_type;
|
||||
|
||||
@@ -1026,7 +1101,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
|
||||
if (png_get_text(read_ptr, read_info_ptr, &text_ptr, &num_text) > 0)
|
||||
{
|
||||
png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text);
|
||||
pngtest_debug1("Handling %d iTXt/tEXt/zTXt chunks", num_text);
|
||||
png_set_text(write_ptr, write_info_ptr, text_ptr, num_text);
|
||||
}
|
||||
}
|
||||
@@ -1096,7 +1171,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_debug(0, "Writing info struct");
|
||||
pngtest_debug("Writing info struct");
|
||||
|
||||
/* If we wanted, we could write info in two steps:
|
||||
* png_write_info_before_PLTE(write_ptr, write_info_ptr);
|
||||
@@ -1139,12 +1214,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
|
||||
#ifdef SINGLE_ROWBUF_ALLOC
|
||||
png_debug(0, "Allocating row buffer...");
|
||||
pngtest_debug("Allocating row buffer...");
|
||||
row_buf = (png_bytep)png_malloc(read_ptr,
|
||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||
png_debug1(0, "0x%08lx", (unsigned long)row_buf);
|
||||
pngtest_debug1("0x%08lx", (unsigned long)row_buf);
|
||||
#endif /* SINGLE_ROWBUF_ALLOC */
|
||||
png_debug(0, "Writing row data");
|
||||
pngtest_debug("Writing row data");
|
||||
|
||||
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
|
||||
defined(PNG_WRITE_INTERLACING_SUPPORTED)
|
||||
@@ -1163,14 +1238,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
for (pass = 0; pass < num_pass; pass++)
|
||||
{
|
||||
png_debug1(0, "Writing row data for pass %d", pass);
|
||||
pngtest_debug1("Writing row data for pass %d", pass);
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
#ifndef SINGLE_ROWBUF_ALLOC
|
||||
png_debug2(0, "Allocating row buffer (pass %d, y = %ld)...", pass, y);
|
||||
pngtest_debug2("Allocating row buffer (pass %d, y = %ld)...", pass, y);
|
||||
row_buf = (png_bytep)png_malloc(read_ptr,
|
||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||
png_debug2(0, "0x%08lx (%ld bytes)", (unsigned long)row_buf,
|
||||
pngtest_debug2("0x%08lx (%ld bytes)", (unsigned long)row_buf,
|
||||
png_get_rowbytes(read_ptr, read_info_ptr));
|
||||
#endif /* !SINGLE_ROWBUF_ALLOC */
|
||||
png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1);
|
||||
@@ -1190,7 +1265,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif /* PNG_WRITE_SUPPORTED */
|
||||
|
||||
#ifndef SINGLE_ROWBUF_ALLOC
|
||||
png_debug2(0, "Freeing row buffer (pass %d, y = %ld)", pass, y);
|
||||
pngtest_debug2("Freeing row buffer (pass %d, y = %ld)", pass, y);
|
||||
png_free(read_ptr, row_buf);
|
||||
row_buf = NULL;
|
||||
#endif /* !SINGLE_ROWBUF_ALLOC */
|
||||
@@ -1204,7 +1279,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
png_free_data(write_ptr, write_info_ptr, PNG_FREE_UNKN, -1);
|
||||
#endif
|
||||
|
||||
png_debug(0, "Reading and writing end_info data");
|
||||
pngtest_debug("Reading and writing end_info data");
|
||||
|
||||
png_read_end(read_ptr, end_info_ptr);
|
||||
#ifdef PNG_TEXT_SUPPORTED
|
||||
@@ -1214,7 +1289,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
|
||||
if (png_get_text(read_ptr, end_info_ptr, &text_ptr, &num_text) > 0)
|
||||
{
|
||||
png_debug1(0, "Handling %d iTXt/tEXt/zTXt chunks", num_text);
|
||||
pngtest_debug1("Handling %d iTXt/tEXt/zTXt chunks", num_text);
|
||||
png_set_text(write_ptr, write_end_info_ptr, text_ptr, num_text);
|
||||
}
|
||||
}
|
||||
@@ -1275,26 +1350,26 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
}
|
||||
#endif
|
||||
|
||||
png_debug(0, "Destroying data structs");
|
||||
pngtest_debug("Destroying data structs");
|
||||
#ifdef SINGLE_ROWBUF_ALLOC
|
||||
png_debug(1, "destroying row_buf for read_ptr");
|
||||
pngtest_debug("destroying row_buf for read_ptr");
|
||||
png_free(read_ptr, row_buf);
|
||||
row_buf = NULL;
|
||||
#endif /* SINGLE_ROWBUF_ALLOC */
|
||||
png_debug(1, "destroying read_ptr, read_info_ptr, end_info_ptr");
|
||||
pngtest_debug("destroying read_ptr, read_info_ptr, end_info_ptr");
|
||||
png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_debug(1, "destroying write_end_info_ptr");
|
||||
pngtest_debug("destroying write_end_info_ptr");
|
||||
png_destroy_info_struct(write_ptr, &write_end_info_ptr);
|
||||
png_debug(1, "destroying write_ptr, write_info_ptr");
|
||||
pngtest_debug("destroying write_ptr, write_info_ptr");
|
||||
png_destroy_write_struct(&write_ptr, &write_info_ptr);
|
||||
#endif
|
||||
png_debug(0, "Destruction complete.");
|
||||
pngtest_debug("Destruction complete.");
|
||||
|
||||
FCLOSE(fpin);
|
||||
FCLOSE(fpout);
|
||||
|
||||
png_debug(0, "Opening files for comparison");
|
||||
pngtest_debug("Opening files for comparison");
|
||||
if ((fpin = fopen(inname, "rb")) == NULL)
|
||||
{
|
||||
fprintf(STDERR, "Could not find file %s\n", inname);
|
||||
@@ -1627,4 +1702,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_4_3 your_png_h_is_not_version_1_4_3;
|
||||
typedef version_1_4_8 your_png_h_is_not_version_1_4_8;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.4.2 [April 29, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.6 [ April 8, 2010]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -662,7 +662,7 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp
|
||||
* are called.
|
||||
*/
|
||||
png_voidp PNGAPI
|
||||
png_get_user_transform_ptr(png_structp png_ptr)
|
||||
png_get_user_transform_ptr(png_const_structp png_ptr)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
@@ -673,5 +673,5 @@ png_get_user_transform_ptr(png_structp png_ptr)
|
||||
#endif
|
||||
}
|
||||
#endif /* PNG_READ_USER_TRANSFORM_SUPPORTED ||
|
||||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
|
||||
PNG_WRITE_USER_TRANSFORM_SUPPORTED */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
18
pngwrite.c
18
pngwrite.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.0 [January 3, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -295,6 +295,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
|
||||
if (keep != PNG_HANDLE_CHUNK_NEVER &&
|
||||
up->location && (up->location & PNG_HAVE_PLTE) &&
|
||||
!(up->location & PNG_HAVE_IDAT) &&
|
||||
!(up->location & PNG_AFTER_IDAT) &&
|
||||
((up->name[3] & 0x20) || keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
||||
(png_ptr->flags & PNG_FLAG_KEEP_UNSAFE_CHUNKS)))
|
||||
{
|
||||
@@ -661,8 +662,8 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
png_debug2(1, "in png_write_row (row %ld, pass %d)",
|
||||
png_ptr->row_number, png_ptr->pass);
|
||||
png_debug2(1, "in png_write_row (row %lu, pass %d)",
|
||||
(unsigned long)png_ptr->row_number, png_ptr->pass);
|
||||
|
||||
/* Initialize transformations and other stuff if first time */
|
||||
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
|
||||
@@ -778,7 +779,8 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
||||
png_ptr->row_info.width);
|
||||
|
||||
png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type);
|
||||
png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width);
|
||||
png_debug1(3, "row_info->width = %lu",
|
||||
(unsigned long)png_ptr->row_info.width);
|
||||
png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels);
|
||||
png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth);
|
||||
png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth);
|
||||
@@ -1410,7 +1412,7 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_FILLER_SUPPORTED
|
||||
/* Pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels) */
|
||||
/* Pack XRGB/RGBX/ARGB/RGBA into RGB (4 channels -> 3 channels) */
|
||||
if (transforms & PNG_TRANSFORM_STRIP_FILLER_AFTER)
|
||||
png_set_filler(png_ptr, 0, PNG_FILLER_AFTER);
|
||||
else if (transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE)
|
||||
@@ -1450,8 +1452,8 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
|
||||
/* It is REQUIRED to call this to finish writing the rest of the file */
|
||||
png_write_end(png_ptr, info_ptr);
|
||||
|
||||
transforms = transforms; /* Quiet compiler warnings */
|
||||
params = params;
|
||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
||||
PNG_UNUSED(params)
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_WRITE_SUPPORTED */
|
||||
|
||||
@@ -195,6 +195,9 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
*dp = (png_byte)v;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
row_info->bit_depth = (png_byte)bit_depth;
|
||||
row_info->pixel_depth = (png_byte)(bit_depth * row_info->channels);
|
||||
|
||||
32
pngwutil.c
32
pngwutil.c
@@ -1,8 +1,8 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.4.1 [February 25, 2010]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Last changed in libpng 1.4.8 [July 7, 2011]
|
||||
* Copyright (c) 1998-2011 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.)
|
||||
*
|
||||
@@ -246,10 +246,12 @@ png_text_compress(png_structp png_ptr,
|
||||
*/
|
||||
|
||||
/* Set up the compression buffers */
|
||||
/* TODO: the following cast hides a potential overflow problem. */
|
||||
png_ptr->zstream.avail_in = (uInt)text_len;
|
||||
/* NOTE: assume zlib doesn't overwrite the input */
|
||||
png_ptr->zstream.next_in = (Bytef *)text;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
png_ptr->zstream.next_out = (Bytef *)png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = png_ptr->zbuf_size;
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
|
||||
/* This is the same compression loop as in png_write_row() */
|
||||
do
|
||||
@@ -680,11 +682,29 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
if (length >= 2 &&
|
||||
png_ptr->height < 16384 && png_ptr->width < 16384)
|
||||
{
|
||||
unsigned int z_cinfo;
|
||||
unsigned int half_z_window_size;
|
||||
|
||||
/* Compute the maximum possible length of the datastream */
|
||||
|
||||
/* Number of pixels, plus for each row a filter byte
|
||||
* and possibly a padding byte, so increase the maximum
|
||||
* size to account for these.
|
||||
*/
|
||||
png_uint_32 uncompressed_idat_size = png_ptr->height *
|
||||
((png_ptr->width *
|
||||
png_ptr->channels * png_ptr->bit_depth + 15) >> 3);
|
||||
unsigned int z_cinfo = z_cmf >> 4;
|
||||
unsigned int half_z_window_size = 1 << (z_cinfo + 7);
|
||||
|
||||
/* If it's interlaced, each block of 8 rows is sent as up to
|
||||
* 14 rows, i.e., 6 additional rows, each with a filter byte
|
||||
* and possibly a padding byte
|
||||
*/
|
||||
if (png_ptr->interlaced)
|
||||
uncompressed_idat_size += ((png_ptr->height + 7)/8) *
|
||||
(png_ptr->bit_depth < 8 ? 12 : 6);
|
||||
|
||||
z_cinfo = z_cmf >> 4;
|
||||
half_z_window_size = 1 << (z_cinfo + 7);
|
||||
while (uncompressed_idat_size <= half_z_window_size &&
|
||||
half_z_window_size >= 256)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
@@ -45,7 +45,7 @@
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
@@ -65,7 +65,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@@ -93,7 +93,7 @@
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
@@ -113,8 +113,8 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD;PNG_USER_PRIVATEBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -141,7 +141,7 @@
|
||||
AdditionalOptions="/d PNG_NO_PEDANTIC_WARNINGS /d PNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /d PNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions"""""
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
@@ -161,10 +161,10 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="3"
|
||||
PrecompiledHeaderThrough="png.h"
|
||||
@@ -202,10 +202,10 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..;..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="3"
|
||||
PrecompiledHeaderThrough="png.h"
|
||||
WarningLevel="3"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
@@ -64,7 +64,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;PNG_DLL;PNG_NO_STDIO;_CRT_SECURE_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
@@ -112,8 +112,8 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;PNGAPI=__stdcall;_CRT_SECURE_NO_WARNINGS"
|
||||
AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_DLL;PNG_NO_STDIO;PNGAPI=__stdcall;PNG_USER_PRIVATEBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -162,10 +162,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
WarningLevel="3"
|
||||
CompileAs="0"/>
|
||||
@@ -210,10 +210,10 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
AdditionalIncludeDirectories="..\..\scripts;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="0"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -62,7 +62,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
WarningLevel="3"
|
||||
@@ -107,9 +107,9 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
WarningLevel="3"
|
||||
CompileAs="1"/>
|
||||
@@ -146,9 +146,9 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"/>
|
||||
@@ -196,7 +196,16 @@
|
||||
RelativePath="..\..\..\zlib\deflate.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\zlib\gzio.c">
|
||||
RelativePath="..\..\..\zlib\gzlib.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\zlib\gzclose.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\zlib\gzread.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\zlib\gzwrite.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\..\zlib\infback.c">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
VisualStudio instructions
|
||||
|
||||
libpng version 1.4.3 - June 26, 2010
|
||||
libpng version 1.4.8 - July 7, 2011
|
||||
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<!--
|
||||
* zlib.props - location of zlib source and build
|
||||
*
|
||||
* libpng version 1.4.3 - June 26, 2010
|
||||
* libpng version 1.4.8 - July 7, 2011
|
||||
*
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
@@ -29,7 +29,7 @@
|
||||
zlib.h # The header file
|
||||
zconf.h # Another header file included by zlib.h
|
||||
-->
|
||||
<ZLib1Dir>..\..\..\..\zlib124-dll\zlib-1.2.4</ZLib1Dir>
|
||||
<ZLib1Dir>..\..\..\..\zlib125-dll\zlib-1.2.5</ZLib1Dir>
|
||||
|
||||
<!-- Place the name of the directory containing the source of
|
||||
zlib used for debugging in this property.
|
||||
@@ -38,6 +38,6 @@
|
||||
'.h' files in the source match those from the 'official'
|
||||
build above.
|
||||
-->
|
||||
<ZLibSrcDir>..\..\..\..\zlib-1.2.4</ZLibSrcDir>
|
||||
<ZLibSrcDir>..\..\..\..\zlib-1.2.5</ZLibSrcDir>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>libpng</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.apple.carbonframeworktemplate</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,9 +1,3 @@
|
||||
The xcode project has not been entirely updated to libpng-1.4.0.
|
||||
|
||||
It needs to *not* depend on pnggccrd.c or pngvcrd.c
|
||||
|
||||
It needs to PNG_NO_PEDANTIC_WARNINGS in the CFLAGS while building
|
||||
the library, but not while building an application.
|
||||
|
||||
If an updated version is not received, this project will
|
||||
be removed when libpng-1.4.0 is released.
|
||||
1 September 2010: Philippe Hausler updated the xcode project to work
|
||||
with libpng-1.4.x and added iOS targets for simulator and device.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
|
||||
Makefiles for libpng version 1.4.3 - June 26, 2010
|
||||
Makefiles for libpng version 1.4.8 - July 7, 2011
|
||||
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@@ -20,7 +20,7 @@ Makefiles for libpng version 1.4.3 - June 26, 2010
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.dj2 => DJGPP 2 makefile
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng14.so.14.1.4.3)
|
||||
(gcc, creates libpng14.so.14.1.4.8)
|
||||
makefile.freebsd => FreeBSD makefile
|
||||
makefile.gcc => Generic gcc makefile
|
||||
makefile.hpgcc => HPUX makefile using gcc
|
||||
@@ -36,12 +36,12 @@ Makefiles for libpng version 1.4.3 - June 26, 2010
|
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng14.so.14.1.4.3)
|
||||
creates libpng14.so.14.1.4.8)
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng14.so.14.1.4.3)
|
||||
creates libpng14.so.14.1.4.8)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng14.so.14.1.4.3)
|
||||
creates libpng14.so.14.1.4.8)
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.4.3
|
||||
version=1.4.8
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng14
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.4.3
|
||||
Version: 1.4.8
|
||||
Libs: -L${libdir} -lpng14
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
VERMAJ = 1
|
||||
VERMIN = 4
|
||||
VERMIC = 3
|
||||
VERMIC = 8
|
||||
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
|
||||
NAME = libpng
|
||||
PACKAGE = $(NAME)-$(VER)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# DJGPP (DOS gcc) makefile for libpng
|
||||
# Copyright (C) 2002, 2006, 2009 Glenn Randers-Pehrson
|
||||
# Copyright (C) 2002, 2006, 2009-2010 Glenn Randers-Pehrson
|
||||
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
@@ -13,7 +13,7 @@ INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-I../zlib -O
|
||||
CFLAGS=-I../zlib -O -DPNG_NO_SNPRINTF
|
||||
LDFLAGS=-L. -L../zlib/ -lpng -lz -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
# Library name:
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
RELEASE = 3
|
||||
RELEASE = 8
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).so
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng14
|
||||
|
||||
LIB= png14
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.3
|
||||
SHLIB_MINOR= 1.4.8
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 3
|
||||
SHLIB_MINOR= 1.4.3
|
||||
SHLIB_MINOR= 1.4.8
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.4.3
|
||||
SHLIB_MINOR= 1.4.8
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
CC = cl
|
||||
LD = link
|
||||
AR = lib
|
||||
CFLAGS = -nologo -MD -O2 -W3 -I..\zlib
|
||||
CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -MD -O2 -W3 -I..\zlib
|
||||
LDFLAGS = -nologo
|
||||
ARFLAGS = -nologo
|
||||
RM = del
|
||||
|
||||
@@ -15,7 +15,7 @@ LIBRARY lpngce
|
||||
png_get_int_32
|
||||
|
||||
EXPORTS
|
||||
;Version 1.4.3
|
||||
;Version 1.4.8
|
||||
png_build_grayscale_palette @1
|
||||
; png_check_sig @2
|
||||
png_chunk_error @3
|
||||
@@ -198,9 +198,11 @@ EXPORTS
|
||||
; png_read_init_3 @175
|
||||
; png_write_init_3 @176
|
||||
png_info_init_3 @177
|
||||
png_destroy_struct @178
|
||||
; Moved to pngpriv.h
|
||||
; png_destroy_struct @178
|
||||
; Added at version 1.2.0
|
||||
; For use with PNG_USER_MEM_SUPPORTED
|
||||
; Moved to pngpriv.h
|
||||
; png_destroy_struct_2 @179
|
||||
; png_create_read_struct_2 @180
|
||||
; png_create_write_struct_2 @181
|
||||
@@ -245,13 +247,14 @@ EXPORTS
|
||||
; Added at version 1.2.41
|
||||
png_write_sig @208
|
||||
png_benign_error @209
|
||||
png_benign_chunk_error @210
|
||||
png_chunk_benign_error @210
|
||||
png_set_benign_error @211
|
||||
png_get_io_chunk_name @212
|
||||
png_get_io_state @213
|
||||
png_get_chunk_cache_max @215
|
||||
png_set_chunk_cache_max @216
|
||||
png_check_cHRM_fixed @217
|
||||
; Moved to pngpriv.h
|
||||
; png_check_cHRM_fixed @217
|
||||
png_calloc @218
|
||||
png_set_longjmp_fn @219
|
||||
; Added at version 1.4.1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
; PNG.LIB module definition file for OS/2
|
||||
;----------------------------------------
|
||||
|
||||
; Version 1.4.3
|
||||
; Version 1.4.8
|
||||
|
||||
LIBRARY PNG
|
||||
DESCRIPTION "PNG image compression library for OS/2"
|
||||
@@ -205,13 +205,14 @@ EXPORTS
|
||||
; Added at version 1.2.41
|
||||
png_write_sig
|
||||
; png_benign_error
|
||||
; png_benign_chunk_error
|
||||
; png_chunk_benign_error
|
||||
; png_set_benign_error
|
||||
png_get_io_chunk_name
|
||||
png_get_io_state
|
||||
png_get_chunk_cache_max
|
||||
png_set_chunk_cache_max
|
||||
png_check_cHRM_fixed
|
||||
; Moved to pngpriv.h
|
||||
; png_check_cHRM_fixed @217
|
||||
png_calloc
|
||||
png_set_longjmp_fn
|
||||
; Added at version 1.4.1
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
;Version 1.4.3
|
||||
;Version 1.4.8
|
||||
png_build_grayscale_palette
|
||||
png_chunk_error
|
||||
png_chunk_warning
|
||||
@@ -169,10 +169,12 @@ EXPORTS
|
||||
png_set_invalid
|
||||
; Added at version 1.0.12
|
||||
png_info_init_3
|
||||
png_destroy_struct
|
||||
; Moved to pngpriv.h
|
||||
; png_destroy_struct
|
||||
; Added at version 1.2.0
|
||||
; For use with PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2
|
||||
; Moved to pngpriv.h
|
||||
; png_destroy_struct_2
|
||||
png_create_read_struct_2
|
||||
png_create_write_struct_2
|
||||
png_malloc_default
|
||||
@@ -200,13 +202,14 @@ EXPORTS
|
||||
; Added at version 1.2.41
|
||||
png_write_sig
|
||||
; png_benign_error
|
||||
; png_benign_chunk_error
|
||||
; png_chunk_benign_error
|
||||
; png_set_benign_error
|
||||
png_get_io_chunk_name
|
||||
png_get_io_state
|
||||
png_get_chunk_cache_max
|
||||
png_set_chunk_cache_max
|
||||
png_check_cHRM_fixed
|
||||
; Moved to pngpriv.h
|
||||
; png_check_cHRM_fixed @217
|
||||
png_calloc
|
||||
png_set_longjmp_fn
|
||||
; Added at version 1.4.1
|
||||
|
||||
Reference in New Issue
Block a user