mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
1 Commits
21895b05ab
...
v1.4.0beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcdc92c80c |
696
ANNOUNCE
696
ANNOUNCE
@@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.2.41beta19 - November 12, 2009
|
||||
Libpng 1.4.0beta97 - November 13, 2009
|
||||
|
||||
This is not intended to be a public release. It will be replaced
|
||||
within a few weeks by a public version or by another test version.
|
||||
@@ -9,125 +9,609 @@ Files available for download:
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
libpng-1.2.41beta19.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.2.41beta19.tar.gz
|
||||
libpng-1.2.41beta19.tar.bz2
|
||||
|
||||
Source files with LF line endings (for Unix/Linux) without the
|
||||
"configure" script
|
||||
|
||||
libpng-1.2.41beta19-no-config.tar.xz (LZMA-compressed, recommended)
|
||||
libpng-1.2.41beta19-no-config.tar.gz
|
||||
libpng-1.2.41beta19-no-config.tar.bz2
|
||||
1.4.0beta97.tar.xz (LZMA-compressed, recommended)
|
||||
1.4.0beta97.tar.gz
|
||||
1.4.0beta97.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lp1241b19.zip
|
||||
lp1241b19.7z
|
||||
lp1241b19.tar.bz2
|
||||
|
||||
Project files
|
||||
|
||||
libpng-1.2.41beta19-project-netware.zip
|
||||
libpng-1.2.41beta19-project-wince.zip
|
||||
lp140b97.zip
|
||||
lp140b97.7z
|
||||
|
||||
Other information:
|
||||
|
||||
libpng-1.2.41beta19-README.txt
|
||||
libpng-1.2.41beta19-KNOWNBUGS.txt
|
||||
libpng-1.2.41beta19-LICENSE.txt
|
||||
libpng-1.2.41beta19-Y2K-compliance.txt
|
||||
libpng-1.2.41beta19-[previous version]-diff.txt
|
||||
1.4.0beta97-README.txt
|
||||
1.4.0beta97-LICENSE.txt
|
||||
|
||||
Changes since the last public release (1.2.40):
|
||||
Changes since the last public release (1.2.10):
|
||||
|
||||
version 1.2.41beta01 [September 25, 2009]
|
||||
version 1.2.10beta1 [April 15, 2006]
|
||||
Renamed "config.h" to "png_conf.h" and revised Makefile.am to add
|
||||
-DPNG_BUILDING_LIBPNG to compile directive, and modified pngconf.h
|
||||
to include png_conf.h only when PNG_BUILDING_LIBPNG is defined.
|
||||
|
||||
version 1.2.10beta2 [April 15, 2006]
|
||||
Manually updated Makefile.in and configure. Changed png_conf.h.in
|
||||
back to config.h.
|
||||
|
||||
version 1.2.10beta3 [April 15, 2006]
|
||||
Change png_conf.h back to config.h in pngconf.h.
|
||||
|
||||
version 1.2.10beta4 [April 16, 2006]
|
||||
Change PNG_BUILDING_LIBPNG to PNG_CONFIGURE_LIBPNG in config/Makefile*.
|
||||
|
||||
version 1.2.10beta5 [April 16, 2006]
|
||||
Added a configure check for compiling assembler code in pnggccrd.c
|
||||
|
||||
version 1.2.10beta6 [April 17, 2006]
|
||||
Revised the configure check for pnggccrd.c
|
||||
Moved -DPNG_CONFIGURE_LIBPNG into @LIBPNG_DEFINES@
|
||||
Added @LIBPNG_DEFINES@ to arguments when building libpng.sym
|
||||
|
||||
version 1.2.10beta7 [April 18, 2006]
|
||||
Change "exec_prefix=$prefix" to "exec_prefix=$(prefix)" in makefiles.
|
||||
|
||||
version 1.2.10rc1 [April 19, 2006]
|
||||
Ensure pngconf.h doesn't define both PNG_USE_PNGGCCRD and PNG_USE_PNGVCRD
|
||||
Fixed "LN_FS" typo in makefile.sco and makefile.solaris.
|
||||
|
||||
version 1.2.10rc2 [April 19, 2006]
|
||||
Added a backslash between -DPNG_CONFIGURE_LIBPNG and -DPNG_NO_ASSEMBLER_CODE
|
||||
in configure.ac
|
||||
Made the configure warning about versioned symbols less arrogant.
|
||||
|
||||
version 1.2.10rc3 [April 20, 2006]
|
||||
Added a note in libpng.txt that png_set_sig_bytes(8) can be used when
|
||||
writing an embedded PNG without the 8-byte signature.
|
||||
|
||||
version 1.4.0beta1 [April 20, 2006]
|
||||
Enabled iTXt support (changes png_struct, thus requires so-number change).
|
||||
Cleaned up PNG_ASSEMBLER_CODE_SUPPORTED vs PNG_MMX_CODE_SUPPORTED
|
||||
Eliminated PNG_1_0_X and PNG_1_2_X macros.
|
||||
Removed deprecated functions png_read_init, png_write_init, png_info_init,
|
||||
png_permit_empty_plte, png_set_gray_1_2_4_to_8, and removed the
|
||||
deprecated macro PNG_MAX_UINT.
|
||||
Moved "PNG_INTERNAL" parts of png.h and pngconf.h into pngintrn.h
|
||||
Removed many WIN32_WCE #ifdefs (Cosmin).
|
||||
Reduced dependency on C-runtime library when on Windows (Simon-Pierre)
|
||||
Replaced sprintf() with png_sprintf() (Simon-Pierre)
|
||||
|
||||
version 1.4.0beta2 [April 20, 2006]
|
||||
Revised makefiles to avoid making links to libpng.so.*
|
||||
Moved some leftover MMX-related defines from pngconf.h to pngintrn.h
|
||||
Updated scripts/pngos2.def, pngw32.def, and projects/wince/png32ce.def
|
||||
Updated scripts/pngw32.def to comment out MMX functions.
|
||||
|
||||
version 1.2.11beta1 [May 31, 2006]
|
||||
scripts/libpng.pc.in contained "configure" style version info and would
|
||||
not work with makefiles.
|
||||
The shared-library makefiles were linking to libpng.so.0 instead of
|
||||
libpng.so.3 compatibility as the library.
|
||||
|
||||
version 1.4.0beta3 [May 10, 2006]
|
||||
Updated scripts/pngw32.def to comment out MMX functions.
|
||||
Added PNG_NO_GET_INT_32 and PNG_NO_SAVE_INT_32 macros.
|
||||
Revised pngconf.h and added pngconf.h.in so makefiles and configure can
|
||||
pass defines to libpng and applications.
|
||||
|
||||
version 1.4.0beta4 [May 11, 2006]
|
||||
Revised configure.ac, Makefile.am, and many of the makefiles to write
|
||||
their defines in pngconf.h.
|
||||
|
||||
version 1.4.0beta5 [May 15, 2006]
|
||||
Added a missing semicolon in Makefile.am and Makefile.in
|
||||
Deleted extraneous square brackets from configure.ac
|
||||
|
||||
version 1.2.11beta2 [June 2, 2006]
|
||||
Increased sprintf buffer from 50 to 52 chars in pngrutil.c to avoid
|
||||
buffer overflow.
|
||||
Fixed bug in example.c (png_set_palette_rgb -> png_set_palette_to_rgb))
|
||||
|
||||
version 1.4.0beta6 [June 2, 2006]
|
||||
Changed sonum from 0 to 1.
|
||||
Removed unused prototype for png_check_sig() from png.h
|
||||
|
||||
version 1.2.11beta3 [June 5, 2006]
|
||||
Prepended "#! /bin/sh" to ltmail.sh and contrib/pngminus/*.sh (Cosmin).
|
||||
Removed the accidental leftover Makefile.in~ (Cosmin).
|
||||
Avoided potential buffer overflow and optimized buffer in
|
||||
png_write_sCAL(), png_write_sCAL_s() (Cosmin).
|
||||
Removed the include directories and libraries from CFLAGS and LDFLAGS
|
||||
in scripts/makefile.gcc (Nelson A. de Oliveira, Cosmin).
|
||||
|
||||
version 1.2.11beta4 [June 6, 2006]
|
||||
Allow zero-length IDAT chunks after the entire zlib datastream, but not
|
||||
after another intervening chunk type.
|
||||
|
||||
version 1.2.11rc2 [June 14, 2006]
|
||||
Added prototypes for PNG_INCH_CONVERSIONS functions to png.h
|
||||
Revised INSTALL and autogen.sh
|
||||
Fixed typo in several makefiles (-W1 should be -Wl)
|
||||
|
||||
version 1.2.11rc3 [June 15, 2006]
|
||||
Added one zero element to png_gamma_shift[] array in pngrtran.c to avoid
|
||||
reading out of bounds.
|
||||
|
||||
version 1.4.0beta7 [June 16, 2006]
|
||||
Exported png_write_sig (Cosmin).
|
||||
Optimized buffer in png_handle_cHRM() (Cosmin).
|
||||
Set pHYs = 2835 x 2835 pixels per meter, and added
|
||||
sCAL = 0.352778e-3 x 0.352778e-3 meters, in pngtest.png (Cosmin).
|
||||
Added png_set_benign_errors(), png_benign_error(), png_chunk_benign_error().
|
||||
Added typedef for png_int_32 and png_uint_32 on 64-bit systems.
|
||||
|
||||
version 1.4.0beta8 [June 21, 2006]
|
||||
Added demonstration of user chunk support in pngtest.c, to support the
|
||||
public sTER chunk and a private vpAg chunk.
|
||||
|
||||
version 1.4.0beta9 [July 3, 2006]
|
||||
Removed ordinals from scripts/pngw32.def and removed png_info_int and
|
||||
png_set_gray_1_2_4_to_8 entries.
|
||||
Inline call of png_get_uint_32() in png_get_uint_31().
|
||||
Use png_get_uint_31() to get vpAg width and height in pngtest.c
|
||||
Removed WINCE and Netware projects.
|
||||
Removed standalone Y2KINFO file.
|
||||
|
||||
version 1.4.0beta10 [July 12, 2006]
|
||||
Added "all: pngconf.h.in pngconf.h" target to Makefile.am
|
||||
|
||||
version 1.4.0beta11 [August 19, 2006]
|
||||
Removed AC_FUNC_MALLOC from configure.ac.
|
||||
Added a warning when writing iCCP profile with mismatched profile length.
|
||||
Patched pnggccrd.c to assemble on x86_64 platforms.
|
||||
Moved chunk header reading into a separate function png_read_chunk_header()
|
||||
in pngrutil.c. The chunk header (len+sig) is now serialized in a single
|
||||
operation (Cosmin).
|
||||
Implemented support for I/O states. Added png_ptr member io_state, and
|
||||
functions png_get_io_chunk_name() and png_get_io_state() in pngget.c
|
||||
(Cosmin).
|
||||
Added png_get_io_chunk_name and png_get_io_state to scripts/*.def (Cosmin).
|
||||
Renamed scripts/pngw32.* to scripts/pngwin.* (Cosmin).
|
||||
Removed the include directories and libraries from CFLAGS and LDFLAGS
|
||||
in scripts/makefile.gcc (Cosmin).
|
||||
Used png_save_uint_32() to set vpAg width and height in pngtest.c (Cosmin).
|
||||
Cast to proper type when getting/setting vpAg units in pngtest.c (Cosmin).
|
||||
Added pngintrn.h to the Visual C++ projects (Cosmin).
|
||||
Removed scripts/list (Cosmin).
|
||||
Updated copyright year in scripts/pngwin.def (Cosmin).
|
||||
Removed PNG_TYPECAST_NULL and used standard NULL consistently (Cosmin).
|
||||
Disallowed the user to redefine png_size_t, and enforced a consistent use
|
||||
of png_size_t across libpng (Cosmin).
|
||||
Changed the type of png_ptr->rowbytes, PNG_ROWBYTES() and friends
|
||||
to png_size_t (Cosmin).
|
||||
Removed png_convert_size() and replaced png_sizeof with sizeof (Cosmin).
|
||||
Removed some unnecessary type casts (Cosmin).
|
||||
Changed prototype of png_get_compression_buffer_size() and
|
||||
png_set_compression_buffer_size() to work with png_size_t instead of
|
||||
png_uint_32 (Cosmin).
|
||||
Removed png_memcpy_check() and png_memset_check() (Cosmin).
|
||||
Fixed a typo (png_byte --> png_bytep) in libpng.3 and libpng.txt (Cosmin).
|
||||
Clarified that png_zalloc() does not clear the allocated memory,
|
||||
and png_zalloc() and png_zfree() cannot be PNGAPI (Cosmin).
|
||||
Renamed png_mem_size_t to png_alloc_size_t, fixed its definition in
|
||||
pngconf.h, and used it in all memory allocation functions (Cosmin).
|
||||
Renamed pngintrn.h to pngpriv.h, added a comment at the top of the file
|
||||
mentioning that the symbols declared in that file are private, and
|
||||
updated the scripts and the Visual C++ projects accordingly (Cosmin).
|
||||
Removed circular references between pngconf.h and pngconf.h.in in
|
||||
scripts/makefile.vc*win32 (Cosmin).
|
||||
Removing trailing '.' from the warning and error messages (Cosmin).
|
||||
Added pngdefs.h that is built by makefile or configure, instead of
|
||||
pngconf.h.in (Glenn).
|
||||
Detect and fix attempt to write wrong iCCP profile length.
|
||||
|
||||
version 1.4.0beta12 [October 19, 2006]
|
||||
Changed "logical" to "bitwise" in the documentation.
|
||||
Work around Intel-Mac compiler bug by setting PNG_NO_MMX_CODE in pngconf.h
|
||||
Add a typecast to stifle compiler warning in pngrutil.c
|
||||
|
||||
version 1.4.0beta13 [November 10, 2006]
|
||||
Fix potential buffer overflow in sPLT chunk handler.
|
||||
Fix Makefile.am to not try to link to noexistent files.
|
||||
|
||||
version 1.4.0beta14 [November 15, 2006]
|
||||
Check all exported functions for NULL png_ptr.
|
||||
|
||||
version 1.4.0beta15 [November 17, 2006]
|
||||
Relocated two misplaced tests for NULL png_ptr.
|
||||
Built Makefile.in with automake-1.9.6 instead of 1.9.2.
|
||||
Build configure with autoconf-2.60 instead of 2.59.
|
||||
Add "install: all" in Makefile.am so "configure; make install" will work.
|
||||
|
||||
version 1.4.0beta16 [November 17, 2006]
|
||||
Added a typecast in png_zalloc().
|
||||
|
||||
version 1.4.0beta17 [December 4, 2006]
|
||||
Changed "new_key[79] = '\0';" to "(*new_key)[79] = '\0';" in pngwutil.c
|
||||
|
||||
version 1.4.0beta18 [December 7, 2006]
|
||||
Added scripts/CMakeLists.txt
|
||||
|
||||
version 1.4.0beta19 [May 16, 2007]
|
||||
Revised scripts/CMakeLists.txt
|
||||
Rebuilt configure and Makefile.in with newer tools.
|
||||
Added "png_ptr->num_trans=0" before error return in png_handle_tRNS,
|
||||
to eliminate a vulnerability (CVE-2007-2554, CERT VU#684664)
|
||||
|
||||
version 1.4.0beta20 [July 9, 2008]
|
||||
Moved several PNG_HAVE_* macros from pngpriv.h to png.h because applications
|
||||
calling set_unknown_chunk_location() need them.
|
||||
Moved several macro definitions from pngpriv.h to pngconf.h
|
||||
Added png_ptr->unknown_chunk to hold working unknown chunk data, so it
|
||||
can be free'ed in case of error. Revised unknown chunk handling in
|
||||
pngrutil.c and pngpread.c to use this structure.
|
||||
Merge with changes to the 1.2.X branch, as of 1.2.19beta10.
|
||||
Revised makefile.mingw
|
||||
Prefer PNG_USE_PNGVCRD when _MSC_VER is defined in pngconf.h
|
||||
|
||||
version 1.4.0beta21 [July 21, 2008]
|
||||
Moved local array "chunkdata" from pngrutil.c to the png_struct, so
|
||||
it will be freed by png_read_destroy() in case of a read error (Kurt
|
||||
Christensen).
|
||||
|
||||
version 1.4.0beta22 [July 21, 2008]
|
||||
Change "purpose" and "buffer" to png_ptr->chunkdata to avoid memory leaking.
|
||||
|
||||
version 1.4.0beta23 [July 22, 2008]
|
||||
Change "chunkdata = NULL" to "png_ptr->chunkdata = NULL" several places in
|
||||
png_decompress_chunk().
|
||||
|
||||
version 1.4.0beta24 [July 25, 2008]
|
||||
Change all remaining "chunkdata" to "png_ptr->chunkdata" in
|
||||
png_decompress_chunk(), and remove "chunkdata" from parameter list.
|
||||
Put a call to png_check_chunk_name() in png_read_chunk_header().
|
||||
Revised png_check_chunk_name() to reject a name with a lowercase 3rd byte.
|
||||
Removed two calls to png_check_chunk_name() occuring later in the process.
|
||||
Define PNG_NO_ERROR_NUMBERS by default in pngconf.h
|
||||
|
||||
version 1.4.0beta25 [July 30, 2008]
|
||||
Added a call to png_check_chunk_name() in pngpread.c
|
||||
Reverted png_check_chunk_name() to accept a name with a lowercase 3rd byte.
|
||||
Added png_push_have_buffer() function to pngpread.c
|
||||
Eliminated PNG_BIG_ENDIAN_SUPPORTED and associated png_get_* macros.
|
||||
Made inline expansion of png_get_*() optional with PNG_USE_READ_MACROS.
|
||||
Eliminated all PNG_USELESS_TESTS and PNG_CORRECT_PALETTE_SUPPORTED code.
|
||||
Synced contrib directory and configure files with libpng-1.2.30beta06.
|
||||
Eliminated no-longer-used pngdefs.h (but it's still built in the makefiles)
|
||||
Relocated a misplaced "#endif /* PNG_NO_WRITE_FILTER */" in pngwutil.c
|
||||
|
||||
version 1.4.0beta26 [August 4, 2008]
|
||||
Removed png_push_have_buffer() function in pngpread.c. It increased the
|
||||
compiled library size slightly.
|
||||
Changed "-Wall" to "-W -Wall" in the CFLAGS in all makefiles (Cosmin Truta)
|
||||
Declared png_ptr "volatile" in pngread.c and pngwrite.c to avoid warnings.
|
||||
Updated contrib/visupng/cexcept.h to version 2.0.1
|
||||
Added PNG_LITERAL_CHARACTER macros for #, [, and ].
|
||||
|
||||
version 1.4.0beta27 [August 5, 2008]
|
||||
Revised usage of PNG_LITERAL_SHARP in pngerror.c.
|
||||
Moved newline character from individual png_debug messages into the
|
||||
png_debug macros.
|
||||
Allow user to #define their own png_debug, png_debug1, and png_debug2.
|
||||
|
||||
version 1.4.0beta28 [August 5, 2008]
|
||||
Revised usage of PNG_LITERAL_SHARP in pngerror.c.
|
||||
Added PNG_STRING_NEWLINE macro
|
||||
|
||||
version 1.4.0beta29 [August 9, 2008]
|
||||
Revised usage of PNG_STRING_NEWLINE to work on non-ISO compilers.
|
||||
Added PNG_STRING_COPYRIGHT macro.
|
||||
Added non-ISO versions of png_debug macros.
|
||||
|
||||
version 1.4.0beta30 [August 14, 2008]
|
||||
Added premultiplied alpha feature (Volker Wiendl).
|
||||
|
||||
version 1.4.0beta31 [August 18, 2008]
|
||||
Moved png_set_premultiply_alpha from pngtrans.c to pngrtran.c
|
||||
Removed extra crc check at the end of png_handle_cHRM(). Bug introduced
|
||||
in libpng-1.4.0beta20.
|
||||
|
||||
version 1.4.0beta32 [August 19, 2008]
|
||||
Added PNG_WRITE_FLUSH_SUPPORTED block around new png_flush() call.
|
||||
Revised PNG_NO_STDIO version of png_write_flush()
|
||||
|
||||
version 1.4.0beta33 [August 20, 2008]
|
||||
Added png_set_chunk_cache_max() to limit the total number of sPLT,
|
||||
text, and unknown chunks that can be stored.
|
||||
|
||||
version 1.4.0beta34 [September 6, 2008]
|
||||
Shortened tIME_string to 29 bytes in pngtest.c
|
||||
Fixed off-by-one error introduced in png_push_read_zTXt() function in
|
||||
libpng-1.2.30beta04/pngpread.c (Harald van Dijk)
|
||||
|
||||
version 1.4.0beta35 [October 6, 2008]
|
||||
Changed "trans_values" to "trans_color".
|
||||
Change png_set_gray_1_2_4_to_8() to png_set_expand_gray_1_2_4_to_8()
|
||||
in example.c (debian bug report)
|
||||
|
||||
version 1.4.0beta36 [October 25, 2008]
|
||||
Sync with tEXt vulnerability fix in libpng-1.2.33rc02.
|
||||
|
||||
version 1.4.0beta37 [November 13, 2008]
|
||||
Added png_check_cHRM in png.c and moved checking from pngget.c, pngrutil.c,
|
||||
and pngwrite.c
|
||||
|
||||
version 1.4.0beta38 [November 22, 2008]
|
||||
Added check for zero-area RGB cHRM triange in png_check_cHRM() and
|
||||
png_check_cHRM_fixed().
|
||||
|
||||
version 1.4.0beta39 [November 23, 2008]
|
||||
Revised png_warning() to write its message on standard output by default
|
||||
when warning_fn is NULL.
|
||||
|
||||
version 1.4.0beta40 [November 24, 2008]
|
||||
Eliminated png_check_cHRM(). Instead, always use png_check_cHRM_fixed().
|
||||
In png_check_cHRM_fixed(), ensure white_y is > 0, and removed redundant
|
||||
check for all-zero coordinates that is detected by the triangle check.
|
||||
|
||||
version 1.4.0beta41 [November 26, 2008]
|
||||
Fixed string vs pointer-to-string error in png_check_keyword().
|
||||
Rearranged test expressions in png_check_cHRM_fixed() to avoid internal
|
||||
overflows.
|
||||
Added PNG_NO_CHECK_cHRM conditional.
|
||||
|
||||
version 1.4.0beta42, 43 [December 1, 2008]
|
||||
Merge png_debug with version 1.2.34beta04.
|
||||
|
||||
version 1.4.0beta44 [December 6, 2008]
|
||||
Removed redundant check for key==NULL before calling png_check_keyword()
|
||||
to ensure that new_key gets initialized and removed extra warning
|
||||
(Merge with version 1.2.34beta05 -- Arvan Pritchard).
|
||||
|
||||
version 1.4.0beta45 [December 9, 2008]
|
||||
In png_write_png(), respect the placement of the filler bytes in an earlier
|
||||
call to png_set_filler() (Jim Barry).
|
||||
|
||||
version 1.4.0beta46 [December 10, 2008]
|
||||
Undid previous change and added PNG_TRANSFORM_STRIP_FILLER_BEFORE and
|
||||
PNG_TRANSFORM_STRIP_FILLER_AFTER conditionals and deprecated
|
||||
PNG_TRANSFORM_STRIP_FILLER (Jim Barry).
|
||||
|
||||
version 1.4.0beta47 [December 15, 2008]
|
||||
Turned off PNG_READ_DITHER_SUPPORTED by default.
|
||||
|
||||
version 1.4.0beta48 [February 14, 2009]
|
||||
Added new exported function png_calloc().
|
||||
Combined several instances of png_malloc(); png_memset() into png_calloc().
|
||||
Removed prototype for png_freeptr() that was added in libpng-1.4.0beta24
|
||||
|
||||
version 1.4.0beta49 [February 28, 2009]
|
||||
Added png_fileno() macro to pngconf.h, used in pngwio.c
|
||||
Corrected order of #ifdef's in png_debug definition in png.h
|
||||
Fixed bug introduced in libpng-1.4.0beta48 with the memset arguments
|
||||
for pcal_params.
|
||||
Fixed order of #ifdef directives in the png_debug defines in png.h
|
||||
(bug introduced in libpng-1.2.34/1.4.0beta29).
|
||||
Revised comments in png_set_read_fn() and png_set_write_fn().
|
||||
|
||||
version 1.4.0beta50 [March 18, 2009]
|
||||
Use png_calloc() instead of png_malloc() to allocate big_row_buf when
|
||||
reading an interlaced file, to avoid a possible UMR.
|
||||
Undid recent revision of PNG_NO_STDIO version of png_write_flush(). Users
|
||||
having trouble with fflush() can build with PNG_NO_WRITE_FLUSH defined
|
||||
or supply their own flush_fn() replacement.
|
||||
Revised libpng*.txt and png.h documentation about use of png_write_flush()
|
||||
and png_set_write_fn().
|
||||
Removed fflush() from pngtest.c.
|
||||
Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
|
||||
|
||||
version 1.4.0beta51 [March 21, 2009]
|
||||
Removed new png_fileno() macro from pngconf.h .
|
||||
|
||||
version 1.4.0beta52 [March 27, 2009]
|
||||
Relocated png_do_chop() ahead of building gamma tables in pngrtran.c
|
||||
This avoids building 16-bit gamma tables unnecessarily.
|
||||
Removed fflush() from pngtest.c.
|
||||
Added "#define PNG_NO_WRITE_FLUSH" to contrib/pngminim/encoder/pngusr.h
|
||||
Added a section on differences between 1.0.x and 1.2.x to libpng.3/libpng.txt
|
||||
|
||||
version 1.4.0beta53 [April 1, 2009]
|
||||
Removed some remaining MMX macros from pngpriv.h
|
||||
Fixed potential memory leak of "new_name" in png_write_iCCP() (Ralph Giles)
|
||||
|
||||
version 1.4.0beta54 [April 13, 2009]
|
||||
Added "ifndef PNG_SKIP_SETJMP_CHECK" block in pngconf.h to allow
|
||||
application code writers to bypass the check for multiple inclusion
|
||||
of setjmp.h when they know that it is safe to ignore the situation.
|
||||
Eliminated internal use of setjmp() in pngread.c and pngwrite.c
|
||||
Reordered ancillary chunks in pngtest.png to be the same as what
|
||||
pngtest now produces, and made some cosmetic changes to pngtest output.
|
||||
Eliminated deprecated png_read_init_3() and png_write_init_3() functions.
|
||||
|
||||
version 1.4.0beta55 [April 15, 2009]
|
||||
Simplified error handling in pngread.c and pngwrite.c by putting
|
||||
the new png_read_cleanup() and png_write_cleanup() functions inline.
|
||||
|
||||
version 1.4.0beta56 [April 25, 2009]
|
||||
Renamed "user_chunk_data" to "my_user_chunk_data" in pngtest.c to suppress
|
||||
"shadowed declaration" warning from gcc-4.3.3.
|
||||
Renamed "gamma" to "png_gamma" in pngset.c to avoid "shadowed declaration"
|
||||
warning about a global "gamma" variable in math.h on some platforms.
|
||||
|
||||
version 1.4.0beta57 [May 2, 2009]
|
||||
Removed prototype for png_freeptr() that was added in libpng-1.4.0beta24
|
||||
but was never defined (again).
|
||||
Rebuilt configure scripts with autoconf-2.63 instead of 2.62
|
||||
Removed pngprefs.h and MMX from makefiles
|
||||
|
||||
version 1.4.0beta58 [May 14, 2009]
|
||||
Changed pngw32.def to pngwin.def in makefile.mingw (typo was intruduced
|
||||
in beta57).
|
||||
Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri)
|
||||
|
||||
version 1.4.0beta59 [May 15, 2009]
|
||||
Reformated sources in libpng style (3-space intentation, comment format)
|
||||
Fixed typo in libpng docs (PNG_FILTER_AVE should be PNG_FILTER_AVG)
|
||||
Added sections about the git repository and our coding style to the
|
||||
documentation
|
||||
Relocated misplaced #endif in pngwrite.c, sCAL chunk handler.
|
||||
|
||||
version 1.4.0beta60 [May 19, 2009]
|
||||
Conditionally compile png_read_finish_row() which is not used by
|
||||
progressive readers.
|
||||
Added contrib/pngminim/preader to demonstrate building minimal progressive
|
||||
decoder, based on contrib/gregbook with embedded libpng and zlib.
|
||||
|
||||
version 1.4.0beta61 [May 20, 2009]
|
||||
In contrib/pngminim/*, renamed "makefile.std" to "makefile", since there
|
||||
is only one makefile in those directories, and revised the README files
|
||||
accordingly.
|
||||
More reformatting of comments, mostly to capitalize sentences.
|
||||
|
||||
version 1.4.0beta62 [June 2, 2009]
|
||||
Added "#define PNG_NO_WRITE_SWAP" to contrib/pngminim/encoder/pngusr.h
|
||||
and "define PNG_NO_READ_SWAP" to decoder/pngusr.h and preader/pngusr.h
|
||||
Reformatted several remaining "else statement" into two lines.
|
||||
Added a section to the libpng documentation about using png_get_io_ptr()
|
||||
in configure scripts to detect the presence of libpng.
|
||||
|
||||
version 1.4.0beta63 [June 15, 2009]
|
||||
Revised libpng*.txt and libpng.3 to mention calling png_set_IHDR()
|
||||
multiple times and to specify the sample order in the tRNS chunk,
|
||||
because the ISO PNG specification has a typo in the tRNS table.
|
||||
Changed several PNG_UNKNOWN_CHUNK_SUPPORTED to
|
||||
PNG_HANDLE_AS_UNKNOWN_SUPPORTED, to make the png_set_keep mechanism
|
||||
available for ignoring known chunks even when not saving unknown chunks.
|
||||
Adopted preference for consistent use of "#ifdef" and "#ifndef" versus
|
||||
"#if defined()" and "if !defined()" where possible.
|
||||
|
||||
version 1.4.0beta64 [June 24, 2009]
|
||||
Eliminated PNG_LEGACY_SUPPORTED code.
|
||||
Moved the various unknown chunk macro definitions outside of the
|
||||
PNG_READ|WRITE_ANCILLARY_CHUNK_SUPPORTED blocks.
|
||||
|
||||
version 1.4.0beta65 [June 26, 2009]
|
||||
Added a reference to the libpng license in each file.
|
||||
|
||||
version 1.4.0beta66 [June 27, 2009]
|
||||
Refer to the libpng license instead of the libpng license in each file.
|
||||
|
||||
version 1.4.0beta67 [July 6, 2009]
|
||||
Relocated INVERT_ALPHA within png_read_png() and png_write_png().
|
||||
Added high-level API transform PNG_TRANSFORM_GRAY_TO_RGB.
|
||||
Added an "xcode" project to the projects directory (Alam Arias).
|
||||
|
||||
version 1.4.0beta68 [July 19, 2009]
|
||||
Avoid some tests in filter selection in pngwutil.c
|
||||
|
||||
version 1.4.0beta69 [July 25, 2009]
|
||||
Simplified the new filter-selection test. This runs faster in the
|
||||
common "PNG_ALL_FILTERS" and PNG_FILTER_NONE cases.
|
||||
Removed extraneous declaration from the new call to png_read_gray_to_rgb()
|
||||
(bug introduced in libpng-1.4.0beta67).
|
||||
Fixed up xcode project (Alam Arias)
|
||||
|
||||
version 1.4.0beta70 [July 27, 2009]
|
||||
Avoid a possible NULL dereference in debug build, in png_set_text_2().
|
||||
(bug introduced in libpng-0.95, discovered by Evan Rouault)
|
||||
|
||||
version 1.4.0beta71 [July 29, 2009]
|
||||
Rebuilt configure scripts with autoconf-2.64.
|
||||
Added a prototype for png_64bit_product() in png.c
|
||||
|
||||
version 1.4.0beta72 [August 1, 2009]
|
||||
Replaced *.tar.lzma with *.tar.xz in distribution. Get the xz codec
|
||||
from <http://tukaani.org/xz>.
|
||||
|
||||
version 1.4.0beta73 [August 1, 2009]
|
||||
Reject attempt to write iCCP chunk with negative embedded profile length
|
||||
(JD Chen)
|
||||
|
||||
version 1.4.0beta74 [August 8, 2009]
|
||||
Changed png_ptr and info_ptr member "trans" to "trans_alpha".
|
||||
|
||||
version 1.4.0beta75 [August 21, 2009]
|
||||
Removed an extra png_debug() recently added to png_write_find_filter().
|
||||
Fixed incorrect #ifdef in pngset.c regarding unknown chunk support.
|
||||
|
||||
version 1.4.0beta76 [August 22, 2009]
|
||||
Moved an incorrectly located test in png_read_row() in pngread.c
|
||||
|
||||
version 1.4.0beta77 [August 27, 2009]
|
||||
Removed lpXYZ.tar.bz2 (with CRLF), KNOWNBUG, libpng-x.y.z-KNOWNBUG.txt,
|
||||
and the "noconfig" files from the distribution.
|
||||
Moved CMakeLists.txt from scripts into the main libpng directory.
|
||||
Various bugfixes and improvements to CMakeLists.txt (Philip Lowman)
|
||||
|
||||
version 1.4.0beta78 [August 31, 2009]
|
||||
Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h
|
||||
Eliminated PNG_NO_FREE_ME and PNG_FREE_ME_SUPPORTED macros.
|
||||
Use png_malloc plus a loop instead of png_calloc() to initialize
|
||||
row_pointers in png_read_png().
|
||||
|
||||
version 1.4.0beta79 [September 1, 2009]
|
||||
Eliminated PNG_GLOBAL_ARRAYS and PNG_LOCAL_ARRAYS; always use local arrays.
|
||||
Eliminated PNG_CALLOC_SUPPORTED macro and always provide png_calloc().
|
||||
|
||||
version 1.4.0beta80 [September 17, 2009]
|
||||
Removed scripts/libpng.icc
|
||||
Changed typecast of filler from png_byte to png_uint_16 in png_set_filler().
|
||||
(Dennis Gustafsson)
|
||||
Fixed typo introduced in beta78 in pngtest.c ("#if def " should be "#ifdef ")
|
||||
|
||||
version 1.4.0beta81 [September 23, 2009]
|
||||
Eliminated unused PNG_FLAG_FREE_* defines from pngpriv.h
|
||||
Expanded TAB characters in pngrtran.c
|
||||
Removed PNG_CONST from all "PNG_CONST PNG_CHNK" declarations to avoid
|
||||
compiler complaints about doubly declaring things "const".
|
||||
Changed all "#if [!]defined(X)" to "if[n]def X" where possible.
|
||||
Eliminated unused png_ptr->row_buf_size
|
||||
|
||||
version 1.4.0beta82 [September 25, 2009]
|
||||
Moved redundant IHDR checking into new png_check_IHDR() in png.c
|
||||
and report all errors found in the IHDR data.
|
||||
Eliminated useless call to png_check_cHRM() from pngset.c
|
||||
Expanded TAB characters in pngrtran.c
|
||||
|
||||
version 1.2.41beta02 [September 30, 2009]
|
||||
Revised png_check_IHDR().
|
||||
version 1.4.0beta83 [September 25, 2009]
|
||||
Revised png_check_IHDR() to eliminate bogus complaint about filter_type.
|
||||
|
||||
version 1.2.41beta03 [October 1, 2009]
|
||||
version 1.4.0beta84 [September 30, 2009]
|
||||
Fixed some inconsistent indentation in pngconf.h
|
||||
Revised png_check_IHDR() to add a test for width variable less than 32-bit.
|
||||
|
||||
version 1.4.0beta85 [October 1, 2009]
|
||||
Revised png_check_IHDR() again, to check info_ptr members instead of
|
||||
the contents of the returned parameters.
|
||||
|
||||
version 1.2.41beta04 [October 7, 2009]
|
||||
Added "xcode" project similar one already in libpng-1.4.0beta (Alam Arias).
|
||||
Ported some cosmetic changes from libpng-1.4.0beta86.
|
||||
version 1.4.0beta86 [October 9, 2009]
|
||||
Updated the "xcode" project (Alam Arias).
|
||||
Eliminated a shadowed declaration of "pp" in png_handle_sPLT().
|
||||
|
||||
version 1.2.41beta05 [October 17, 2009]
|
||||
Revised pngconf.h to make it easier to enable iTXt support. From libpng
|
||||
version 1.2.9 through 1.2.40, defining PNG_iTXt_SUPPORTED did not work
|
||||
as expected.
|
||||
Ported some cosmetic changes from libpng-1.4.0beta87, changing
|
||||
many "#if defined(x)" to "#ifdef x".
|
||||
version 1.4.0rc01 [October 19, 2009]
|
||||
Trivial cosmetic changes.
|
||||
|
||||
version 1.2.41beta06 [October 18, 2009]
|
||||
Restored PNG_USE_LOCAL_ARRAYS code in pngread.c that was inadvertently
|
||||
deleted in libpng-1.2.41beta05.
|
||||
Converted all PNG_NO_* tests to PNG_*_SUPPORTED everywhere except pngconf.h
|
||||
as in libpng-1.4.0beta78 and later.
|
||||
version 1.4.0beta87 [October 30, 2009]
|
||||
Moved version 1.4.0 back into beta.
|
||||
|
||||
version 1.2.41beta07 [October 21, 2009]
|
||||
Ported some cosmetic changes from libpng-1.4.0rc01, changing
|
||||
many "#if defined(x)" to "#ifdef x" in png.h and pngconf.h.
|
||||
version 1.4.0beta88 [October 30, 2009]
|
||||
Revised libpng*.txt section about differences between 1.2.x and 1.4.0
|
||||
because most of the new features have now been ported back to 1.2.41
|
||||
|
||||
version 1.2.41beta08 [October 30, 2009]
|
||||
Ported from libpng-1.4.0rc01: png_calloc(), png_get_io_chunk_name(),
|
||||
png_get_io_state(), png_set_user_cache_max(), png_get_user_cache_max(),
|
||||
png_set_premultiply_alpha, and png_do_read_premultiply_alpha().
|
||||
Relocated png_do_chop() ahead of building gamma tables in pngrtran.c
|
||||
This avoids building 16-bit gamma tables unnecessarily.
|
||||
|
||||
version 1.2.41beta09 [November 1, 2009]
|
||||
Removed a harmless extra png_set_invert_alpha() from pngwrite.c
|
||||
version 1.4.0beta89 [November 1, 2009]
|
||||
More bugfixes and improvements to CMakeLists.txt (Philip Lowman)
|
||||
Moved CMakeLists.txt from scripts into the main libpng directory.
|
||||
Removed a harmless extra png_set_invert_alpha() from pngwrite.c
|
||||
Apply png_user_chunk_cache_max within png_decompress_chunk().
|
||||
Merged libpng-1.2.41.txt with libpng-1.4.0.txt where appropriate.
|
||||
|
||||
version 1.2.41beta10 [November 1, 2009]
|
||||
Enabled iTXt support by default. To ensure binary compatibility with
|
||||
previous versions, the "lang" and "lang_key" members will be assumed
|
||||
to be omitted from previous versions unless the current libpng
|
||||
version was built with PNG_iTXt_SUPPORTED (which is otherwise no
|
||||
longer necessary to gain iTXt support), as a signal that the user has
|
||||
been building previous versions with PNG_iTXt_SUPPORTED as well.
|
||||
version 1.4.0beta90 [November 2, 2009]
|
||||
Removed all remaining WIN32_WCE #ifdefs except those involving the
|
||||
time.h "tm" structure
|
||||
|
||||
version 1.2.41beta11 [November 2, 2009]
|
||||
Store user's user_png_ver in new png_ptr->user_png_ver element.
|
||||
Revised iTXt support. To ensure binary compatibility with
|
||||
previous versions, the "lang" and "lang_key" members will be assumed
|
||||
to be omitted from versions prior to 1.2.41beta11 whenever there is a
|
||||
library mismatch.
|
||||
|
||||
version 1.2.41beta12 [November 2, 2009]
|
||||
Free png_ptr->user_png_ver when destroying png_ptr.
|
||||
|
||||
version 1.2.41beta13 [November 3, 2009]
|
||||
version 1.4.0beta91 [November 3, 2009]
|
||||
Updated scripts/pngw32.def and projects/wince/png32ce.def
|
||||
Copied projects/wince/png32ce.def to the scripts directory.
|
||||
Added scripts/makefile.wce
|
||||
Patched ltmain.sh for wince support.
|
||||
Added PNG_CONVERT_tIME_SUPPORTED macro.
|
||||
|
||||
version 1.2.41beta14 [November 8, 2009]
|
||||
versions 1.2.41beta05 through 1.2.41beta13 were abandoned.
|
||||
version 1.4.0beta92 [November 4, 2009]
|
||||
Make inclusion of time.h in pngconf.h depend on PNG_CONVERT_tIME_SUPPORTED
|
||||
Make #define PNG_CONVERT_tIME_SUPPORTED depend on PNG_WRITE_tIME_SUPPORTED
|
||||
Reverted iTXt compatibility stuff from 1.2.41beta05, 1.2.41beta11, and
|
||||
1.2.41beta12.
|
||||
Reverted IOSTATE feature, user_cache_max, and premultiply_alpha features
|
||||
from 1.2.41beta08.
|
||||
Retained png_calloc() from 1.2.41beta08 but as a non-exported function,
|
||||
and removed reference to png_calloc from scripts/*.def
|
||||
Revised libpng*.txt to describe differences from 1.2.40 to 1.4.0 (instead
|
||||
of differences from 1.2.41 to 1.4.0)
|
||||
|
||||
version 1.2.41beta15 [November 8, 2009]
|
||||
version 1.4.0beta93 [November 7, 2009]
|
||||
Added PNG_DEPSTRUCT, PNG_DEPRECATED, PNG_USE_RESULT, PNG_NORETURN, and
|
||||
PNG_ALLOCATED macros to detect deprecated direct access to the
|
||||
png_struct or info_struct members and other deprecated usage in
|
||||
@@ -137,29 +621,49 @@ version 1.2.41beta15 [November 8, 2009]
|
||||
functions while building libpng. They need to be tested, especially
|
||||
those using compilers other than gcc.
|
||||
Updated projects/visualc6 and visualc71 with "/d PNG_CONFIGURE_LIBPNG".
|
||||
|
||||
version 1.2.41beta16 [November 9, 2009]
|
||||
They should work but still need to be updated to remove
|
||||
references to pnggccrd.c or pngvcrd.c and ASM building.
|
||||
Added README.txt to the beos, cbuilder5, netware, and xcode projects warning
|
||||
that they need to be updated, to remove references to pnggccrd.c and
|
||||
pngvcrd.c and to depend on pngpriv.h
|
||||
Removed three direct references to read_info_ptr members in pngtest.c
|
||||
that were detected by the new PNG_DEPSTRUCT macro.
|
||||
Moved the png_debug macro definitions and the png_read_destroy(),
|
||||
png_write_destroy() and png_far_to_near() prototypes from png.h
|
||||
to pngpriv.h (John Bowler)
|
||||
Moved the synopsis lines for png_read_destroy(), png_write_destroy()
|
||||
png_debug(), png_debug1(), and png_debug2() from libpng.3 to libpngpf.3.
|
||||
|
||||
version 1.4.0beta94 [November 9, 2009]
|
||||
Removed the obsolete, unused pnggccrd.c and pngvcrd.c files.
|
||||
Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions.
|
||||
Removed dependency of pngtest.o on pngpriv.h in the makefiles.
|
||||
Only #define PNG_DEPSTRUCT, etc. in pngconf.h if not already defined.
|
||||
|
||||
version 1.2.41beta17 [November 10, 2009]
|
||||
Updated CMakeLists.txt to add "-DPNG_CONFIGURE_LIBPNG" to the definitions.
|
||||
Marked deprecated function prototypes with PNG_DEPRECATED.
|
||||
Marked memory allocation function prototypes with PNG_ALLOCATED.
|
||||
version 1.4.0beta95 [November 10, 2009]
|
||||
Changed png_check_sig() to !png_sig_cmp() in contrib programs.
|
||||
Added -DPNG_CONFIGURE_LIBPNG to contrib/pngminm/*/makefile
|
||||
Changed png_check_sig() to !png_sig_cmp() in contrib programs.
|
||||
Corrected the png_get_IHDR() call in contrib/gregbook/readpng2.c
|
||||
Added "-DPNG_CONFIGURE_LIBPNG" to the contrib/pngminum makefiles.
|
||||
Changed pngminim/*/gather.sh to stop trying to remove pnggccrd.c and pngvcrd.c
|
||||
Added dependency on pngpriv.h in contrib/pngminim/*/makefile
|
||||
|
||||
version 1.2.41beta18 [November 11, 2009]
|
||||
version 1.4.0beta96 [November 12, 2009]
|
||||
Renamed scripts/makefile.wce to scripts/makefile.cegcc
|
||||
Marked nonexported functions with PNG_PRIVATE macro.
|
||||
Revised Makefile.am to use libpng.sys while building libpng.so
|
||||
so that only PNG_EXPORT functions are exported.
|
||||
Removed the deprecated png_check_sig() function/macro.
|
||||
Removed recently removed function names from scripts/*.def
|
||||
Revised pngtest.png to put chunks in the same order written by pngtest
|
||||
(evidently the same change made in libpng-1.0beta54 was lost).
|
||||
Added PNG_PRIVATE macro definition in pngconf.h for possible future use.
|
||||
|
||||
version 1.2.41beta19 [November 12, 2009]
|
||||
Revised scripts/*.def to reflect functions actually exported by libpng.
|
||||
version 1.4.0beta97 [November 13, 2009]
|
||||
Restored pngtest.png to the libpng-1.4.0beta7 version.
|
||||
Removed projects/beos and netware.txt; no one seems to be supporting them.
|
||||
Revised Makefile.in
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
to subscribe) or to glennrp at users.sourceforge.net
|
||||
|
||||
@@ -15,8 +15,8 @@ enable_testing()
|
||||
# and license in png.h
|
||||
|
||||
set(PNGLIB_MAJOR 1)
|
||||
set(PNGLIB_MINOR 2)
|
||||
set(PNGLIB_RELEASE 41)
|
||||
set(PNGLIB_MINOR 4)
|
||||
set(PNGLIB_RELEASE 0)
|
||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||
|
||||
@@ -96,6 +96,7 @@ set(CMAKE_DEBUG_POSTFIX "d")
|
||||
set(libpng_sources
|
||||
png.h
|
||||
pngconf.h
|
||||
pngpriv.h
|
||||
png.c
|
||||
pngerror.c
|
||||
pngget.c
|
||||
@@ -128,9 +129,6 @@ if(PNG_SHARED OR NOT MSVC)
|
||||
add_definitions(-DZLIB_DLL)
|
||||
endif()
|
||||
|
||||
add_definitions(-DLIBPNG_NO_MMX)
|
||||
add_definitions(-DPNG_NO_MMX_CODE)
|
||||
|
||||
if(PNG_CONSOLE_IO_SUPPORTED)
|
||||
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
|
||||
endif()
|
||||
@@ -205,9 +203,9 @@ configure_file(${PNG_SOURCE_DIR}/scripts/libpng-config.in
|
||||
# SET UP LINKS
|
||||
if(PNG_SHARED)
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 0.${PNGLIB_RELEASE}.1.2.41beta19
|
||||
VERSION 0.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 0
|
||||
# VERSION 14.${PNGLIB_RELEASE}.1.4.0beta97
|
||||
VERSION 14.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 14
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
if(PNG_STATIC)
|
||||
@@ -235,8 +233,8 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
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 png.h pngconf.h pngpriv.h DESTINATION include)
|
||||
install(FILES png.h pngconf.h pngpriv.h DESTINATION include/${PNGLIB_NAME})
|
||||
endif()
|
||||
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
|
||||
install(PROGRAMS ${PNG_BINARY_DIR}/libpng-config DESTINATION bin)
|
||||
|
||||
69
INSTALL
69
INSTALL
@@ -1,5 +1,5 @@
|
||||
|
||||
Installing libpng version 1.2.41beta19 - November 11, 2009
|
||||
Installing libpng version 1.4.0beta97 - November 13, 2009
|
||||
|
||||
On Unix/Linux and similar systems, you can simply type
|
||||
|
||||
@@ -27,24 +27,23 @@ Instead, you can use one of the custom-built makefiles in the
|
||||
|
||||
Or you can use one of the "projects" in the "projects" directory.
|
||||
|
||||
If you want to use "cmake" (see www.cmake.org), copy CMakeLists.txt
|
||||
from the "scripts" directory to this directory and type
|
||||
|
||||
cmake . [-DPNG_MMX=YES] -DCMAKE_INSTALL_PREFIX=/path
|
||||
make
|
||||
make install
|
||||
|
||||
Before installing libpng, you must first install zlib, if it
|
||||
is not already on your system. zlib can usually be found
|
||||
wherever you got libpng. zlib can be placed in another directory,
|
||||
at the same level as libpng.
|
||||
|
||||
If you want to use "cmake" (see www.cmake.org), type
|
||||
|
||||
cmake . -DCMAKE_INSTALL_PREFIX=/path
|
||||
make
|
||||
make install
|
||||
|
||||
If your system already has a preinstalled zlib you will still need
|
||||
to have access to the zlib.h and zconf.h include files that
|
||||
correspond to the version of zlib that's installed.
|
||||
|
||||
You can rename the directories that you downloaded (they
|
||||
might be called "libpng-1.2.41beta19" or "lpng109" and "zlib-1.2.1"
|
||||
might be called "libpng-1.4.0beta97" or "lpng109" and "zlib-1.2.1"
|
||||
or "zlib121") so that you have directories called "zlib" and "libpng".
|
||||
|
||||
Your directory structure should look like this:
|
||||
@@ -55,19 +54,21 @@ Your directory structure should look like this:
|
||||
README
|
||||
*.h
|
||||
*.c
|
||||
CMakeLists.txt => "cmake" script
|
||||
contrib
|
||||
gregbook
|
||||
pngminim
|
||||
pngminus
|
||||
pngsuite
|
||||
visupng
|
||||
projects
|
||||
beos
|
||||
c5builder (Borland)
|
||||
cbuilder5 (Borland)
|
||||
visualc6 (msvc)
|
||||
netware.txt
|
||||
wince.txt
|
||||
visualc71
|
||||
xcode
|
||||
scripts
|
||||
makefile.*
|
||||
*.def (module definition files)
|
||||
pngtest.png
|
||||
etc.
|
||||
zlib
|
||||
@@ -82,14 +83,8 @@ distribution of libpng. It is available in both tar.gz (UNIX style line
|
||||
endings) and zip (DOS style line endings) formats.
|
||||
|
||||
If you are building libpng with MSVC, you can enter the
|
||||
libpng projects\visualc6 directory and follow the instructions in
|
||||
projects\visualc6\README.txt.
|
||||
|
||||
You can build libpng for WindowsCE by downloading and installing
|
||||
the projects\wince directory as instructed in the projects\wince.txt file, and
|
||||
then following the instructions in the README* files. Similarly, you can
|
||||
build libpng for Netware or Beos as instructed in projects\netware.txt
|
||||
or projects\beos.
|
||||
libpng projects\visualc6 or visualc71 directory and follow the instructions
|
||||
in README.txt.
|
||||
|
||||
Else enter the zlib directory and follow the instructions in zlib/README,
|
||||
then come back here and run "configure" or choose the appropriate
|
||||
@@ -98,12 +93,17 @@ makefile.sys in the scripts directory.
|
||||
The files that are presently available in the scripts directory
|
||||
include
|
||||
|
||||
CMakeLists.txt => "cmake" script
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.nommx => Linux/ELF makefile
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97
|
||||
does not use Intel MMX assembler code)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@@ -119,21 +119,18 @@ include
|
||||
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64-bit
|
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||
makefile.intel => Intel C/C++ version 4.0 and later
|
||||
libpng.icc => Project file for IBM VisualAge/C++ version 4.0 or later
|
||||
makefile.netbsd => NetBSD/cc makefile, uses PNGGCCRD, makes libpng.so.
|
||||
makefile.ne12bsd => NetBSD/cc makefile, uses PNGGCCRD,
|
||||
makes libpng12.so
|
||||
makefile.ne14bsd => NetBSD/cc makefile, uses PNGGCCRD,
|
||||
makes libpng14.so
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng12.so.0.1.2.41beta19)
|
||||
creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.41beta19)
|
||||
makefile.solaris-x86 => Solaris/intelMMX 2.X makefile (gcc,
|
||||
creates libpng12.so.0.1.2.41beta19)
|
||||
creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng12.so.0.1.2.41beta19)
|
||||
creates libpng14.so.14.1.4.0beta97)
|
||||
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
|
||||
@@ -143,15 +140,19 @@ include
|
||||
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC compiler
|
||||
(Requires SCOPTIONS, copied from scripts/SCOPTIONS.ppc)
|
||||
makefile.atari => Atari makefile
|
||||
makefile.beos => BEOS makefile for X86
|
||||
makefile.bor => Borland makefile (uses bcc)
|
||||
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
|
||||
makefile.tc3 => Turbo C 3.0 makefile
|
||||
makefile.dj2 => DJGPP 2 makefile
|
||||
makefile.msc => Microsoft C makefile
|
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later
|
||||
makefile.vcawin32 => makefile for Microsoft Visual C++ 5.0 and later (uses
|
||||
assembler code tuned for Intel MMX platform)
|
||||
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and later (does
|
||||
not use assembler code)
|
||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
|
||||
pngos2.def => OS/2 module definition file used by makefile.os2
|
||||
pngwin.def => module definition file for makefile.cygwin and mingw
|
||||
png32ce.def => module definition file used by makefile.cegcc
|
||||
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
|
||||
makevms.com => VMS build script
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
|
||||
22
KNOWNBUG
22
KNOWNBUG
@@ -1,22 +0,0 @@
|
||||
|
||||
Known bugs in libpng version 1.2.41beta19
|
||||
|
||||
1. February 23, 2006: The custom makefiles don't build libpng with -lz.
|
||||
|
||||
STATUS: This is a subject of debate. The change will probably be made
|
||||
as a part of a major overhaul of the makefiles in libpng version 1.4.0.
|
||||
|
||||
2. February 24, 2006: The Makefile generated by the "configure" script
|
||||
fails to install symbolic links
|
||||
libpng12.so => libpng12.so.0.1.2.9betaN
|
||||
that are generated by the custom makefiles.
|
||||
|
||||
3. September 4, 2007: There is a report that pngtest crashes on MacOS 10.
|
||||
|
||||
STATUS: workarounds are
|
||||
1) Compile without optimization (crashes are observed with
|
||||
-arch i386 and -O2 or -O3, using gcc-4.0.1).
|
||||
2) Compile pngtest.c with PNG_DEBUG defined (the bug goes away if
|
||||
you try to look at it).
|
||||
3) Ignore the crash. The library itself seems to be OK.
|
||||
|
||||
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.2.41beta19, November 11, 2009, are
|
||||
Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta97, November 13, 2009, 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
|
||||
|
||||
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
November 11, 2009
|
||||
November 13, 2009
|
||||
|
||||
48
Makefile.am
48
Makefile.am
@@ -16,7 +16,7 @@ AUTOMAKE_OPTIONS = foreign
|
||||
# test programs - run on make check, make distcheck
|
||||
check_PROGRAMS= pngtest
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng12.la
|
||||
pngtest_LDADD = libpng14.la
|
||||
TESTS = test-pngtest.sh
|
||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
|
||||
@@ -24,39 +24,41 @@ TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
dist_man_MANS= libpng.3 libpngpf.3 png.5
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs= libpng12-config
|
||||
EXTRA_SCRIPTS= libpng-config libpng12-config
|
||||
binconfigs= libpng14-config
|
||||
EXTRA_SCRIPTS= libpng-config libpng14-config
|
||||
bin_SCRIPTS= @binconfigs@
|
||||
|
||||
# rules to build libpng, only build the old library on request
|
||||
lib_LTLIBRARIES=libpng12.la @compatlib@
|
||||
lib_LTLIBRARIES=libpng14.la @compatlib@
|
||||
EXTRA_LTLIBRARIES= libpng.la
|
||||
libpng12_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
libpng14_la_SOURCES = 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 \
|
||||
png.h pngconf.h
|
||||
libpng_la_SOURCES = $(libpng12_la_SOURCES)
|
||||
png.h pngconf.h pngpriv.h
|
||||
libpng_la_SOURCES = $(libpng14_la_SOURCES)
|
||||
|
||||
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng14_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
|
||||
# MAJOR UPGRADE: the version-number settings below must be changed.
|
||||
libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number 0:@PNGLIB_RELEASE@:0
|
||||
libpng14_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number 14:@PNGLIB_RELEASE@:0
|
||||
# -rpath is needed as automake doesn't know the directory
|
||||
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
|
||||
-version-number 3:@PNGLIB_RELEASE@:0
|
||||
-version-number 14:@PNGLIB_RELEASE@:0
|
||||
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
# Versioned symbols and restricted exports
|
||||
libpng12_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
libpng12_la_DEPENDENCIES = libpng.vers
|
||||
libpng_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
libpng14_la_LDFLAGS += -Wl,--version-script=libpng.vers
|
||||
libpng14_la_DEPENDENCIES = libpng.vers
|
||||
else
|
||||
# Only restricted exports when possible
|
||||
libpng12_la_LDFLAGS += -export-symbols libpng.sym
|
||||
libpng12_la_DEPENDENCIES = libpng.sym
|
||||
libpng_la_LDFLAGS += -export-symbols libpng.sym
|
||||
libpng14_la_LDFLAGS += -export-symbols libpng.sym
|
||||
libpng14_la_DEPENDENCIES = libpng.sym
|
||||
endif
|
||||
libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
|
||||
libpng_la_DEPENDENCIES = $(libpng14_la_DEPENDENCIES)
|
||||
|
||||
# Avoid depending upon Character Ranges.
|
||||
AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||
@@ -68,27 +70,24 @@ pkginclude_HEADERS= png.h pngconf.h
|
||||
# pkg-config stuff, note that libpng.pc is always required in order
|
||||
# to get the correct library
|
||||
pkgconfigdir = @pkgconfigdir@
|
||||
pkgconfig_DATA = libpng12.pc
|
||||
pkgconfig_DATA = libpng14.pc
|
||||
|
||||
#extra source distribution files.
|
||||
EXTRA_DIST= \
|
||||
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
|
||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||
${srcdir}/projects/cbuilder5/* \
|
||||
${srcdir}/projects/beos/* \
|
||||
${srcdir}/projects/visualc6/* \
|
||||
${srcdir}/projects/visualc71/* \
|
||||
${srcdir}/projects/wince.txt \
|
||||
${srcdir}/projects/netware.txt \
|
||||
${srcdir}/scripts/* \
|
||||
${srcdir}/contrib/gregbook/* \
|
||||
${srcdir}/contrib/pngminus/* \
|
||||
${srcdir}/contrib/pngsuite/* \
|
||||
${srcdir}/contrib/visupng/* \
|
||||
$(TESTS) \
|
||||
example.c libpng-1.2.41beta19.txt pngvcrd.c
|
||||
example.c libpng-1.4.0beta97.txt
|
||||
|
||||
CLEANFILES= pngout.png libpng12.pc libpng12-config libpng.vers \
|
||||
CLEANFILES= pngout.png libpng14.pc libpng14-config libpng.vers \
|
||||
libpng.sym
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
@@ -122,11 +121,12 @@ test: check
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
|
||||
pngconf.h
|
||||
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
|
||||
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
||||
|
||||
# do evil things to libpng to cause libpng12 to be used
|
||||
# do evil things to libpng to cause libpng14 to be used
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir); rm -f libpng-config
|
||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||
|
||||
264
Makefile.in
264
Makefile.in
@@ -48,7 +48,9 @@ build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
check_PROGRAMS = pngtest$(EXEEXT)
|
||||
@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=libpng.vers
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_2 = -export-symbols libpng.sym
|
||||
@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_2 = -Wl,--version-script=libpng.vers
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_3 = -export-symbols libpng.sym
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_4 = -export-symbols libpng.sym
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
|
||||
$(pkginclude_HEADERS) $(srcdir)/Makefile.am \
|
||||
@@ -105,22 +107,22 @@ libpng_la_OBJECTS = $(am_libpng_la_OBJECTS)
|
||||
libpng_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libpng_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
libpng12_la_LIBADD =
|
||||
am_libpng12_la_OBJECTS = libpng12_la-png.lo \
|
||||
libpng12_la-pngset.lo libpng12_la-pngget.lo \
|
||||
libpng12_la-pngrutil.lo libpng12_la-pngtrans.lo \
|
||||
libpng12_la-pngwutil.lo libpng12_la-pngread.lo \
|
||||
libpng12_la-pngrio.lo libpng12_la-pngwio.lo \
|
||||
libpng12_la-pngwrite.lo libpng12_la-pngrtran.lo \
|
||||
libpng12_la-pngwtran.lo libpng12_la-pngmem.lo \
|
||||
libpng12_la-pngerror.lo libpng12_la-pngpread.lo
|
||||
libpng12_la_OBJECTS = $(am_libpng12_la_OBJECTS)
|
||||
libpng12_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
libpng14_la_LIBADD =
|
||||
am_libpng14_la_OBJECTS = libpng14_la-png.lo libpng14_la-pngset.lo \
|
||||
libpng14_la-pngget.lo libpng14_la-pngrutil.lo \
|
||||
libpng14_la-pngtrans.lo libpng14_la-pngwutil.lo \
|
||||
libpng14_la-pngread.lo libpng14_la-pngrio.lo \
|
||||
libpng14_la-pngwio.lo libpng14_la-pngwrite.lo \
|
||||
libpng14_la-pngrtran.lo libpng14_la-pngwtran.lo \
|
||||
libpng14_la-pngmem.lo libpng14_la-pngerror.lo \
|
||||
libpng14_la-pngpread.lo
|
||||
libpng14_la_OBJECTS = $(am_libpng14_la_OBJECTS)
|
||||
libpng14_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(libpng12_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
$(libpng14_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
am_pngtest_OBJECTS = pngtest.$(OBJEXT)
|
||||
pngtest_OBJECTS = $(am_pngtest_OBJECTS)
|
||||
pngtest_DEPENDENCIES = libpng12.la
|
||||
pngtest_DEPENDENCIES = libpng14.la
|
||||
SCRIPTS = $(bin_SCRIPTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
@@ -135,9 +137,9 @@ CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libpng_la_SOURCES) $(libpng12_la_SOURCES) \
|
||||
SOURCES = $(libpng_la_SOURCES) $(libpng14_la_SOURCES) \
|
||||
$(pngtest_SOURCES)
|
||||
DIST_SOURCES = $(libpng_la_SOURCES) $(libpng12_la_SOURCES) \
|
||||
DIST_SOURCES = $(libpng_la_SOURCES) $(libpng14_la_SOURCES) \
|
||||
$(pngtest_SOURCES)
|
||||
man3dir = $(mandir)/man3
|
||||
man5dir = $(mandir)/man5
|
||||
@@ -198,7 +200,6 @@ LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPNG_DEFINES = @LIBPNG_DEFINES@
|
||||
LIBPNG_NO_MMX = @LIBPNG_NO_MMX@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
@@ -246,7 +247,7 @@ am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
|
||||
# generate the -config scripts if required
|
||||
binconfigs = libpng12-config
|
||||
binconfigs = libpng14-config
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
@@ -298,63 +299,59 @@ PNGLIB_BASENAME = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
# libpng does not follow GNU file name conventions
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng12.la
|
||||
pngtest_LDADD = libpng14.la
|
||||
TESTS = test-pngtest.sh
|
||||
TESTS_ENVIRONMENT = srcdir=$(srcdir)
|
||||
|
||||
# man pages
|
||||
dist_man_MANS = libpng.3 libpngpf.3 png.5
|
||||
EXTRA_SCRIPTS = libpng-config libpng12-config
|
||||
EXTRA_SCRIPTS = libpng-config libpng14-config
|
||||
bin_SCRIPTS = @binconfigs@
|
||||
|
||||
# rules to build libpng, only build the old library on request
|
||||
lib_LTLIBRARIES = libpng12.la @compatlib@
|
||||
lib_LTLIBRARIES = libpng14.la @compatlib@
|
||||
EXTRA_LTLIBRARIES = libpng.la
|
||||
libpng12_la_SOURCES = png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
libpng14_la_SOURCES = 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 \
|
||||
png.h pngconf.h
|
||||
png.h pngconf.h pngpriv.h
|
||||
|
||||
libpng_la_SOURCES = $(libpng12_la_SOURCES)
|
||||
libpng_la_SOURCES = $(libpng14_la_SOURCES)
|
||||
libpng_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng12_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
libpng14_la_CPPFLAGS = @LIBPNG_DEFINES@
|
||||
|
||||
# MAJOR UPGRADE: the version-number settings below must be changed.
|
||||
libpng12_la_LDFLAGS = -no-undefined -export-dynamic \
|
||||
-version-number 0:@PNGLIB_RELEASE@:0 $(am__append_1) \
|
||||
$(am__append_2)
|
||||
libpng14_la_LDFLAGS = -no-undefined -export-dynamic -version-number \
|
||||
14:@PNGLIB_RELEASE@:0 $(am__append_2) $(am__append_4)
|
||||
# -rpath is needed as automake doesn't know the directory
|
||||
libpng_la_LDFLAGS = -rpath '$(libdir)' -no-undefined -export-dynamic \
|
||||
-version-number 3:@PNGLIB_RELEASE@:0
|
||||
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@libpng12_la_DEPENDENCIES = libpng.sym
|
||||
@HAVE_LD_VERSION_SCRIPT_TRUE@libpng12_la_DEPENDENCIES = libpng.vers
|
||||
libpng_la_DEPENDENCIES = $(libpng12_la_DEPENDENCIES)
|
||||
-version-number 14:@PNGLIB_RELEASE@:0 $(am__append_1) \
|
||||
$(am__append_3)
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@libpng14_la_DEPENDENCIES = libpng.sym
|
||||
@HAVE_LD_VERSION_SCRIPT_TRUE@libpng14_la_DEPENDENCIES = libpng.vers
|
||||
libpng_la_DEPENDENCIES = $(libpng14_la_DEPENDENCIES)
|
||||
|
||||
# Avoid depending upon Character Ranges.
|
||||
AN = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
||||
pkginclude_HEADERS = png.h pngconf.h
|
||||
pkgconfig_DATA = libpng12.pc
|
||||
pkgconfig_DATA = libpng14.pc
|
||||
|
||||
#extra source distribution files.
|
||||
EXTRA_DIST = \
|
||||
ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO \
|
||||
pngtest.png pngbar.png pngnow.png pngbar.jpg autogen.sh \
|
||||
${srcdir}/projects/cbuilder5/* \
|
||||
${srcdir}/projects/beos/* \
|
||||
${srcdir}/projects/visualc6/* \
|
||||
${srcdir}/projects/visualc71/* \
|
||||
${srcdir}/projects/wince.txt \
|
||||
${srcdir}/projects/netware.txt \
|
||||
${srcdir}/scripts/* \
|
||||
${srcdir}/contrib/gregbook/* \
|
||||
${srcdir}/contrib/pngminus/* \
|
||||
${srcdir}/contrib/pngsuite/* \
|
||||
${srcdir}/contrib/visupng/* \
|
||||
$(TESTS) \
|
||||
example.c libpng-1.2.41beta19.txt pngvcrd.c
|
||||
example.c libpng-1.4.0beta97.txt
|
||||
|
||||
CLEANFILES = pngout.png libpng12.pc libpng12-config libpng.vers \
|
||||
CLEANFILES = pngout.png libpng14.pc libpng14-config libpng.vers \
|
||||
libpng.sym
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
@@ -453,8 +450,8 @@ clean-libLTLIBRARIES:
|
||||
done
|
||||
libpng.la: $(libpng_la_OBJECTS) $(libpng_la_DEPENDENCIES)
|
||||
$(libpng_la_LINK) $(libpng_la_OBJECTS) $(libpng_la_LIBADD) $(LIBS)
|
||||
libpng12.la: $(libpng12_la_OBJECTS) $(libpng12_la_DEPENDENCIES)
|
||||
$(libpng12_la_LINK) -rpath $(libdir) $(libpng12_la_OBJECTS) $(libpng12_la_LIBADD) $(LIBS)
|
||||
libpng14.la: $(libpng14_la_OBJECTS) $(libpng14_la_DEPENDENCIES)
|
||||
$(libpng14_la_LINK) -rpath $(libdir) $(libpng14_la_OBJECTS) $(libpng14_la_LIBADD) $(LIBS)
|
||||
|
||||
clean-checkPROGRAMS:
|
||||
@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
@@ -508,21 +505,21 @@ mostlyclean-compile:
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-png.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngerror.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngget.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngmem.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngpread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngrio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngrtran.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngrutil.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngset.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngtrans.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngwio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngwrite.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngwtran.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng12_la-pngwutil.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-png.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngerror.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngget.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngmem.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngpread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngread.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngrio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngrtran.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngrutil.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngset.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngtrans.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngwio.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngwrite.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngwtran.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng14_la-pngwutil.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng_la-png.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng_la-pngerror.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpng_la-pngget.Plo@am__quote@
|
||||
@@ -666,110 +663,110 @@ libpng_la-pngpread.lo: pngpread.c
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
|
||||
|
||||
libpng12_la-png.lo: png.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-png.lo -MD -MP -MF $(DEPDIR)/libpng12_la-png.Tpo -c -o libpng12_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-png.Tpo $(DEPDIR)/libpng12_la-png.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='png.c' object='libpng12_la-png.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-png.lo: png.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-png.lo -MD -MP -MF $(DEPDIR)/libpng14_la-png.Tpo -c -o libpng14_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-png.Tpo $(DEPDIR)/libpng14_la-png.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='png.c' object='libpng14_la-png.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-png.lo `test -f 'png.c' || echo '$(srcdir)/'`png.c
|
||||
|
||||
libpng12_la-pngset.lo: pngset.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngset.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngset.Tpo -c -o libpng12_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngset.Tpo $(DEPDIR)/libpng12_la-pngset.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngset.c' object='libpng12_la-pngset.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngset.lo: pngset.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngset.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngset.Tpo -c -o libpng14_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngset.Tpo $(DEPDIR)/libpng14_la-pngset.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngset.c' object='libpng14_la-pngset.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngset.lo `test -f 'pngset.c' || echo '$(srcdir)/'`pngset.c
|
||||
|
||||
libpng12_la-pngget.lo: pngget.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngget.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngget.Tpo -c -o libpng12_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngget.Tpo $(DEPDIR)/libpng12_la-pngget.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngget.c' object='libpng12_la-pngget.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngget.lo: pngget.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngget.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngget.Tpo -c -o libpng14_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngget.Tpo $(DEPDIR)/libpng14_la-pngget.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngget.c' object='libpng14_la-pngget.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngget.lo `test -f 'pngget.c' || echo '$(srcdir)/'`pngget.c
|
||||
|
||||
libpng12_la-pngrutil.lo: pngrutil.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngrutil.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngrutil.Tpo -c -o libpng12_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngrutil.Tpo $(DEPDIR)/libpng12_la-pngrutil.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrutil.c' object='libpng12_la-pngrutil.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngrutil.lo: pngrutil.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngrutil.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngrutil.Tpo -c -o libpng14_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngrutil.Tpo $(DEPDIR)/libpng14_la-pngrutil.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrutil.c' object='libpng14_la-pngrutil.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngrutil.lo `test -f 'pngrutil.c' || echo '$(srcdir)/'`pngrutil.c
|
||||
|
||||
libpng12_la-pngtrans.lo: pngtrans.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngtrans.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngtrans.Tpo -c -o libpng12_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngtrans.Tpo $(DEPDIR)/libpng12_la-pngtrans.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngtrans.c' object='libpng12_la-pngtrans.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngtrans.lo: pngtrans.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngtrans.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngtrans.Tpo -c -o libpng14_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngtrans.Tpo $(DEPDIR)/libpng14_la-pngtrans.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngtrans.c' object='libpng14_la-pngtrans.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngtrans.lo `test -f 'pngtrans.c' || echo '$(srcdir)/'`pngtrans.c
|
||||
|
||||
libpng12_la-pngwutil.lo: pngwutil.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngwutil.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngwutil.Tpo -c -o libpng12_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngwutil.Tpo $(DEPDIR)/libpng12_la-pngwutil.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwutil.c' object='libpng12_la-pngwutil.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngwutil.lo: pngwutil.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngwutil.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngwutil.Tpo -c -o libpng14_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngwutil.Tpo $(DEPDIR)/libpng14_la-pngwutil.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwutil.c' object='libpng14_la-pngwutil.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngwutil.lo `test -f 'pngwutil.c' || echo '$(srcdir)/'`pngwutil.c
|
||||
|
||||
libpng12_la-pngread.lo: pngread.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngread.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngread.Tpo -c -o libpng12_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngread.Tpo $(DEPDIR)/libpng12_la-pngread.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngread.c' object='libpng12_la-pngread.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngread.lo: pngread.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngread.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngread.Tpo -c -o libpng14_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngread.Tpo $(DEPDIR)/libpng14_la-pngread.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngread.c' object='libpng14_la-pngread.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngread.lo `test -f 'pngread.c' || echo '$(srcdir)/'`pngread.c
|
||||
|
||||
libpng12_la-pngrio.lo: pngrio.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngrio.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngrio.Tpo -c -o libpng12_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngrio.Tpo $(DEPDIR)/libpng12_la-pngrio.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrio.c' object='libpng12_la-pngrio.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngrio.lo: pngrio.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngrio.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngrio.Tpo -c -o libpng14_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngrio.Tpo $(DEPDIR)/libpng14_la-pngrio.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrio.c' object='libpng14_la-pngrio.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngrio.lo `test -f 'pngrio.c' || echo '$(srcdir)/'`pngrio.c
|
||||
|
||||
libpng12_la-pngwio.lo: pngwio.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngwio.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngwio.Tpo -c -o libpng12_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngwio.Tpo $(DEPDIR)/libpng12_la-pngwio.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwio.c' object='libpng12_la-pngwio.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngwio.lo: pngwio.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngwio.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngwio.Tpo -c -o libpng14_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngwio.Tpo $(DEPDIR)/libpng14_la-pngwio.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwio.c' object='libpng14_la-pngwio.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngwio.lo `test -f 'pngwio.c' || echo '$(srcdir)/'`pngwio.c
|
||||
|
||||
libpng12_la-pngwrite.lo: pngwrite.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngwrite.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngwrite.Tpo -c -o libpng12_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngwrite.Tpo $(DEPDIR)/libpng12_la-pngwrite.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwrite.c' object='libpng12_la-pngwrite.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngwrite.lo: pngwrite.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngwrite.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngwrite.Tpo -c -o libpng14_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngwrite.Tpo $(DEPDIR)/libpng14_la-pngwrite.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwrite.c' object='libpng14_la-pngwrite.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngwrite.lo `test -f 'pngwrite.c' || echo '$(srcdir)/'`pngwrite.c
|
||||
|
||||
libpng12_la-pngrtran.lo: pngrtran.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngrtran.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngrtran.Tpo -c -o libpng12_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngrtran.Tpo $(DEPDIR)/libpng12_la-pngrtran.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrtran.c' object='libpng12_la-pngrtran.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngrtran.lo: pngrtran.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngrtran.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngrtran.Tpo -c -o libpng14_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngrtran.Tpo $(DEPDIR)/libpng14_la-pngrtran.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngrtran.c' object='libpng14_la-pngrtran.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngrtran.lo `test -f 'pngrtran.c' || echo '$(srcdir)/'`pngrtran.c
|
||||
|
||||
libpng12_la-pngwtran.lo: pngwtran.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngwtran.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngwtran.Tpo -c -o libpng12_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngwtran.Tpo $(DEPDIR)/libpng12_la-pngwtran.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwtran.c' object='libpng12_la-pngwtran.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngwtran.lo: pngwtran.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngwtran.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngwtran.Tpo -c -o libpng14_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngwtran.Tpo $(DEPDIR)/libpng14_la-pngwtran.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngwtran.c' object='libpng14_la-pngwtran.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngwtran.lo `test -f 'pngwtran.c' || echo '$(srcdir)/'`pngwtran.c
|
||||
|
||||
libpng12_la-pngmem.lo: pngmem.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngmem.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngmem.Tpo -c -o libpng12_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngmem.Tpo $(DEPDIR)/libpng12_la-pngmem.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngmem.c' object='libpng12_la-pngmem.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngmem.lo: pngmem.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngmem.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngmem.Tpo -c -o libpng14_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngmem.Tpo $(DEPDIR)/libpng14_la-pngmem.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngmem.c' object='libpng14_la-pngmem.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngmem.lo `test -f 'pngmem.c' || echo '$(srcdir)/'`pngmem.c
|
||||
|
||||
libpng12_la-pngerror.lo: pngerror.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngerror.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngerror.Tpo -c -o libpng12_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngerror.Tpo $(DEPDIR)/libpng12_la-pngerror.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngerror.c' object='libpng12_la-pngerror.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngerror.lo: pngerror.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngerror.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngerror.Tpo -c -o libpng14_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngerror.Tpo $(DEPDIR)/libpng14_la-pngerror.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngerror.c' object='libpng14_la-pngerror.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngerror.lo `test -f 'pngerror.c' || echo '$(srcdir)/'`pngerror.c
|
||||
|
||||
libpng12_la-pngpread.lo: pngpread.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng12_la-pngpread.lo -MD -MP -MF $(DEPDIR)/libpng12_la-pngpread.Tpo -c -o libpng12_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng12_la-pngpread.Tpo $(DEPDIR)/libpng12_la-pngpread.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngpread.c' object='libpng12_la-pngpread.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
libpng14_la-pngpread.lo: pngpread.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libpng14_la-pngpread.lo -MD -MP -MF $(DEPDIR)/libpng14_la-pngpread.Tpo -c -o libpng14_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
|
||||
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libpng14_la-pngpread.Tpo $(DEPDIR)/libpng14_la-pngpread.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pngpread.c' object='libpng14_la-pngpread.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng12_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng12_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libpng14_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libpng14_la-pngpread.lo `test -f 'pngpread.c' || echo '$(srcdir)/'`pngpread.c
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
@@ -1375,11 +1372,12 @@ test: check
|
||||
install-data-hook:
|
||||
cd $(DESTDIR)$(includedir); rm -f png.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/png.h png.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h pngconf.h
|
||||
cd $(DESTDIR)$(includedir); $(LN_S) $(PNGLIB_BASENAME)/pngconf.h \
|
||||
pngconf.h
|
||||
cd $(DESTDIR)$(pkgconfigdir); rm -f libpng.pc
|
||||
cd $(DESTDIR)$(pkgconfigdir); $(LN_S) $(PNGLIB_BASENAME).pc libpng.pc
|
||||
|
||||
# do evil things to libpng to cause libpng12 to be used
|
||||
# do evil things to libpng to cause libpng14 to be used
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir); rm -f libpng-config
|
||||
cd $(DESTDIR)$(bindir); $(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
||||
|
||||
53
README
53
README
@@ -1,15 +1,11 @@
|
||||
README for libpng version 1.2.41beta19 - November 11, 2009 (shared library 12.0)
|
||||
README for libpng version 1.4.0beta97 - November 13, 2009 (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.
|
||||
|
||||
Libpng comes in several distribution formats. Get libpng-*.tar.gz,
|
||||
libpng-*.tar.lzma, or libpng-*.tar.bz2 if you want UNIX-style line
|
||||
endings in the text files, or lpng*.7z or lpng*.zip if you want DOS-style
|
||||
line endings. You can get UNIX-style line endings from the *.zip file
|
||||
by using "unzip -a" but there seems to be no simple way to recover
|
||||
UNIX-style line endings from the *.7z file. The *.tar.lzma file is
|
||||
recommended for *NIX users instead.
|
||||
libpng-*.tar.xz or libpng-*.tar.bz2 if you want UNIX-style line endings
|
||||
in the text files, or lpng*.zip if you want DOS-style line endings.
|
||||
|
||||
Version 0.89 was the first official release of libpng. Don't let the
|
||||
fact that it's the first release fool you. The libpng library has been in
|
||||
@@ -58,7 +54,7 @@ to set different actions based on whether the CRC error occurred in a
|
||||
critical or an ancillary chunk.
|
||||
|
||||
The changes made to the library, and bugs fixed are based on discussions
|
||||
on the png-mng-implement mailing list
|
||||
on the PNG-implement mailing list
|
||||
and not on material submitted privately to Guy, Andreas, or Glenn. They will
|
||||
forward any good suggestions to the list.
|
||||
|
||||
@@ -81,12 +77,12 @@ compression library that is useful for more things than just PNG files.
|
||||
You can use zlib as a drop-in replacement for fread() and fwrite() if
|
||||
you are so inclined.
|
||||
|
||||
zlib should be available at the same place that libpng is, or at
|
||||
ftp://ftp.simplesystems.org/pub/png/src/
|
||||
zlib should be available at the same place that libpng is, or at.
|
||||
ftp://ftp.info-zip.org/pub/infozip/zlib
|
||||
|
||||
You may also want a copy of the PNG specification. It is available
|
||||
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
|
||||
these at http://www.libpng.org/pub/png/pngdocs.html
|
||||
these at http://www.libpng.org/pub/png/documents/
|
||||
|
||||
This code is currently being archived at libpng.sf.net in the
|
||||
[DOWNLOAD] area, and on CompuServe, Lib 20 (PNG SUPPORT)
|
||||
@@ -114,14 +110,14 @@ to subscribe) or to glennrp at users.sourceforge.net
|
||||
|
||||
You can't reach Guy, the original libpng author, at the addresses
|
||||
given in previous versions of this document. He and Andreas will read mail
|
||||
addressed to the png-mng-implement list, however.
|
||||
addressed to the png-implement list, however.
|
||||
|
||||
Please do not send general questions about PNG. Send them to
|
||||
the (png-mng-misc at lists.sourceforge.net, subscription required, visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement to subscribe)
|
||||
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-mng-implement list. I'll
|
||||
or to the png-implement list. I'll
|
||||
get them in the end anyway. If you have a question about something
|
||||
in the PNG specification that is related to using libpng, send it
|
||||
to me. Send me any questions that start with "I was using libpng,
|
||||
@@ -129,7 +125,7 @@ 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 twelve years now, and it is official and
|
||||
been discussing PNG for nine 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.
|
||||
@@ -144,7 +140,6 @@ Files in this distribution:
|
||||
TODO => Things not implemented in the current library
|
||||
Y2KINFO => Statement of Y2K compliance
|
||||
example.c => Example code for using libpng functions
|
||||
libpng-*-*-diff.txt => Diff from previous release
|
||||
libpng.3 => manual page for libpng (includes libpng.txt)
|
||||
libpng.txt => Description of libpng and its functions
|
||||
libpngpf.3 => manual page for libpng's private functions
|
||||
@@ -152,6 +147,7 @@ Files in this distribution:
|
||||
png.c => Basic interface functions common to library
|
||||
png.h => Library function and interface declarations
|
||||
pngconf.h => System specific library configuration
|
||||
pngasmrd.h => Header file for assembler-coded functions
|
||||
pngerror.c => Error/warning message I/O functions
|
||||
pngget.c => Functions for retrieving info from struct
|
||||
pngmem.c => Memory handling functions
|
||||
@@ -184,21 +180,15 @@ Files in this distribution:
|
||||
and zlib
|
||||
visualc6 => Contains a Microsoft Visual C++ (MSVC) workspace
|
||||
for building libpng and zlib
|
||||
netware.txt => Contains instructions for downloading a set of
|
||||
project files for building libpng and zlib on
|
||||
Netware.
|
||||
wince.txt => Contains instructions for downloading a Microsoft
|
||||
Visual C++ (Windows CD Toolkit) workspace for
|
||||
building libpng and zlib on WindowsCE
|
||||
scripts => Directory containing scripts for building libpng:
|
||||
descrip.mms => VMS makefile for MMS or MMK
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.gcmmx => Linux/ELF makefile
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19,
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97,
|
||||
uses assembler code tuned for Intel MMX platform)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
@@ -214,18 +204,17 @@ Files in this distribution:
|
||||
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit
|
||||
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
|
||||
makefile.intel => Intel C/C++ version 4.0 and later
|
||||
libpng.icc => Project file, IBM VisualAge/C++ 4.0 or later
|
||||
makefile.netbsd => NetBSD/cc makefile, PNGGCCRD, makes libpng.so.
|
||||
makefile.ne12bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng12.so
|
||||
makefile.ne14bsd => NetBSD/cc makefile, PNGGCCRD, makes libpng14.so
|
||||
makefile.openbsd => OpenBSD makefile
|
||||
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
|
||||
makefile.sggcc => Silicon Graphics
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.solaris => Solaris 2.X makefile
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
makefile.so9 => Solaris 9 makefile
|
||||
(gcc, creates libpng12.so.0.1.2.41beta19)
|
||||
(gcc, creates libpng14.so.14.1.4.0beta97)
|
||||
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
|
||||
@@ -260,7 +249,7 @@ Good luck, and happy coding.
|
||||
|
||||
-Andreas Eric Dilger (former maintainer, 1996-1997)
|
||||
Internet: adilger at enel.ucalgary.ca
|
||||
Web: http://members.shaw.ca/adilger/
|
||||
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
|
||||
|
||||
-Guy Eric Schalnat (original author and former maintainer, 1995-1996)
|
||||
(formerly of Group 42, Inc)
|
||||
|
||||
8
TODO
8
TODO
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
TODO - list of things to do for libpng:
|
||||
|
||||
Final bug fixes.
|
||||
@@ -17,9 +18,14 @@ Better filter selection
|
||||
(counting huffman bits/precompression? filter inertia? filter costs?).
|
||||
Histogram creation.
|
||||
Text conversion between different code pages (Latin-1 -> Mac and DOS).
|
||||
Should we always malloc 2^bit_depth PLTE/tRNS/hIST entries for safety?
|
||||
Build gamma tables using fixed point (and do away with floating point entirely).
|
||||
Avoid building gamma tables whenever possible.
|
||||
Use greater precision when changing to linear gamma for compositing against
|
||||
background and doing rgb-to-gray transformation.
|
||||
Investigate pre-incremented loop counters and other loop constructions.
|
||||
Add interpolated method of handling interlacing.
|
||||
Provide for conditional compilation of 16-bit support (except for the
|
||||
initial stripping down to 8-bits when reading a 16-bit PNG datastream).
|
||||
Switch to the simpler zlib (zlib/libpng) license if legally possible.
|
||||
|
||||
*/
|
||||
|
||||
55
Y2KINFO
55
Y2KINFO
@@ -1,55 +0,0 @@
|
||||
Y2K compliance in libpng:
|
||||
=========================
|
||||
|
||||
November 11, 2009
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.2.41beta19 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 will hold years up to 65535. The other two hold the date in text
|
||||
format, and will hold years up to 9999.
|
||||
|
||||
The integer is
|
||||
"png_uint_16 year" in png_time_struct.
|
||||
|
||||
The strings are
|
||||
"png_charp time_buffer" in png_struct and
|
||||
"near_time_buffer", which is a local character string in png.c.
|
||||
|
||||
There are seven time-related functions:
|
||||
|
||||
png_convert_to_rfc_1123() in png.c
|
||||
(formerly png_convert_to_rfc_1152() in error)
|
||||
png_convert_from_struct_tm() in pngwrite.c, called in pngwrite.c
|
||||
png_convert_from_time_t() in pngwrite.c
|
||||
png_get_tIME() in pngget.c
|
||||
png_handle_tIME() in pngrutil.c, called in pngread.c
|
||||
png_set_tIME() in pngset.c
|
||||
png_write_tIME() in pngwutil.c, called in pngwrite.c
|
||||
|
||||
All appear to handle dates properly in a Y2K environment. The
|
||||
png_convert_from_time_t() function calls gmtime() to convert from system
|
||||
clock time, which returns (year - 1900), which we properly convert to
|
||||
the full 4-digit year. There is a possibility that applications using
|
||||
libpng are not passing 4-digit years into the png_convert_to_rfc_1123()
|
||||
function, or that they are incorrectly passing only a 2-digit year
|
||||
instead of "year - 1900" into the png_convert_from_struct_tm() function,
|
||||
but this is not under our control. The libpng documentation has always
|
||||
stated that it works with 4-digit years, and the APIs have been
|
||||
documented as such.
|
||||
|
||||
The tIME chunk itself is also Y2K compliant. It uses a 2-byte unsigned
|
||||
integer to hold the year, and can hold years as large as 65535.
|
||||
|
||||
zlib, upon which libpng depends, is also Y2K compliant. It contains
|
||||
no date-related code.
|
||||
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
libpng maintainer
|
||||
PNG Development Group
|
||||
81
configure
vendored
81
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.64 for libpng 1.2.41beta19.
|
||||
# Generated by GNU Autoconf 2.64 for libpng 1.4.0beta97.
|
||||
#
|
||||
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
|
||||
#
|
||||
@@ -698,8 +698,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='libpng'
|
||||
PACKAGE_TARNAME='libpng'
|
||||
PACKAGE_VERSION='1.2.41beta19'
|
||||
PACKAGE_STRING='libpng 1.2.41beta19'
|
||||
PACKAGE_VERSION='1.4.0beta97'
|
||||
PACKAGE_STRING='libpng 1.4.0beta97'
|
||||
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -753,7 +753,6 @@ PNGLIB_VERSION
|
||||
SYMBOL_PREFIX
|
||||
HAVE_LD_VERSION_SCRIPT_FALSE
|
||||
HAVE_LD_VERSION_SCRIPT_TRUE
|
||||
LIBPNG_NO_MMX
|
||||
LIBPNG_DEFINES
|
||||
LIBOBJS
|
||||
POW_LIB
|
||||
@@ -1432,7 +1431,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures libpng 1.2.41beta19 to adapt to many kinds of systems.
|
||||
\`configure' configures libpng 1.4.0beta97 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1502,7 +1501,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of libpng 1.2.41beta19:";;
|
||||
short | recursive ) echo "Configuration of libpng 1.4.0beta97:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1609,7 +1608,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
libpng configure 1.2.41beta19
|
||||
libpng configure 1.4.0beta97
|
||||
generated by GNU Autoconf 2.64
|
||||
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
@@ -2034,7 +2033,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by libpng $as_me 1.2.41beta19, which was
|
||||
It was created by libpng $as_me 1.4.0beta97, which was
|
||||
generated by GNU Autoconf 2.64. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2842,7 +2841,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='libpng'
|
||||
VERSION='1.2.41beta19'
|
||||
VERSION='1.4.0beta97'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -2906,10 +2905,10 @@ fi
|
||||
|
||||
|
||||
|
||||
PNGLIB_VERSION=1.2.41beta19
|
||||
PNGLIB_VERSION=1.4.0beta97
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=2
|
||||
PNGLIB_RELEASE=41
|
||||
PNGLIB_MINOR=4
|
||||
PNGLIB_RELEASE=0
|
||||
|
||||
|
||||
|
||||
@@ -5128,13 +5127,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
|
||||
else
|
||||
lt_cv_nm_interface="BSD nm"
|
||||
echo "int some_variable = 0;" > conftest.$ac_ext
|
||||
(eval echo "\"\$as_me:5131: $ac_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:5130: $ac_compile\"" >&5)
|
||||
(eval "$ac_compile" 2>conftest.err)
|
||||
cat conftest.err >&5
|
||||
(eval echo "\"\$as_me:5134: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
||||
(eval echo "\"\$as_me:5133: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
|
||||
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
|
||||
cat conftest.err >&5
|
||||
(eval echo "\"\$as_me:5137: output\"" >&5)
|
||||
(eval echo "\"\$as_me:5136: output\"" >&5)
|
||||
cat conftest.out >&5
|
||||
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
|
||||
lt_cv_nm_interface="MS dumpbin"
|
||||
@@ -6326,7 +6325,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 6329 "configure"' > conftest.$ac_ext
|
||||
echo '#line 6328 "configure"' > conftest.$ac_ext
|
||||
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@@ -7713,11 +7712,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:7716: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:7715: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:7720: \$? = $ac_status" >&5
|
||||
echo "$as_me:7719: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -8052,11 +8051,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:8055: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:8054: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:8059: \$? = $ac_status" >&5
|
||||
echo "$as_me:8058: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings other than the usual output.
|
||||
@@ -8157,11 +8156,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:8160: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:8159: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:8164: \$? = $ac_status" >&5
|
||||
echo "$as_me:8163: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -8212,11 +8211,11 @@ else
|
||||
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:8215: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:8214: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:8219: \$? = $ac_status" >&5
|
||||
echo "$as_me:8218: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@@ -10579,7 +10578,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 10582 "configure"
|
||||
#line 10581 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -10675,7 +10674,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 10678 "configure"
|
||||
#line 10677 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@@ -11394,31 +11393,7 @@ fi
|
||||
|
||||
|
||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE" >&5
|
||||
$as_echo_n "checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include "$srcdir/pnggccrd.c"
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return 0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
LIBPNG_NO_MMX=""
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
|
||||
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libraries can be versioned" >&5
|
||||
@@ -12047,7 +12022,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by libpng $as_me 1.2.41beta19, which was
|
||||
This file was extended by libpng $as_me 1.4.0beta97, which was
|
||||
generated by GNU Autoconf 2.64. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -12111,7 +12086,7 @@ Report bugs to <png-mng-implement@lists.sourceforge.net>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_version="\\
|
||||
libpng config.status 1.2.41beta19
|
||||
libpng config.status 1.4.0beta97
|
||||
configured by $0, generated by GNU Autoconf 2.64,
|
||||
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
20
configure.ac
20
configure.ac
@@ -18,15 +18,15 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.2.41beta19], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.4.0beta97], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.2.41beta19
|
||||
PNGLIB_VERSION=1.4.0beta97
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=2
|
||||
PNGLIB_RELEASE=41
|
||||
PNGLIB_MINOR=4
|
||||
PNGLIB_RELEASE=0
|
||||
|
||||
dnl End of version number stuff
|
||||
|
||||
@@ -60,18 +60,8 @@ AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
||||
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
|
||||
|
||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||
AC_MSG_CHECKING(
|
||||
[if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE])
|
||||
AC_TRY_COMPILE(
|
||||
[#include "$srcdir/pnggccrd.c"],
|
||||
[return 0;],
|
||||
AC_MSG_RESULT(yes)
|
||||
LIBPNG_NO_MMX="",
|
||||
AC_MSG_RESULT(no)
|
||||
LIBPNG_NO_MMX=-DPNG_NO_MMX_CODE)
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES\ $LIBPNG_NO_MMX
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES
|
||||
AC_SUBST(LIBPNG_DEFINES)
|
||||
AC_SUBST(LIBPNG_NO_MMX)
|
||||
|
||||
AC_MSG_CHECKING([if libraries can be versioned])
|
||||
GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
PNGINC = -I/usr/local/include/libpng12
|
||||
PNGLIB = -L/usr/local/lib -lpng12 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng12.a # statically linked against libpng
|
||||
PNGINC = -I/usr/local/include/libpng14
|
||||
PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng
|
||||
#PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng
|
||||
# or:
|
||||
#PNGINC = -I../..
|
||||
#PNGLIB = -L../.. -lpng
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
# macros --------------------------------------------------------------------
|
||||
|
||||
#PNGDIR = /usr/local/lib
|
||||
#PNGINC = -I/usr/local/include/libpng12
|
||||
#PNGLIBd = -L$(PNGDIR) -lpng12 # dynamically linked, installed libpng
|
||||
#PNGLIBs = $(PNGDIR)/libpng12.a # statically linked, installed libpng
|
||||
#PNGINC = -I/usr/local/include/libpng14
|
||||
#PNGLIBd = -L$(PNGDIR) -lpng14 # dynamically linked, installed libpng
|
||||
#PNGLIBs = $(PNGDIR)/libpng14.a # statically linked, installed libpng
|
||||
# or:
|
||||
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
|
||||
#PNGDIR = ../libpng
|
||||
PNGINC = -I$(PNGDIR)
|
||||
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng12 # dynamically linked
|
||||
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng14 # dynamically linked
|
||||
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
|
||||
|
||||
ZDIR = /usr/local/lib
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
cp ../../pngminus/png2pnm.c pngm2pnm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm pnggccrd.c pngvcrd.c
|
||||
rm example.c pngtest.c pngpread.c pngw*.c
|
||||
# change the following 2 lines if zlib is somewhere else
|
||||
cp ../../../../zlib/*.h .
|
||||
|
||||
@@ -25,7 +25,7 @@ OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
/* No 16-bit support beyond reading with strip_16 */
|
||||
#endif
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
@@ -25,8 +23,6 @@
|
||||
#define png_error(s1,s2) png_err(s1)
|
||||
#define png_chunk_error(s1,s2) png_err(s1)
|
||||
|
||||
#define PNG_NO_ASSEMBLER_CODE
|
||||
#define PNG_NO_OPTIMIZED_CODE
|
||||
#define PNG_NO_READ_GAMMA
|
||||
#define PNG_NO_READ_BACKGROUND
|
||||
#define PNG_NO_READ_DITHER
|
||||
@@ -59,7 +55,6 @@
|
||||
#define PNG_NO_READ_OPT_PLTE
|
||||
#define PNG_NO_READ_STRIP_ALPHA
|
||||
#define PNG_NO_READ_oFFs
|
||||
#define PNG_NO_WARN_UNINITIALIZED_ROW
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
cp ../../pngminus/pnm2png.c pnm2pngm.c
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm pnggccrd.c pngvcrd.c
|
||||
rm example.c pngtest.c pngr*.c pngpread.c
|
||||
# Change the next 2 lines if zlib is somewhere else.
|
||||
cp ../../../../zlib/*.h .
|
||||
|
||||
@@ -24,7 +24,7 @@ OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h pngusr.h zlib.h
|
||||
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef MINWRPNGCONF_H
|
||||
#define MINWRPNGCONF_H
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_READ_SUPPORTED
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
|
||||
@@ -2,7 +2,6 @@ cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] .
|
||||
cp ../../gregbook/COPYING ../../gregbook/LICENSE .
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm pnggccrd.c pngvcrd.c
|
||||
rm example.c pngtest.c pngw*.c
|
||||
# change the following 2 lines if zlib is somewhere else
|
||||
cp ../../../../zlib/*.h .
|
||||
|
||||
@@ -41,7 +41,7 @@ OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h readpng2.h pngusr.h zlib.h
|
||||
.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#ifndef MINPRDPNGCONF_H
|
||||
#define MINPRDPNGCONF_H
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
@@ -21,8 +19,6 @@
|
||||
#define png_error(s1,s2) png_err(s1)
|
||||
#define png_chunk_error(s1,s2) png_err(s1)
|
||||
|
||||
#define PNG_NO_ASSEMBLER_CODE
|
||||
#define PNG_NO_OPTIMIZED_CODE
|
||||
#define PNG_NO_READ_DITHER
|
||||
#define PNG_NO_READ_INVERT
|
||||
#define PNG_NO_READ_SHIFT
|
||||
@@ -50,7 +46,6 @@
|
||||
#define PNG_NO_READ_OPT_PLTE
|
||||
#define PNG_NO_READ_STRIP_ALPHA
|
||||
#define PNG_NO_READ_oFFs
|
||||
#define PNG_NO_WARN_UNINITIALIZED_ROW
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
|
||||
@@ -211,8 +211,8 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
|
||||
if (ret != 8)
|
||||
return FALSE;
|
||||
|
||||
ret = !png_sig_cmp (buf, 0, 8);
|
||||
if (!ret)
|
||||
ret = png_sig_cmp (buf, 0, 8);
|
||||
if (ret)
|
||||
return FALSE;
|
||||
|
||||
/* create png and info structures */
|
||||
|
||||
@@ -35,7 +35,7 @@ png_cexcept_error(png_structp png_ptr, png_const_charp msg)
|
||||
{
|
||||
if(png_ptr)
|
||||
;
|
||||
#ifndef PNG_NO_CONSOLE_IO
|
||||
#ifdef PNG_CONSOLE_IO_SUPPORTED
|
||||
fprintf(stderr, "libpng error: %s\n", msg);
|
||||
#endif
|
||||
{
|
||||
@@ -155,7 +155,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
|
||||
// initialize the png structure
|
||||
|
||||
#if !defined(PNG_NO_STDIO)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
png_init_io(png_ptr, pfFile);
|
||||
#else
|
||||
png_set_read_fn(png_ptr, (png_voidp)pfFile, png_read_data);
|
||||
@@ -324,7 +324,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
|
||||
{
|
||||
// initialize the png structure
|
||||
|
||||
#if !defined(PNG_NO_STDIO)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
png_init_io(png_ptr, pfFile);
|
||||
#else
|
||||
png_set_write_fn(png_ptr, (png_voidp)pfFile, png_write_data, png_flush);
|
||||
@@ -395,7 +395,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef PNG_NO_STDIO
|
||||
#ifndef PNG_STDIO_SUPPORTED
|
||||
|
||||
static void
|
||||
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
|
||||
@@ -22,7 +22,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
|
||||
BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
|
||||
int iWidth, int iHeight, png_color BkgColor);
|
||||
|
||||
#if defined(PNG_NO_STDIO)
|
||||
#ifndef PNG_STDIO_SUPPORTED
|
||||
static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
|
||||
static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
|
||||
static void png_flush(png_structp png_ptr);
|
||||
|
||||
@@ -43,9 +43,9 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
|
||||
# ADD BASE CPP /nologo /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_NO_STDIO" /FD /c
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_NO_STDIO" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -77,9 +77,9 @@ PostBuild_Cmds=$(outdir)\VisualPng.exe ..\..\contrib\pngsuite\basn6a16.png
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
|
||||
# ADD BASE CPP /nologo /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_NO_STDIO" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_NO_STDIO" /D "PNG_NO_GLOBAL_ARRAYS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "PNG_NO_STDIO" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
|
||||
30
example.c
30
example.c
@@ -2,7 +2,7 @@
|
||||
#if 0 /* in case someone actually tries to compile this */
|
||||
|
||||
/* example.c - an example of using libpng
|
||||
* Last changed in libpng 1.2.37 [June 4, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* This file has been placed in the public domain by the authors.
|
||||
* Maintained 1998-2009 Glenn Randers-Pehrson
|
||||
* Maintained 1996, 1997 Andreas Dilger)
|
||||
@@ -121,7 +121,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
if (info_ptr == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
|
||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
if (setjmp(png_jmpbuf(png_ptr)))
|
||||
{
|
||||
/* Free all of the memory associated with the png_ptr and info_ptr */
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
fclose(fp);
|
||||
/* If we get here, we had a problem reading the file */
|
||||
return (ERROR);
|
||||
@@ -164,7 +164,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
* adjustment), then you can read the entire image (including
|
||||
* pixels) into the info structure with this call:
|
||||
*/
|
||||
png_read_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
|
||||
png_read_png(png_ptr, info_ptr, png_transforms, NULL);
|
||||
|
||||
#else
|
||||
/* OK, you're doing it the hard way, with the lower-level functions */
|
||||
@@ -175,7 +175,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
|
||||
&interlace_type, int_p_NULL, int_p_NULL);
|
||||
&interlace_type, NULL, NULL);
|
||||
|
||||
/* Set up the data transformations you want. Note that these are all
|
||||
* optional. Only call them if you want/need them. Many of the
|
||||
@@ -286,7 +286,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
png_color std_color_cube[MAX_SCREEN_COLORS];
|
||||
|
||||
png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
|
||||
MAX_SCREEN_COLORS, png_uint_16p_NULL, 0);
|
||||
MAX_SCREEN_COLORS, NULL, 0);
|
||||
}
|
||||
/* This reduces the image to the palette supplied in the file */
|
||||
else if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette))
|
||||
@@ -365,17 +365,17 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
#ifdef single /* Read the image a single row at a time */
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL, 1);
|
||||
png_read_rows(png_ptr, &row_pointers[y], NULL, 1);
|
||||
}
|
||||
|
||||
#else no_single /* Read the image several rows at a time */
|
||||
for (y = 0; y < height; y += number_of_rows)
|
||||
{
|
||||
#ifdef sparkle /* Read the image using the "sparkle" effect. */
|
||||
png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL,
|
||||
png_read_rows(png_ptr, &row_pointers[y], NULL,
|
||||
number_of_rows);
|
||||
#else no_sparkle /* Read the image using the "rectangle" effect */
|
||||
png_read_rows(png_ptr, png_bytepp_NULL, &row_pointers[y],
|
||||
png_read_rows(png_ptr, NULL, &row_pointers[y],
|
||||
number_of_rows);
|
||||
#endif no_sparkle /* Use only one of these two methods */
|
||||
}
|
||||
@@ -392,7 +392,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
|
||||
/* At this point you have read the entire image */
|
||||
|
||||
/* Clean up after the read, and free any memory allocated - REQUIRED */
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
|
||||
/* Close the file */
|
||||
fclose(fp);
|
||||
@@ -425,13 +425,13 @@ initialize_png_reader(png_structp *png_ptr, png_infop *info_ptr)
|
||||
|
||||
if (*info_ptr == NULL)
|
||||
{
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
if (setjmp(png_jmpbuf((*png_ptr))))
|
||||
{
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ process_data(png_structp *png_ptr, png_infop *info_ptr,
|
||||
if (setjmp(png_jmpbuf((*png_ptr))))
|
||||
{
|
||||
/* Free the png_ptr and info_ptr memory on error */
|
||||
png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
|
||||
png_destroy_read_struct(png_ptr, info_ptr, NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -593,7 +593,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
||||
if (info_ptr == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
png_destroy_write_struct(&png_ptr, png_infopp_NULL);
|
||||
png_destroy_write_struct(&png_ptr, NULL);
|
||||
return (ERROR);
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ void write_png(char *file_name /* , ... other image information ... */)
|
||||
* image info living in the structure. You could "|" many
|
||||
* PNG_TRANSFORM flags into the png_transforms integer here.
|
||||
*/
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
|
||||
png_write_png(png_ptr, info_ptr, png_transforms, NULL);
|
||||
|
||||
#else
|
||||
/* This is the hard way */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.2.41beta19 - November 12, 2009
|
||||
libpng version 1.4.0beta97 - November 13, 2009
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
@@ -11,7 +11,7 @@ libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.2.41beta19 - November 12, 2009
|
||||
libpng versions 0.97, January 1998, through 1.4.0beta97 - November 13, 2009
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
|
||||
@@ -649,11 +649,11 @@ pointer into the info_ptr is returned for any complex types.
|
||||
whichever are appropriate for the
|
||||
given color type (png_color_16)
|
||||
|
||||
png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans,
|
||||
&trans_values);
|
||||
trans - array of transparent
|
||||
png_get_tRNS(png_ptr, info_ptr, &trans_alpha,
|
||||
&num_trans, &trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
trans_values - graylevel or color sample values of
|
||||
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
|
||||
@@ -878,7 +878,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.2.41beta19, not all possible expansions are supported.
|
||||
As of libpng version 1.4.0beta97, 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
|
||||
@@ -1147,40 +1147,6 @@ recommended that PNG viewers support gamma correction.
|
||||
else
|
||||
png_set_gamma(png_ptr, screen_gamma, 0.45455);
|
||||
|
||||
If you need to reduce an RGB file to a paletted file, or if a paletted
|
||||
file has more entries then will fit on your screen, png_set_dither()
|
||||
will do that. Note that this is a simple match dither that merely
|
||||
finds the closest color available. This should work fairly well with
|
||||
optimized palettes, and fairly badly with linear color cubes. If you
|
||||
pass a palette that is larger then maximum_colors, the file will
|
||||
reduce the number of colors in the palette so it will fit into
|
||||
maximum_colors. If there is a histogram, it will use it to make
|
||||
more intelligent choices when reducing the palette. If there is no
|
||||
histogram, it may not do as good a job.
|
||||
|
||||
if (color_type & PNG_COLOR_MASK_COLOR)
|
||||
{
|
||||
if (png_get_valid(png_ptr, info_ptr,
|
||||
PNG_INFO_PLTE))
|
||||
{
|
||||
png_uint_16p histogram = NULL;
|
||||
|
||||
png_get_hIST(png_ptr, info_ptr,
|
||||
&histogram);
|
||||
png_set_dither(png_ptr, palette, num_palette,
|
||||
max_screen_colors, histogram, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
png_color std_color_cube[MAX_SCREEN_COLORS] =
|
||||
{ ... colors ... };
|
||||
|
||||
png_set_dither(png_ptr, std_color_cube,
|
||||
MAX_SCREEN_COLORS, MAX_SCREEN_COLORS,
|
||||
NULL,0);
|
||||
}
|
||||
}
|
||||
|
||||
PNG files describe monochrome as black being zero and white being one.
|
||||
The following code will reverse this (make black be one and white be
|
||||
zero):
|
||||
@@ -1928,11 +1894,11 @@ width, height, bit_depth, and color_type must be the same in each call.
|
||||
appropriate for the given color type
|
||||
(png_color_16)
|
||||
|
||||
png_set_tRNS(png_ptr, info_ptr, trans, num_trans,
|
||||
trans_values);
|
||||
trans - array of transparent
|
||||
png_set_tRNS(png_ptr, info_ptr, trans_alpha,
|
||||
num_trans, trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
trans_values - graylevel or color sample values
|
||||
trans_color - graylevel or color sample values
|
||||
(in order red, green, blue) of the
|
||||
single transparent color for
|
||||
non-paletted images (PNG_INFO_tRNS)
|
||||
@@ -2673,10 +2639,10 @@ Configuring for compiler xxx:
|
||||
|
||||
All includes for libpng are in pngconf.h. If you need to add, change
|
||||
or delete an include, this is the place to do it.
|
||||
The includes that are not needed outside libpng are protected by the
|
||||
PNG_INTERNAL definition, which is only defined for those routines inside
|
||||
libpng itself. The files in libpng proper only include png.h, which
|
||||
includes pngconf.h.
|
||||
The includes that are not needed outside libpng are placed in pngpriv.h,
|
||||
which is only used by the routines inside libpng itself.
|
||||
The files in libpng proper only include pngpriv.h and png.h, which
|
||||
in turn includes pngconf.h.
|
||||
|
||||
Configuring zlib:
|
||||
|
||||
@@ -3037,7 +3003,92 @@ The function
|
||||
which also expands tRNS to alpha was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8()
|
||||
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
|
||||
IX. (Omitted)
|
||||
IX. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
|
||||
|
||||
Private libpng prototypes and macro definitions were moved from
|
||||
png.h and pngconf.h into a new pngpriv.h header file.
|
||||
|
||||
Support for global arrays was removed.
|
||||
|
||||
Some obsolete/deprecated macros and functions have been removed.
|
||||
|
||||
The obsolete, unused pnggccrd.c and pngvcrd.files were removed.
|
||||
|
||||
The PNG_1_0_X and PNG_1_2_X macros were eliminated.
|
||||
|
||||
Functions png_set_benign_errors(), png_benign_error(), and
|
||||
png_chunk_benign_error() were added.
|
||||
|
||||
Support for setting the maximum amount of memory that the application
|
||||
will allocate for reading chunks was added, as a security measure.
|
||||
The functions png_set_chunk_cache_max() and png_get_chunk_cache_max()
|
||||
were added to the library.
|
||||
|
||||
We implemented support for I/O states by adding png_ptr member io_state
|
||||
and functions png_get_io_chunk_name() and png_get_io_state() in pngget.c
|
||||
|
||||
The png_calloc() function was added and is used in place of
|
||||
of "png_malloc(); png_memset();" except in the case in png_read_png()
|
||||
where the array consists of pointers; in this case a "for" loop is used
|
||||
after the png_malloc() to set the pointers to NULL.
|
||||
|
||||
We added PNG_TRANSFORM_GRAY_TO_RGB to the available high-level
|
||||
input transforms.
|
||||
|
||||
We added the png_set_premultiply_alpha and
|
||||
png_do_read_premultiply_alpha() functions.
|
||||
|
||||
The call to png_do_chop() in pngrtran.c, which reduces 16-bit input
|
||||
files to 8-bit bit depth, was relocated ahead of the building
|
||||
of gamma tables. This allows us to build 8-bit tables instead
|
||||
of 16-bit tables, when only 8-bit tables are needed. This avoids
|
||||
wasting some computing resources when the application has called
|
||||
the png_set_strip_16() function and encounters a 16-bit PNG file.
|
||||
|
||||
Checking for and reporting of errors in the IHDR chunk is more thorough.
|
||||
|
||||
The PNG_LEGACY_SUPPORTED macro was eliminated.
|
||||
|
||||
Many WIN32_WCE #ifdefs were removed.
|
||||
|
||||
The functions png_read_init(info_ptr), png_write_init(info_ptr),
|
||||
png_info_init(info_ptr), png_read_destroy(), and png_write_destroy()
|
||||
have been removed. They have been deprecated since libpng-0.95.
|
||||
|
||||
Support for numbered error messages was removed by default, since we
|
||||
never got around to actually numbering the error messages. The function
|
||||
png_set_strip_error_numbers() was removed from the library by default.
|
||||
|
||||
The png_permit_empty_plte() was removed. It has been deprecated
|
||||
since libpng-1.0.9. Use png_permit_mng_features() instead.
|
||||
|
||||
We removed the obsolete stub functions png_get_mmx_flagmask(),
|
||||
png_set_mmx_thresholds(), png_get_asm_flags(),
|
||||
png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(),
|
||||
png_set_asm_flags(), and png_mmx_supported()
|
||||
|
||||
We removed the png_check_sig(), png_memcpy_check(), and
|
||||
png_memset_check() functions.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
png_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
|
||||
We changed the prototypes of png_get_compression_buffer_size() and
|
||||
png_set_compression_buffer_size() to work with png_size_t instead of
|
||||
png_uint_32.
|
||||
|
||||
The png_zalloc() function no longer zeroes out the memory that it
|
||||
allocates.
|
||||
|
||||
The png_zalloc() and png_zfree() functions are no longer exported.
|
||||
|
||||
We removed the trailing '.' from the warning and error messages.
|
||||
|
||||
The png_struct and info_struct members "trans" and "trans_values" were
|
||||
changed to "trans_alpha" and "trans_color", respectively.
|
||||
|
||||
X. Detecting libpng
|
||||
|
||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||
@@ -3146,7 +3197,7 @@ We mark all non-exported functions with "/* PRIVATE */"":
|
||||
|
||||
The prototypes for non-exported functions (except for those in
|
||||
pngtest) appear in
|
||||
the PNG_INTERNAL section of png.h
|
||||
pngpriv.h
|
||||
above the comment that says
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
@@ -3174,13 +3225,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
XIII. Y2K Compliance in libpng
|
||||
|
||||
November 12, 2009
|
||||
November 13, 2009
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.2.41beta19 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.0beta97 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
|
||||
415
libpng.3
415
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "November 12, 2009"
|
||||
.TH LIBPNG 3 "November 13, 2009"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta97
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@@ -12,7 +12,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_check_sig (png_bytep \fP\fIsig\fP\fB, int \fInum\fP\fB);\fP
|
||||
\fBvoid png_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_chunk_benign_error (png_structp \fP\fIpng_ptr\fP\fB, png_const_charp \fIerror\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -56,18 +60,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_destroy_info_struct (png_structp \fP\fIpng_ptr\fP\fB, png_infopp \fIinfo_ptr_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -120,10 +112,18 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_chunk_cache_max (png_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_uint_32 png_get_compression_buffer_size (png_structp \fIpng_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
|
||||
|
||||
\fI\fB
|
||||
@@ -262,11 +262,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\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_values\fP\fB);\fP
|
||||
\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
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fB#if \fI!defined(PNG_1_0_X)
|
||||
\fB/* This function is really an inline macro. \fI*/
|
||||
|
||||
\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP
|
||||
|
||||
@@ -276,9 +276,9 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP
|
||||
\fB/* This function is really an inline macro. \fI*/
|
||||
|
||||
\fI\fB#endif
|
||||
\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -330,10 +330,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_handle_as_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -342,19 +338,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_info_init (png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_alloc_size_t \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_info_init_2 (png_infopp \fP\fIptr_ptr\fP\fB, png_size_t \fIpng_info_struct_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_malloc (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_malloc_default(png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \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
|
||||
|
||||
@@ -362,22 +350,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_memcpy_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, png_voidp \fP\fIs2\fP\fB, png_uint_32 \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
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_voidp png_memset_check (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIs1\fP\fB, int \fP\fIvalue\fP\fB, png_uint_32 \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_permit_empty_plte (png_structp \fP\fIpng_ptr\fP\fB, int \fIempty_plte_permitted\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_process_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -386,10 +362,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -398,14 +370,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_read_init (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_read_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -466,6 +430,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_chunk_cache_max (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIuser_chunk_cache_max\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_compression_level (png_structp \fP\fIpng_ptr\fP\fB, int \fIlevel\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -602,6 +570,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_premultiply_alpha (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_set_progressive_read_fn (png_structp \fP\fIpng_ptr\fP\fB, png_voidp \fP\fIprogressive_ptr\fP\fB, png_progressive_info_ptr \fP\fIinfo_fn\fP\fB, png_progressive_row_ptr \fP\fIrow_fn\fP\fB, png_progressive_end_ptr \fIend_fn\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -686,7 +658,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\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_values\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\fP\fB, int \fP\fInum_trans\fP\fB, png_color_16p \fItrans_color\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -758,10 +730,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -774,14 +742,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_write_init (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBDEPRECATED: void png_write_init_2 (png_structpp \fP\fIptr_ptr\fP\fB, png_const_charp \fP\fIuser_png_ver\fP\fB, png_size_t \fP\fIpng_struct_size\fP\fB, png_size_t \fIpng_info_size\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -802,6 +762,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -821,7 +785,7 @@ Following is a copy of the libpng.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.2.41beta19 - November 12, 2009
|
||||
libpng version 1.4.0beta97 - November 13, 2009
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
@@ -832,7 +796,7 @@ libpng.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.2.41beta19 - November 12, 2009
|
||||
libpng versions 0.97, January 1998, through 1.4.0beta97 - November 13, 2009
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson
|
||||
|
||||
@@ -1470,11 +1434,11 @@ pointer into the info_ptr is returned for any complex types.
|
||||
whichever are appropriate for the
|
||||
given color type (png_color_16)
|
||||
|
||||
png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans,
|
||||
&trans_values);
|
||||
trans - array of transparent
|
||||
png_get_tRNS(png_ptr, info_ptr, &trans_alpha,
|
||||
&num_trans, &trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
trans_values - graylevel or color sample values of
|
||||
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
|
||||
@@ -1699,7 +1663,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.2.41beta19, not all possible expansions are supported.
|
||||
As of libpng version 1.4.0beta97, 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
|
||||
@@ -1968,40 +1932,6 @@ recommended that PNG viewers support gamma correction.
|
||||
else
|
||||
png_set_gamma(png_ptr, screen_gamma, 0.45455);
|
||||
|
||||
If you need to reduce an RGB file to a paletted file, or if a paletted
|
||||
file has more entries then will fit on your screen, png_set_dither()
|
||||
will do that. Note that this is a simple match dither that merely
|
||||
finds the closest color available. This should work fairly well with
|
||||
optimized palettes, and fairly badly with linear color cubes. If you
|
||||
pass a palette that is larger then maximum_colors, the file will
|
||||
reduce the number of colors in the palette so it will fit into
|
||||
maximum_colors. If there is a histogram, it will use it to make
|
||||
more intelligent choices when reducing the palette. If there is no
|
||||
histogram, it may not do as good a job.
|
||||
|
||||
if (color_type & PNG_COLOR_MASK_COLOR)
|
||||
{
|
||||
if (png_get_valid(png_ptr, info_ptr,
|
||||
PNG_INFO_PLTE))
|
||||
{
|
||||
png_uint_16p histogram = NULL;
|
||||
|
||||
png_get_hIST(png_ptr, info_ptr,
|
||||
&histogram);
|
||||
png_set_dither(png_ptr, palette, num_palette,
|
||||
max_screen_colors, histogram, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
png_color std_color_cube[MAX_SCREEN_COLORS] =
|
||||
{ ... colors ... };
|
||||
|
||||
png_set_dither(png_ptr, std_color_cube,
|
||||
MAX_SCREEN_COLORS, MAX_SCREEN_COLORS,
|
||||
NULL,0);
|
||||
}
|
||||
}
|
||||
|
||||
PNG files describe monochrome as black being zero and white being one.
|
||||
The following code will reverse this (make black be one and white be
|
||||
zero):
|
||||
@@ -2749,11 +2679,11 @@ width, height, bit_depth, and color_type must be the same in each call.
|
||||
appropriate for the given color type
|
||||
(png_color_16)
|
||||
|
||||
png_set_tRNS(png_ptr, info_ptr, trans, num_trans,
|
||||
trans_values);
|
||||
trans - array of transparent
|
||||
png_set_tRNS(png_ptr, info_ptr, trans_alpha,
|
||||
num_trans, trans_color);
|
||||
trans_alpha - array of alpha (transparency)
|
||||
entries for palette (PNG_INFO_tRNS)
|
||||
trans_values - graylevel or color sample values
|
||||
trans_color - graylevel or color sample values
|
||||
(in order red, green, blue) of the
|
||||
single transparent color for
|
||||
non-paletted images (PNG_INFO_tRNS)
|
||||
@@ -3494,10 +3424,10 @@ you may also have to change the memory allocators (png_malloc, etc.).
|
||||
|
||||
All includes for libpng are in pngconf.h. If you need to add, change
|
||||
or delete an include, this is the place to do it.
|
||||
The includes that are not needed outside libpng are protected by the
|
||||
PNG_INTERNAL definition, which is only defined for those routines inside
|
||||
libpng itself. The files in libpng proper only include png.h, which
|
||||
includes pngconf.h.
|
||||
The includes that are not needed outside libpng are placed in pngpriv.h,
|
||||
which is only used by the routines inside libpng itself.
|
||||
The files in libpng proper only include pngpriv.h and png.h, which
|
||||
in turn includes pngconf.h.
|
||||
|
||||
.SS Configuring zlib:
|
||||
|
||||
@@ -3858,7 +3788,92 @@ The function
|
||||
which also expands tRNS to alpha was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8()
|
||||
which does not. It has been deprecated since libpng-1.0.18 and 1.2.9.
|
||||
.SH IX. (Omitted)
|
||||
.SH IX. Changes to Libpng from version 1.0.x/1.2.x to 1.4.x
|
||||
|
||||
Private libpng prototypes and macro definitions were moved from
|
||||
png.h and pngconf.h into a new pngpriv.h header file.
|
||||
|
||||
Support for global arrays was removed.
|
||||
|
||||
Some obsolete/deprecated macros and functions have been removed.
|
||||
|
||||
The obsolete, unused pnggccrd.c and pngvcrd.files were removed.
|
||||
|
||||
The PNG_1_0_X and PNG_1_2_X macros were eliminated.
|
||||
|
||||
Functions png_set_benign_errors(), png_benign_error(), and
|
||||
png_chunk_benign_error() were added.
|
||||
|
||||
Support for setting the maximum amount of memory that the application
|
||||
will allocate for reading chunks was added, as a security measure.
|
||||
The functions png_set_chunk_cache_max() and png_get_chunk_cache_max()
|
||||
were added to the library.
|
||||
|
||||
We implemented support for I/O states by adding png_ptr member io_state
|
||||
and functions png_get_io_chunk_name() and png_get_io_state() in pngget.c
|
||||
|
||||
The png_calloc() function was added and is used in place of
|
||||
of "png_malloc(); png_memset();" except in the case in png_read_png()
|
||||
where the array consists of pointers; in this case a "for" loop is used
|
||||
after the png_malloc() to set the pointers to NULL.
|
||||
|
||||
We added PNG_TRANSFORM_GRAY_TO_RGB to the available high-level
|
||||
input transforms.
|
||||
|
||||
We added the png_set_premultiply_alpha and
|
||||
png_do_read_premultiply_alpha() functions.
|
||||
|
||||
The call to png_do_chop() in pngrtran.c, which reduces 16-bit input
|
||||
files to 8-bit bit depth, was relocated ahead of the building
|
||||
of gamma tables. This allows us to build 8-bit tables instead
|
||||
of 16-bit tables, when only 8-bit tables are needed. This avoids
|
||||
wasting some computing resources when the application has called
|
||||
the png_set_strip_16() function and encounters a 16-bit PNG file.
|
||||
|
||||
Checking for and reporting of errors in the IHDR chunk is more thorough.
|
||||
|
||||
The PNG_LEGACY_SUPPORTED macro was eliminated.
|
||||
|
||||
Many WIN32_WCE #ifdefs were removed.
|
||||
|
||||
The functions png_read_init(info_ptr), png_write_init(info_ptr),
|
||||
png_info_init(info_ptr), png_read_destroy(), and png_write_destroy()
|
||||
have been removed. They have been deprecated since libpng-0.95.
|
||||
|
||||
Support for numbered error messages was removed by default, since we
|
||||
never got around to actually numbering the error messages. The function
|
||||
png_set_strip_error_numbers() was removed from the library by default.
|
||||
|
||||
The png_permit_empty_plte() was removed. It has been deprecated
|
||||
since libpng-1.0.9. Use png_permit_mng_features() instead.
|
||||
|
||||
We removed the obsolete stub functions png_get_mmx_flagmask(),
|
||||
png_set_mmx_thresholds(), png_get_asm_flags(),
|
||||
png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(),
|
||||
png_set_asm_flags(), and png_mmx_supported()
|
||||
|
||||
We removed the png_check_sig(), png_memcpy_check(), and
|
||||
png_memset_check() functions.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
png_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
|
||||
We changed the prototypes of png_get_compression_buffer_size() and
|
||||
png_set_compression_buffer_size() to work with png_size_t instead of
|
||||
png_uint_32.
|
||||
|
||||
The png_zalloc() function no longer zeroes out the memory that it
|
||||
allocates.
|
||||
|
||||
The png_zalloc() and png_zfree() functions are no longer exported.
|
||||
|
||||
We removed the trailing '.' from the warning and error messages.
|
||||
|
||||
The png_struct and info_struct members "trans" and "trans_values" were
|
||||
changed to "trans_alpha" and "trans_color", respectively.
|
||||
|
||||
.SH X. Detecting libpng
|
||||
|
||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||
@@ -3967,7 +3982,7 @@ We mark all non-exported functions with "/* PRIVATE */"":
|
||||
|
||||
The prototypes for non-exported functions (except for those in
|
||||
pngtest) appear in
|
||||
the PNG_INTERNAL section of png.h
|
||||
pngpriv.h
|
||||
above the comment that says
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
@@ -3995,13 +4010,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
.SH XIII. Y2K Compliance in libpng
|
||||
|
||||
November 12, 2009
|
||||
November 13, 2009
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.2.41beta19 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.4.0beta97 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
|
||||
@@ -4145,147 +4160,33 @@ the first widely used release:
|
||||
1.0.16 10 10016 10.so.0.1.0.16
|
||||
1.2.6 13 10206 12.so.0.1.2.6
|
||||
1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2
|
||||
1.0.17rc1 10 10017 10.so.0.1.0.17rc1
|
||||
1.0.17rc1 10 10017 12.so.0.1.0.17rc1
|
||||
1.2.7rc1 13 10207 12.so.0.1.2.7rc1
|
||||
1.0.17 10 10017 10.so.0.1.0.17
|
||||
1.0.17 10 10017 12.so.0.1.0.17
|
||||
1.2.7 13 10207 12.so.0.1.2.7
|
||||
1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5
|
||||
1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5
|
||||
1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5
|
||||
1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5
|
||||
1.0.18 10 10018 10.so.0.1.0.18
|
||||
1.0.18 10 10018 12.so.0.1.0.18
|
||||
1.2.8 13 10208 12.so.0.1.2.8
|
||||
1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3
|
||||
1.2.9beta4-11 13 10209 12.so.0.9[.0]
|
||||
1.2.9rc1 13 10209 12.so.0.9[.0]
|
||||
1.2.9 13 10209 12.so.0.9[.0]
|
||||
1.2.10beta1-8 13 10210 12.so.0.10[.0]
|
||||
1.2.10rc1-3 13 10210 12.so.0.10[.0]
|
||||
1.2.10beta1-7 13 10210 12.so.0.10[.0]
|
||||
1.2.10rc1-2 13 10210 12.so.0.10[.0]
|
||||
1.2.10 13 10210 12.so.0.10[.0]
|
||||
1.2.11beta1-4 13 10211 12.so.0.11[.0]
|
||||
1.0.19rc1-5 10 10019 10.so.0.19[.0]
|
||||
1.2.11rc1-5 13 10211 12.so.0.11[.0]
|
||||
1.0.19 10 10019 10.so.0.19[.0]
|
||||
1.4.0beta1-6 14 10400 14.so.0.0[.0]
|
||||
1.2.11beta1-4 13 10210 12.so.0.11[.0]
|
||||
1.4.0beta7-8 14 10400 14.so.0.0[.0]
|
||||
1.2.11 13 10211 12.so.0.11[.0]
|
||||
1.0.20 10 10020 10.so.0.20[.0]
|
||||
1.2.12 13 10212 12.so.0.12[.0]
|
||||
1.2.13beta1 13 10213 12.so.0.13[.0]
|
||||
1.0.21 10 10021 10.so.0.21[.0]
|
||||
1.4.0beta9-14 14 10400 14.so.0.0[.0]
|
||||
1.2.13 13 10213 12.so.0.13[.0]
|
||||
1.2.14beta1-2 13 10214 12.so.0.14[.0]
|
||||
1.0.22rc1 10 10022 10.so.0.22[.0]
|
||||
1.2.14rc1 13 10214 12.so.0.14[.0]
|
||||
1.2.15beta1-6 13 10215 12.so.0.15[.0]
|
||||
1.0.23rc1-5 10 10023 10.so.0.23[.0]
|
||||
1.2.15rc1-5 13 10215 12.so.0.15[.0]
|
||||
1.0.23 10 10023 10.so.0.23[.0]
|
||||
1.2.15 13 10215 12.so.0.15[.0]
|
||||
1.2.16beta1-2 13 10216 12.so.0.16[.0]
|
||||
1.2.16rc1 13 10216 12.so.0.16[.0]
|
||||
1.0.24 10 10024 10.so.0.24[.0]
|
||||
1.2.16 13 10216 12.so.0.16[.0]
|
||||
1.2.17beta1-2 13 10217 12.so.0.17[.0]
|
||||
1.0.25rc1 10 10025 10.so.0.25[.0]
|
||||
1.2.17rc1-3 13 10217 12.so.0.17[.0]
|
||||
1.0.25 10 10025 10.so.0.25[.0]
|
||||
1.2.17 13 10217 12.so.0.17[.0]
|
||||
1.0.26 10 10026 10.so.0.26[.0]
|
||||
1.2.18 13 10218 12.so.0.18[.0]
|
||||
1.2.19beta1-31 13 10219 12.so.0.19[.0]
|
||||
1.0.27rc1-6 10 10027 10.so.0.27[.0]
|
||||
1.2.19rc1-6 13 10219 12.so.0.19[.0]
|
||||
1.0.27 10 10027 10.so.0.27[.0]
|
||||
1.2.19 13 10219 12.so.0.19[.0]
|
||||
1.2.20beta01-04 13 10220 12.so.0.20[.0]
|
||||
1.0.28rc1-6 10 10028 10.so.0.28[.0]
|
||||
1.2.20rc1-6 13 10220 12.so.0.20[.0]
|
||||
1.0.28 10 10028 10.so.0.28[.0]
|
||||
1.2.20 13 10220 12.so.0.20[.0]
|
||||
1.2.21beta1-2 13 10221 12.so.0.21[.0]
|
||||
1.2.21rc1-3 13 10221 12.so.0.21[.0]
|
||||
1.0.29 10 10029 10.so.0.29[.0]
|
||||
1.2.21 13 10221 12.so.0.21[.0]
|
||||
1.2.22beta1-4 13 10222 12.so.0.22[.0]
|
||||
1.0.30rc1 13 10030 10.so.0.30[.0]
|
||||
1.2.22rc1 13 10222 12.so.0.22[.0]
|
||||
1.0.30 10 10030 10.so.0.30[.0]
|
||||
1.2.22 13 10222 12.so.0.22[.0]
|
||||
1.2.23beta01-05 13 10223 12.so.0.23[.0]
|
||||
1.2.23rc01 13 10223 12.so.0.23[.0]
|
||||
1.2.23 13 10223 12.so.0.23[.0]
|
||||
1.2.24beta01-02 13 10224 12.so.0.24[.0]
|
||||
1.2.24rc01 13 10224 12.so.0.24[.0]
|
||||
1.2.24 13 10224 12.so.0.24[.0]
|
||||
1.2.25beta01-06 13 10225 12.so.0.25[.0]
|
||||
1.2.25rc01-02 13 10225 12.so.0.25[.0]
|
||||
1.0.31 10 10031 10.so.0.31[.0]
|
||||
1.2.25 13 10225 12.so.0.25[.0]
|
||||
1.2.26beta01-06 13 10226 12.so.0.26[.0]
|
||||
1.2.26rc01 13 10226 12.so.0.26[.0]
|
||||
1.2.26 13 10226 12.so.0.26[.0]
|
||||
1.0.32 10 10032 10.so.0.32[.0]
|
||||
1.2.27beta01-06 13 10227 12.so.0.27[.0]
|
||||
1.2.27rc01 13 10227 12.so.0.27[.0]
|
||||
1.0.33 10 10033 10.so.0.33[.0]
|
||||
1.2.27 13 10227 12.so.0.27[.0]
|
||||
1.0.34 10 10034 10.so.0.34[.0]
|
||||
1.2.28 13 10228 12.so.0.28[.0]
|
||||
1.2.29beta01-03 13 10229 12.so.0.29[.0]
|
||||
1.2.29rc01 13 10229 12.so.0.29[.0]
|
||||
1.0.35 10 10035 10.so.0.35[.0]
|
||||
1.2.29 13 10229 12.so.0.29[.0]
|
||||
1.0.37 10 10037 10.so.0.37[.0]
|
||||
1.2.30beta01-04 13 10230 12.so.0.30[.0]
|
||||
1.0.38rc01-08 10 10038 10.so.0.38[.0]
|
||||
1.2.30rc01-08 13 10230 12.so.0.30[.0]
|
||||
1.0.38 10 10038 10.so.0.38[.0]
|
||||
1.2.30 13 10230 12.so.0.30[.0]
|
||||
1.0.39rc01-03 10 10039 10.so.0.39[.0]
|
||||
1.2.31rc01-03 13 10231 12.so.0.31[.0]
|
||||
1.0.39 10 10039 10.so.0.39[.0]
|
||||
1.2.31 13 10231 12.so.0.31[.0]
|
||||
1.2.32beta01-02 13 10232 12.so.0.32[.0]
|
||||
1.0.40rc01 10 10040 10.so.0.40[.0]
|
||||
1.2.32rc01 13 10232 12.so.0.32[.0]
|
||||
1.0.40 10 10040 10.so.0.40[.0]
|
||||
1.2.32 13 10232 12.so.0.32[.0]
|
||||
1.2.33beta01-02 13 10233 12.so.0.33[.0]
|
||||
1.2.33rc01-02 13 10233 12.so.0.33[.0]
|
||||
1.0.41rc01 10 10041 10.so.0.41[.0]
|
||||
1.2.33 13 10233 12.so.0.33[.0]
|
||||
1.0.41 10 10041 10.so.0.41[.0]
|
||||
1.2.34beta01-07 13 10234 12.so.0.34[.0]
|
||||
1.0.42rc01 10 10042 10.so.0.42[.0]
|
||||
1.2.34rc01 13 10234 12.so.0.34[.0]
|
||||
1.0.42 10 10042 10.so.0.42[.0]
|
||||
1.2.34 13 10234 12.so.0.34[.0]
|
||||
1.2.35beta01-03 13 10235 12.so.0.35[.0]
|
||||
1.0.43rc01-02 10 10043 10.so.0.43[.0]
|
||||
1.2.35rc01-02 13 10235 12.so.0.35[.0]
|
||||
1.0.43 10 10043 10.so.0.43[.0]
|
||||
1.2.35 13 10235 12.so.0.35[.0]
|
||||
1.2.36beta01-05 13 10236 12.so.0.36[.0]
|
||||
1.2.36rc01 13 10236 12.so.0.36[.0]
|
||||
1.0.44 10 10044 10.so.0.44[.0]
|
||||
1.2.36 13 10236 12.so.0.36[.0]
|
||||
1.2.37beta01-03 13 10237 12.so.0.37[.0]
|
||||
1.2.37rc01 13 10237 12.so.0.37[.0]
|
||||
1.2.37 13 10237 12.so.0.37[.0]
|
||||
1.2.45 10 10045 12.so.0.45[.0]
|
||||
1.0.46 10 10046 10.so.0.46[.0]
|
||||
1.2.38beta01 13 10238 12.so.0.38[.0]
|
||||
1.2.38rc01-03 13 10238 12.so.0.38[.0]
|
||||
1.0.47 10 10047 10.so.0.47[.0]
|
||||
1.2.38 13 10238 12.so.0.38[.0]
|
||||
1.2.39beta01-05 13 10239 12.so.0.39[.0]
|
||||
1.2.39rc01 13 10239 12.so.0.39[.0]
|
||||
1.0.48 10 10048 10.so.0.48[.0]
|
||||
1.2.39 13 10239 12.so.0.39[.0]
|
||||
1.2.40beta01 13 10240 12.so.0.40[.0]
|
||||
1.2.40rc01 13 10240 12.so.0.40[.0]
|
||||
1.0.49 10 10049 10.so.0.49[.0]
|
||||
1.2.40 13 10240 12.so.0.40[.0]
|
||||
1.0.50 10 10050 10.so.0.50[.0]
|
||||
1.2.41beta01-18 13 10241 12.so.0.41[.0]
|
||||
1.4.0beta15-36 14 10400 14.so.0.0[.0]
|
||||
1.4.0beta37-87 14 10400 14.so.14.0[.0]
|
||||
1.4.0rc01 14 10400 14.so.14.0[.0]
|
||||
1.4.0beta88-97 14 10400 14.so.14.0[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -4298,7 +4199,7 @@ version 1.0.6j; from then on they were given the upcoming public
|
||||
release number plus "betaNN" or "rcN".
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.IR libpngpf(3) ", " png(5)
|
||||
libpngpf(3), png(5)
|
||||
.LP
|
||||
.IR libpng :
|
||||
.IP
|
||||
@@ -4321,7 +4222,7 @@ ftp://ftp.info-zip.org/pub/infozip/zlib
|
||||
.I libpng
|
||||
or at
|
||||
.br
|
||||
ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt
|
||||
ftp://ds.internic.net/rfc/rfc2083.txt
|
||||
.br
|
||||
or (as a W3C Recommendation) at
|
||||
.br
|
||||
@@ -4341,7 +4242,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.2.41beta19 - November 12, 2009:
|
||||
Libpng version 1.4.0beta97 - November 13, 2009:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@@ -4364,8 +4265,8 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.2.41beta19, November 12, 2009, are
|
||||
Copyright (c) 2004,2006-2008 Glenn Randers-Pehrson, and are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.4.0beta97, November 13, 2009, 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
|
||||
|
||||
@@ -4463,7 +4364,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
November 12, 2009
|
||||
November 13, 2009
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
52
libpngpf.3
52
libpngpf.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "November 11, 2009"
|
||||
.TH LIBPNGPF 3 "November 13, 2009"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta97
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include <png.h>\fP
|
||||
@@ -37,12 +37,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -55,6 +49,12 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -97,7 +97,19 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_charp \fP\fIchunkdata\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
||||
\fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -115,7 +127,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_values\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_color\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
@@ -197,6 +209,8 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_premultiply_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
|
||||
@@ -553,16 +567,12 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBpng_uint_32 png_read_chunk_header (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP
|
||||
@@ -623,6 +633,8 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
|
||||
@@ -733,12 +745,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.41beta19
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sig (png_structp \fIpng_ptr\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fI\fB
|
||||
|
||||
\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP
|
||||
|
||||
\fI\fB
|
||||
@@ -801,6 +807,6 @@ are listed alphabetically here as an aid to libpng maintainers.
|
||||
See png.h for more information on these functions.
|
||||
|
||||
.SH SEE ALSO
|
||||
.IR libpng(3) ", " png(5)
|
||||
libpng(3), png(5)
|
||||
.SH AUTHOR
|
||||
Glenn Randers-Pehrson
|
||||
|
||||
2
ltmain.sh
Normal file → Executable file
2
ltmain.sh
Normal file → Executable file
@@ -2560,7 +2560,7 @@ func_win32_libid ()
|
||||
;;
|
||||
*ar\ archive*) # could be an import, or static
|
||||
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
|
||||
$EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince)' >/dev/null ; then
|
||||
$EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
|
||||
win32_nmres=`eval $NM -f posix -A $1 |
|
||||
$SED -n -e '
|
||||
1,100{
|
||||
|
||||
6
png.5
6
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "November 11, 2009"
|
||||
.TH PNG 5 "November 13, 2009"
|
||||
.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)
|
||||
.IR libpng(3), zlib(3), deflate(5), and zlib(5)
|
||||
.LP
|
||||
PNG specification (second edition), November 2003:
|
||||
.IP
|
||||
@@ -35,7 +35,7 @@ PNG 1.0 specification, October 1996:
|
||||
RFC 2083
|
||||
.IP
|
||||
.br
|
||||
ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt
|
||||
ftp://ds.internic.net/rfc/rfc2083.txt
|
||||
.br
|
||||
or (as a W3C Recommendation) at
|
||||
.br
|
||||
|
||||
208
png.c
208
png.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -11,81 +11,17 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#define PNG_NO_EXTERN
|
||||
#include "png.h"
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_41beta19 Your_png_h_is_not_version_1_2_41beta19;
|
||||
typedef version_1_4_0beta97 Your_png_h_is_not_version_1_4_0beta97;
|
||||
|
||||
/* Version information for C files. This had better match the version
|
||||
* string defined in png.h.
|
||||
*/
|
||||
|
||||
#ifdef PNG_USE_GLOBAL_ARRAYS
|
||||
/* png_libpng_ver was changed to a function in version 1.0.5c */
|
||||
PNG_CONST char png_libpng_ver[18] = PNG_LIBPNG_VER_STRING;
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
|
||||
/* png_sig was changed to a function in version 1.0.5c */
|
||||
/* Place to hold the signature string for a PNG file. */
|
||||
PNG_CONST png_byte FARDATA png_sig[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
|
||||
/* Invoke global declarations for constant strings for known chunk types */
|
||||
PNG_IHDR;
|
||||
PNG_IDAT;
|
||||
PNG_IEND;
|
||||
PNG_PLTE;
|
||||
PNG_bKGD;
|
||||
PNG_cHRM;
|
||||
PNG_gAMA;
|
||||
PNG_hIST;
|
||||
PNG_iCCP;
|
||||
PNG_iTXt;
|
||||
PNG_oFFs;
|
||||
PNG_pCAL;
|
||||
PNG_sCAL;
|
||||
PNG_pHYs;
|
||||
PNG_sBIT;
|
||||
PNG_sPLT;
|
||||
PNG_sRGB;
|
||||
PNG_tEXt;
|
||||
PNG_tIME;
|
||||
PNG_tRNS;
|
||||
PNG_zTXt;
|
||||
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
PNG_CONST int FARDATA png_pass_start[] = {0, 4, 0, 2, 0, 1, 0};
|
||||
|
||||
/* Offset to next interlace block */
|
||||
PNG_CONST int FARDATA png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
|
||||
/* Start of interlace block in the y direction */
|
||||
PNG_CONST int FARDATA png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1};
|
||||
|
||||
/* Offset to next interlace block in the y direction */
|
||||
PNG_CONST int FARDATA png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2};
|
||||
|
||||
/* Height of interlace block. This is not currently used - if you need
|
||||
* it, uncomment it here and in png.h
|
||||
PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
*/
|
||||
|
||||
/* Mask to determine which pixels are valid in a pass */
|
||||
PNG_CONST int FARDATA png_pass_mask[] = {0x80, 0x08, 0x88, 0x22, 0xaa, 0x55, 0xff};
|
||||
|
||||
/* Mask to determine which pixels to overwrite while displaying */
|
||||
PNG_CONST int FARDATA png_pass_dsp_mask[]
|
||||
= {0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
|
||||
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
#endif /* PNG_USE_GLOBAL_ARRAYS */
|
||||
|
||||
/* 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
|
||||
* stream we can set num_bytes = 8 so that libpng will not attempt to read
|
||||
@@ -102,7 +38,7 @@ png_set_sig_bytes(png_structp png_ptr, int num_bytes)
|
||||
return;
|
||||
|
||||
if (num_bytes > 8)
|
||||
png_error(png_ptr, "Too many bytes for PNG signature.");
|
||||
png_error(png_ptr, "Too many bytes for PNG signature");
|
||||
|
||||
png_ptr->sig_bytes = (png_byte)(num_bytes < 0 ? 0 : num_bytes);
|
||||
}
|
||||
@@ -133,32 +69,17 @@ png_sig_cmp(png_bytep sig, png_size_t start, png_size_t num_to_check)
|
||||
return ((int)(png_memcmp(&sig[start], &png_signature[start], num_to_check)));
|
||||
}
|
||||
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
/* (Obsolete) function to check signature bytes. It does not allow one
|
||||
* to check a partial signature. This function might be removed in the
|
||||
* future - use png_sig_cmp(). Returns true (nonzero) if the file is PNG.
|
||||
*/
|
||||
int PNGAPI
|
||||
png_check_sig(png_bytep sig, int num)
|
||||
{
|
||||
return ((int)!png_sig_cmp(sig, (png_size_t)0, (png_size_t)num));
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
/* Function to allocate memory for zlib and clear it to 0. */
|
||||
#ifdef PNG_1_0_X
|
||||
voidpf PNGAPI
|
||||
#else
|
||||
voidpf /* PRIVATE */
|
||||
#endif
|
||||
png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||
{
|
||||
png_voidp ptr;
|
||||
png_structp p=(png_structp)png_ptr;
|
||||
png_uint_32 save_flags=p->flags;
|
||||
png_uint_32 num_bytes;
|
||||
png_alloc_size_t num_bytes;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return (NULL);
|
||||
@@ -167,36 +88,17 @@ png_zalloc(voidpf png_ptr, uInt items, uInt size)
|
||||
png_warning (p, "Potential overflow in png_zalloc()");
|
||||
return (NULL);
|
||||
}
|
||||
num_bytes = (png_uint_32)items * size;
|
||||
num_bytes = (png_alloc_size_t)items * size;
|
||||
|
||||
p->flags|=PNG_FLAG_MALLOC_NULL_MEM_OK;
|
||||
ptr = (png_voidp)png_malloc((png_structp)png_ptr, num_bytes);
|
||||
p->flags=save_flags;
|
||||
|
||||
#if defined(PNG_1_0_X) && !defined(PNG_NO_ZALLOC_ZERO)
|
||||
if (ptr == NULL)
|
||||
return ((voidpf)ptr);
|
||||
|
||||
if (num_bytes > (png_uint_32)0x8000L)
|
||||
{
|
||||
png_memset(ptr, 0, (png_size_t)0x8000L);
|
||||
png_memset((png_bytep)ptr + (png_size_t)0x8000L, 0,
|
||||
(png_size_t)(num_bytes - (png_uint_32)0x8000L));
|
||||
}
|
||||
else
|
||||
{
|
||||
png_memset(ptr, 0, (png_size_t)num_bytes);
|
||||
}
|
||||
#endif
|
||||
return ((voidpf)ptr);
|
||||
}
|
||||
|
||||
/* Function to free memory for zlib */
|
||||
#ifdef PNG_1_0_X
|
||||
void PNGAPI
|
||||
#else
|
||||
void /* PRIVATE */
|
||||
#endif
|
||||
png_zfree(voidpf png_ptr, voidpf ptr)
|
||||
{
|
||||
png_free((png_structp)png_ptr, (png_voidp)ptr);
|
||||
@@ -301,15 +203,6 @@ png_destroy_info_struct(png_structp png_ptr, png_infopp info_ptr_ptr)
|
||||
* and applications using it are urged to use png_create_info_struct()
|
||||
* instead.
|
||||
*/
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
#undef png_info_init
|
||||
void PNGAPI
|
||||
png_info_init(png_infop info_ptr)
|
||||
{
|
||||
/* We only come here via pre-1.0.12-compiled applications */
|
||||
png_info_init_3(&info_ptr, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
void PNGAPI
|
||||
png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
|
||||
@@ -332,7 +225,6 @@ png_info_init_3(png_infopp ptr_ptr, png_size_t png_info_struct_size)
|
||||
png_memset(info_ptr, 0, png_sizeof(png_info));
|
||||
}
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
void PNGAPI
|
||||
png_data_freer(png_structp png_ptr, png_infop info_ptr,
|
||||
int freer, png_uint_32 mask)
|
||||
@@ -348,9 +240,8 @@ png_data_freer(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->free_me &= ~mask;
|
||||
else
|
||||
png_warning(png_ptr,
|
||||
"Unknown freer parameter in png_data_freer.");
|
||||
"Unknown freer parameter in png_data_freer");
|
||||
}
|
||||
#endif
|
||||
|
||||
void PNGAPI
|
||||
png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
@@ -363,11 +254,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_TEXT_SUPPORTED
|
||||
/* Free text item num or (if num == -1) all text items */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_TEXT) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_TEXT)
|
||||
#endif
|
||||
{
|
||||
if (num != -1)
|
||||
{
|
||||
@@ -391,28 +278,17 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_tRNS_SUPPORTED
|
||||
/* Free any tRNS entry */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_TRNS) & info_ptr->free_me)
|
||||
#else
|
||||
if ((mask & PNG_FREE_TRNS) && (png_ptr->flags & PNG_FLAG_FREE_TRNS))
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, info_ptr->trans);
|
||||
info_ptr->trans = NULL;
|
||||
png_free(png_ptr, info_ptr->trans_alpha);
|
||||
info_ptr->trans_alpha = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_tRNS;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_sCAL_SUPPORTED
|
||||
/* Free any sCAL entry */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_SCAL) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_SCAL)
|
||||
#endif
|
||||
{
|
||||
#if defined(PNG_FIXED_POINT_SUPPORTED) && !defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
png_free(png_ptr, info_ptr->scal_s_width);
|
||||
@@ -426,11 +302,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_pCAL_SUPPORTED
|
||||
/* Free any pCAL entry */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_PCAL) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_PCAL)
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, info_ptr->pcal_purpose);
|
||||
png_free(png_ptr, info_ptr->pcal_units);
|
||||
@@ -453,11 +325,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_iCCP_SUPPORTED
|
||||
/* Free any iCCP entry */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_ICCP) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_ICCP)
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, info_ptr->iccp_name);
|
||||
png_free(png_ptr, info_ptr->iccp_profile);
|
||||
@@ -469,11 +337,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_sPLT_SUPPORTED
|
||||
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_SPLT) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_SPLT)
|
||||
#endif
|
||||
{
|
||||
if (num != -1)
|
||||
{
|
||||
@@ -509,11 +373,7 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
png_ptr->unknown_chunk.data = NULL;
|
||||
}
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_UNKN) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_UNKN)
|
||||
#endif
|
||||
{
|
||||
if (num != -1)
|
||||
{
|
||||
@@ -542,44 +402,26 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
|
||||
#ifdef PNG_hIST_SUPPORTED
|
||||
/* Free any hIST entry */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_HIST) & info_ptr->free_me)
|
||||
#else
|
||||
if ((mask & PNG_FREE_HIST) && (png_ptr->flags & PNG_FLAG_FREE_HIST))
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, info_ptr->hist);
|
||||
info_ptr->hist = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_hIST;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Free any PLTE entry that was internally allocated */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_PLTE) & info_ptr->free_me)
|
||||
#else
|
||||
if ((mask & PNG_FREE_PLTE) && (png_ptr->flags & PNG_FLAG_FREE_PLTE))
|
||||
#endif
|
||||
{
|
||||
png_zfree(png_ptr, info_ptr->palette);
|
||||
info_ptr->palette = NULL;
|
||||
info_ptr->valid &= ~PNG_INFO_PLTE;
|
||||
#ifndef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
|
||||
#endif
|
||||
info_ptr->num_palette = 0;
|
||||
}
|
||||
|
||||
#ifdef PNG_INFO_IMAGE_SUPPORTED
|
||||
/* Free any image bits attached to the info structure */
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if ((mask & PNG_FREE_ROWS) & info_ptr->free_me)
|
||||
#else
|
||||
if (mask & PNG_FREE_ROWS)
|
||||
#endif
|
||||
{
|
||||
if (info_ptr->row_pointers)
|
||||
{
|
||||
@@ -587,21 +429,17 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
for (row = 0; row < (int)info_ptr->height; row++)
|
||||
{
|
||||
png_free(png_ptr, info_ptr->row_pointers[row]);
|
||||
info_ptr->row_pointers[row]=NULL;
|
||||
}
|
||||
png_free(png_ptr, info_ptr->row_pointers);
|
||||
info_ptr->row_pointers=NULL;
|
||||
}
|
||||
info_ptr->valid &= ~PNG_INFO_IDAT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if (num == -1)
|
||||
info_ptr->free_me &= ~mask;
|
||||
else
|
||||
info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This is an internal routine to free any memory that the info struct is
|
||||
@@ -619,7 +457,6 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr)
|
||||
if (png_ptr->num_chunk_list)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->chunk_list);
|
||||
png_ptr->chunk_list=NULL;
|
||||
png_ptr->num_chunk_list = 0;
|
||||
}
|
||||
#endif
|
||||
@@ -679,17 +516,6 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
||||
png_sizeof(char)));
|
||||
}
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
{
|
||||
wchar_t time_buf[29];
|
||||
wsprintf(time_buf, TEXT("%d %S %d %02d:%02d:%02d +0000"),
|
||||
ptime->day % 32, short_months[(ptime->month - 1) % 12],
|
||||
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
||||
ptime->second % 61);
|
||||
WideCharToMultiByte(CP_ACP, 0, time_buf, -1, png_ptr->time_buffer, 29,
|
||||
NULL, NULL);
|
||||
}
|
||||
#else
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
{
|
||||
char near_time_buf[29];
|
||||
@@ -706,7 +532,6 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime)
|
||||
ptime->year, ptime->hour % 24, ptime->minute % 60,
|
||||
ptime->second % 61);
|
||||
#endif
|
||||
#endif /* _WIN32_WCE */
|
||||
return ((png_charp)png_ptr->time_buffer);
|
||||
}
|
||||
#endif /* PNG_TIME_RFC1123_SUPPORTED */
|
||||
@@ -722,13 +547,13 @@ png_get_copyright(png_structp png_ptr)
|
||||
#else
|
||||
#ifdef __STDC__
|
||||
return ((png_charp) PNG_STRING_NEWLINE \
|
||||
"libpng version 1.2.41beta19 - November 11, 2009" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.4.0beta97 - November 13, 2009" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2009 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.2.41beta19 - November 11, 2009\
|
||||
return ((png_charp) "libpng version 1.4.0beta97 - November 13, 2009\
|
||||
Copyright (c) 1998-2009 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
|
||||
@@ -813,17 +638,6 @@ png_access_version_number(void)
|
||||
}
|
||||
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) && defined(PNG_ASSEMBLER_CODE_SUPPORTED)
|
||||
#ifndef PNG_1_0_X
|
||||
/* This function was added to libpng 1.2.0 */
|
||||
int PNGAPI
|
||||
png_mmx_support(void)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
return -1;
|
||||
}
|
||||
#endif /* PNG_1_0_X */
|
||||
#endif /* PNG_READ_SUPPORTED && PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#ifdef PNG_SIZE_T
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngerror.c - stub functions for i/o and memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -16,9 +16,9 @@
|
||||
* at each function.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#include "pngpriv.h"
|
||||
|
||||
static void /* PRIVATE */
|
||||
png_default_error PNGARG((png_structp png_ptr,
|
||||
|
||||
103
pnggccrd.c
103
pnggccrd.c
@@ -1,103 +0,0 @@
|
||||
/* pnggccrd.c was removed from libpng-1.2.20. */
|
||||
|
||||
/* This code snippet is for use by configure's compilation test. */
|
||||
|
||||
#if (!defined _MSC_VER) && \
|
||||
defined(PNG_ASSEMBLER_CODE_SUPPORTED) && \
|
||||
defined(PNG_MMX_CODE_SUPPORTED)
|
||||
|
||||
int PNGAPI png_dummy_mmx_support(void);
|
||||
|
||||
static int _mmx_supported = 2; // 0: no MMX; 1: MMX supported; 2: not tested
|
||||
|
||||
int PNGAPI
|
||||
png_dummy_mmx_support(void) __attribute__((noinline));
|
||||
|
||||
int PNGAPI
|
||||
png_dummy_mmx_support(void)
|
||||
{
|
||||
int result;
|
||||
#ifdef PNG_MMX_CODE_SUPPORTED // superfluous, but what the heck
|
||||
__asm__ __volatile__ (
|
||||
#ifdef __x86_64__
|
||||
"pushq %%rbx \n\t" // rbx gets clobbered by CPUID instruction
|
||||
"pushq %%rcx \n\t" // so does rcx...
|
||||
"pushq %%rdx \n\t" // ...and rdx (but rcx & rdx safe on Linux)
|
||||
"pushfq \n\t" // save Eflag to stack
|
||||
"popq %%rax \n\t" // get Eflag from stack into rax
|
||||
"movq %%rax, %%rcx \n\t" // make another copy of Eflag in rcx
|
||||
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||
"pushq %%rax \n\t" // save modified Eflag back to stack
|
||||
"popfq \n\t" // restore modified value to Eflag reg
|
||||
"pushfq \n\t" // save Eflag to stack
|
||||
"popq %%rax \n\t" // get Eflag from stack
|
||||
"pushq %%rcx \n\t" // save original Eflag to stack
|
||||
"popfq \n\t" // restore original Eflag
|
||||
#else
|
||||
"pushl %%ebx \n\t" // ebx gets clobbered by CPUID instruction
|
||||
"pushl %%ecx \n\t" // so does ecx...
|
||||
"pushl %%edx \n\t" // ...and edx (but ecx & edx safe on Linux)
|
||||
"pushfl \n\t" // save Eflag to stack
|
||||
"popl %%eax \n\t" // get Eflag from stack into eax
|
||||
"movl %%eax, %%ecx \n\t" // make another copy of Eflag in ecx
|
||||
"xorl $0x200000, %%eax \n\t" // toggle ID bit in Eflag (i.e., bit 21)
|
||||
"pushl %%eax \n\t" // save modified Eflag back to stack
|
||||
"popfl \n\t" // restore modified value to Eflag reg
|
||||
"pushfl \n\t" // save Eflag to stack
|
||||
"popl %%eax \n\t" // get Eflag from stack
|
||||
"pushl %%ecx \n\t" // save original Eflag to stack
|
||||
"popfl \n\t" // restore original Eflag
|
||||
#endif
|
||||
"xorl %%ecx, %%eax \n\t" // compare new Eflag with original Eflag
|
||||
"jz 0f \n\t" // if same, CPUID instr. is not supported
|
||||
|
||||
"xorl %%eax, %%eax \n\t" // set eax to zero
|
||||
// ".byte 0x0f, 0xa2 \n\t" // CPUID instruction (two-byte opcode)
|
||||
"cpuid \n\t" // get the CPU identification info
|
||||
"cmpl $1, %%eax \n\t" // make sure eax return non-zero value
|
||||
"jl 0f \n\t" // if eax is zero, MMX is not supported
|
||||
|
||||
"xorl %%eax, %%eax \n\t" // set eax to zero and...
|
||||
"incl %%eax \n\t" // ...increment eax to 1. This pair is
|
||||
// faster than the instruction "mov eax, 1"
|
||||
"cpuid \n\t" // get the CPU identification info again
|
||||
"andl $0x800000, %%edx \n\t" // mask out all bits but MMX bit (23)
|
||||
"cmpl $0, %%edx \n\t" // 0 = MMX not supported
|
||||
"jz 0f \n\t" // non-zero = yes, MMX IS supported
|
||||
|
||||
"movl $1, %%eax \n\t" // set return value to 1
|
||||
"jmp 1f \n\t" // DONE: have MMX support
|
||||
|
||||
"0: \n\t" // .NOT_SUPPORTED: target label for jump instructions
|
||||
"movl $0, %%eax \n\t" // set return value to 0
|
||||
"1: \n\t" // .RETURN: target label for jump instructions
|
||||
#ifdef __x86_64__
|
||||
"popq %%rdx \n\t" // restore rdx
|
||||
"popq %%rcx \n\t" // restore rcx
|
||||
"popq %%rbx \n\t" // restore rbx
|
||||
#else
|
||||
"popl %%edx \n\t" // restore edx
|
||||
"popl %%ecx \n\t" // restore ecx
|
||||
"popl %%ebx \n\t" // restore ebx
|
||||
#endif
|
||||
|
||||
// "ret \n\t" // DONE: no MMX support
|
||||
// (fall through to standard C "ret")
|
||||
|
||||
: "=a" (result) // output list
|
||||
|
||||
: // any variables used on input (none)
|
||||
|
||||
// no clobber list
|
||||
// , "%ebx", "%ecx", "%edx" // GRR: we handle these manually
|
||||
// , "memory" // if write to a variable gcc thought was in a reg
|
||||
// , "cc" // "condition codes" (flag bits)
|
||||
);
|
||||
_mmx_supported = result;
|
||||
#else
|
||||
_mmx_supported = 0;
|
||||
#endif /* PNG_MMX_CODE_SUPPORTED */
|
||||
|
||||
return _mmx_supported;
|
||||
}
|
||||
#endif
|
||||
96
pngget.c
96
pngget.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngget.c - retrieval of values from info struct
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -12,9 +12,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#include "pngpriv.h"
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
|
||||
@@ -26,7 +26,7 @@ png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
|
||||
return(0);
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_size_t PNGAPI
|
||||
png_get_rowbytes(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
if (png_ptr != NULL && info_ptr != NULL)
|
||||
@@ -802,7 +802,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_bytep *trans, int *num_trans, png_color_16p *trans_values)
|
||||
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
|
||||
{
|
||||
png_uint_32 retval = 0;
|
||||
if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS))
|
||||
@@ -811,25 +811,25 @@ png_get_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (trans != NULL)
|
||||
if (trans_alpha != NULL)
|
||||
{
|
||||
*trans = info_ptr->trans;
|
||||
*trans_alpha = info_ptr->trans_alpha;
|
||||
retval |= PNG_INFO_tRNS;
|
||||
}
|
||||
|
||||
if (trans_values != NULL)
|
||||
*trans_values = &(info_ptr->trans_values);
|
||||
if (trans_color != NULL)
|
||||
*trans_color = &(info_ptr->trans_color);
|
||||
}
|
||||
else /* if (info_ptr->color_type != PNG_COLOR_TYPE_PALETTE) */
|
||||
{
|
||||
if (trans_values != NULL)
|
||||
if (trans_color != NULL)
|
||||
{
|
||||
*trans_values = &(info_ptr->trans_values);
|
||||
*trans_color = &(info_ptr->trans_color);
|
||||
retval |= PNG_INFO_tRNS;
|
||||
}
|
||||
|
||||
if (trans != NULL)
|
||||
*trans = NULL;
|
||||
if (trans_alpha != NULL)
|
||||
*trans_alpha = NULL;
|
||||
}
|
||||
if (num_trans != NULL)
|
||||
{
|
||||
@@ -872,60 +872,13 @@ png_get_user_chunk_ptr(png_structp png_ptr)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_size_t PNGAPI
|
||||
png_get_compression_buffer_size(png_structp png_ptr)
|
||||
{
|
||||
return (png_uint_32)(png_ptr? png_ptr->zbuf_size : 0L);
|
||||
return (png_ptr ? png_ptr->zbuf_size : 0L);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
#ifndef PNG_1_0_X
|
||||
/* This function was added to libpng 1.2.0 and should exist by default */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_asm_flags (png_structp png_ptr)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
return (png_ptr? 0L: 0L);
|
||||
}
|
||||
|
||||
/* This function was added to libpng 1.2.0 and should exist by default */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_asm_flagmask (int flag_select)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
flag_select=flag_select;
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
|
||||
/* This function was added to libpng 1.2.0 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_mmx_flagmask (int flag_select, int *compilerID)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
flag_select=flag_select;
|
||||
*compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */
|
||||
return 0L;
|
||||
}
|
||||
|
||||
/* This function was added to libpng 1.2.0 */
|
||||
png_byte PNGAPI
|
||||
png_get_mmx_bitdepth_threshold (png_structp png_ptr)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
return (png_ptr? 0: 0);
|
||||
}
|
||||
|
||||
/* This function was added to libpng 1.2.0 */
|
||||
png_uint_32 PNGAPI
|
||||
png_get_mmx_rowbytes_threshold (png_structp png_ptr)
|
||||
{
|
||||
/* Obsolete, to be removed from libpng-1.4.0 */
|
||||
return (png_ptr? 0L: 0L);
|
||||
}
|
||||
#endif /* ?PNG_1_0_X */
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
/* These functions were added to libpng 1.2.6 */
|
||||
@@ -939,6 +892,27 @@ png_get_user_height_max (png_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)
|
||||
{
|
||||
return (png_ptr? png_ptr->user_chunk_cache_max? 0x7fffffffL :
|
||||
png_ptr->user_chunk_cache_max - 1 : 0);
|
||||
}
|
||||
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
png_get_io_state (png_structp png_ptr)
|
||||
{
|
||||
return png_ptr->io_state;
|
||||
}
|
||||
|
||||
png_bytep PNGAPI
|
||||
png_get_io_chunk_name (png_structp png_ptr)
|
||||
{
|
||||
return png_ptr->chunk_name;
|
||||
}
|
||||
#endif /* ?PNG_IO_STATE_SUPPORTED */
|
||||
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
76
pngmem.c
76
pngmem.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngmem.c - stub functions for memory allocation
|
||||
*
|
||||
* Last changed in libpng 1.2.37 [June 4, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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,9 +17,9 @@
|
||||
* identify the replacement functions.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Borland DOS special memory handler */
|
||||
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
|
||||
@@ -31,7 +31,7 @@ png_voidp /* PRIVATE */
|
||||
png_create_struct(int type)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
|
||||
return (png_create_struct_2(type, NULL, NULL));
|
||||
}
|
||||
|
||||
/* Alternate version of png_create_struct, for use with user-defined malloc. */
|
||||
@@ -70,7 +70,7 @@ void /* PRIVATE */
|
||||
png_destroy_struct(png_voidp struct_ptr)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
|
||||
png_destroy_struct_2(struct_ptr, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Free memory allocated by a png_create_struct() call */
|
||||
@@ -115,7 +115,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
||||
* (which should cause a fatal error) and introducing major problems.
|
||||
*/
|
||||
png_voidp PNGAPI
|
||||
png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_calloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -126,7 +126,7 @@ png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -139,12 +139,12 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
else
|
||||
ret = (png_malloc_default(png_ptr, size));
|
||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of memory!");
|
||||
png_error(png_ptr, "Out of memory");
|
||||
return (ret);
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
png_malloc_default(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
@@ -200,9 +200,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
{
|
||||
#ifndef PNG_USER_MEM_SUPPORTED
|
||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out Of Memory."); /* Note "O" and "M" */
|
||||
png_error(png_ptr, "Out Of Memory"); /* Note "O" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out Of Memory.");
|
||||
png_warning(png_ptr, "Out Of Memory");
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
@@ -228,9 +228,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
{
|
||||
#ifndef PNG_USER_MEM_SUPPORTED
|
||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out Of memory."); /* Note "O" and "M" */
|
||||
png_error(png_ptr, "Out Of memory"); /* Note "O" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out Of memory.");
|
||||
png_warning(png_ptr, "Out Of memory");
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
@@ -257,9 +257,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
{
|
||||
#ifndef PNG_USER_MEM_SUPPORTED
|
||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of Memory."); /* Note "o" and "M" */
|
||||
png_error(png_ptr, "Out of Memory"); /* Note "o" and "M" */
|
||||
else
|
||||
png_warning(png_ptr, "Out of Memory.");
|
||||
png_warning(png_ptr, "Out of Memory");
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
@@ -273,9 +273,9 @@ png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
if (ret == NULL)
|
||||
{
|
||||
if ((png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of memory."); /* Note "o" and "m" */
|
||||
png_error(png_ptr, "Out of memory"); /* Note "o" and "m" */
|
||||
else
|
||||
png_warning(png_ptr, "Out of memory."); /* Note "o" and "m" */
|
||||
png_warning(png_ptr, "Out of memory"); /* Note "o" and "m" */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -347,7 +347,7 @@ png_voidp /* PRIVATE */
|
||||
png_create_struct(int type)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_struct_2(type, png_malloc_ptr_NULL, png_voidp_NULL));
|
||||
return (png_create_struct_2(type, NULL, NULL));
|
||||
}
|
||||
|
||||
/* Allocate memory for a png_struct or a png_info. The malloc and
|
||||
@@ -401,7 +401,7 @@ void /* PRIVATE */
|
||||
png_destroy_struct(png_voidp struct_ptr)
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2(struct_ptr, png_free_ptr_NULL, png_voidp_NULL);
|
||||
png_destroy_struct_2(struct_ptr, NULL, NULL);
|
||||
}
|
||||
|
||||
/* Free memory allocated by a png_create_struct() call */
|
||||
@@ -442,7 +442,7 @@ png_destroy_struct_2(png_voidp struct_ptr, png_free_ptr free_fn,
|
||||
*/
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_calloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -453,7 +453,7 @@ png_calloc(png_structp png_ptr, png_uint_32 size)
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
|
||||
@@ -466,12 +466,12 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
else
|
||||
ret = (png_malloc_default(png_ptr, size));
|
||||
if (ret == NULL && (png_ptr->flags&PNG_FLAG_MALLOC_NULL_MEM_OK) == 0)
|
||||
png_error(png_ptr, "Out of Memory!");
|
||||
png_error(png_ptr, "Out of Memory");
|
||||
return (ret);
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_malloc_default(png_structp png_ptr, png_uint_32 size)
|
||||
png_malloc_default(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ret;
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
@@ -558,16 +558,13 @@ png_free_default(png_structp png_ptr, png_voidp ptr)
|
||||
|
||||
#endif /* Not Borland DOS special memory handler */
|
||||
|
||||
#ifdef PNG_1_0_X
|
||||
# define png_malloc_warn png_malloc
|
||||
#else
|
||||
/* This function was added at libpng version 1.2.3. The png_malloc_warn()
|
||||
* function will set up png_malloc() to issue a png_warning and return NULL
|
||||
* instead of issuing a png_error, if it fails to allocate the requested
|
||||
* memory.
|
||||
*/
|
||||
png_voidp PNGAPI
|
||||
png_malloc_warn(png_structp png_ptr, png_uint_32 size)
|
||||
png_malloc_warn(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
png_voidp ptr;
|
||||
png_uint_32 save_flags;
|
||||
@@ -580,34 +577,7 @@ png_malloc_warn(png_structp png_ptr, png_uint_32 size)
|
||||
png_ptr->flags=save_flags;
|
||||
return(ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_memcpy_check (png_structp png_ptr, png_voidp s1, png_voidp s2,
|
||||
png_uint_32 length)
|
||||
{
|
||||
png_size_t size;
|
||||
|
||||
size = (png_size_t)length;
|
||||
if ((png_uint_32)size != length)
|
||||
png_error(png_ptr, "Overflow in png_memcpy_check.");
|
||||
|
||||
return(png_memcpy (s1, s2, size));
|
||||
}
|
||||
|
||||
png_voidp PNGAPI
|
||||
png_memset_check (png_structp png_ptr, png_voidp s1, int value,
|
||||
png_uint_32 length)
|
||||
{
|
||||
png_size_t size;
|
||||
|
||||
size = (png_size_t)length;
|
||||
if ((png_uint_32)size != length)
|
||||
png_error(png_ptr, "Overflow in png_memset_check.");
|
||||
|
||||
return (png_memset (s1, value, size));
|
||||
|
||||
}
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
/* This function is called when the application wants to use another method
|
||||
|
||||
115
pngpread.c
115
pngpread.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpread.c - read a png file in push mode
|
||||
*
|
||||
* Last changed in libpng 1.2.38 [July 16, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -11,9 +11,9 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Push model modes */
|
||||
#define PNG_READ_SIG_MODE 0
|
||||
@@ -149,63 +149,61 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr)
|
||||
void /* PRIVATE */
|
||||
png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IHDR;
|
||||
PNG_CONST PNG_IDAT;
|
||||
PNG_CONST PNG_IEND;
|
||||
PNG_CONST PNG_PLTE;
|
||||
PNG_IHDR;
|
||||
PNG_IDAT;
|
||||
PNG_IEND;
|
||||
PNG_PLTE;
|
||||
#ifdef PNG_READ_bKGD_SUPPORTED
|
||||
PNG_CONST PNG_bKGD;
|
||||
PNG_bKGD;
|
||||
#endif
|
||||
#ifdef PNG_READ_cHRM_SUPPORTED
|
||||
PNG_CONST PNG_cHRM;
|
||||
PNG_cHRM;
|
||||
#endif
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
PNG_CONST PNG_gAMA;
|
||||
PNG_gAMA;
|
||||
#endif
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
PNG_CONST PNG_hIST;
|
||||
PNG_hIST;
|
||||
#endif
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
PNG_CONST PNG_iCCP;
|
||||
PNG_iCCP;
|
||||
#endif
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
PNG_CONST PNG_iTXt;
|
||||
PNG_iTXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_oFFs_SUPPORTED
|
||||
PNG_CONST PNG_oFFs;
|
||||
PNG_oFFs;
|
||||
#endif
|
||||
#ifdef PNG_READ_pCAL_SUPPORTED
|
||||
PNG_CONST PNG_pCAL;
|
||||
PNG_pCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_pHYs_SUPPORTED
|
||||
PNG_CONST PNG_pHYs;
|
||||
PNG_pHYs;
|
||||
#endif
|
||||
#ifdef PNG_READ_sBIT_SUPPORTED
|
||||
PNG_CONST PNG_sBIT;
|
||||
PNG_sBIT;
|
||||
#endif
|
||||
#ifdef PNG_READ_sCAL_SUPPORTED
|
||||
PNG_CONST PNG_sCAL;
|
||||
PNG_sCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_sRGB_SUPPORTED
|
||||
PNG_CONST PNG_sRGB;
|
||||
PNG_sRGB;
|
||||
#endif
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
PNG_CONST PNG_sPLT;
|
||||
PNG_sPLT;
|
||||
#endif
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
PNG_CONST PNG_tEXt;
|
||||
PNG_tEXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_tIME_SUPPORTED
|
||||
PNG_CONST PNG_tIME;
|
||||
PNG_tIME;
|
||||
#endif
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
PNG_CONST PNG_tRNS;
|
||||
PNG_tRNS;
|
||||
#endif
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
PNG_CONST PNG_zTXt;
|
||||
PNG_zTXt;
|
||||
#endif
|
||||
#endif /* PNG_USE_LOCAL_ARRAYS */
|
||||
|
||||
/* First we make sure we have enough data for the 4 byte chunk name
|
||||
* and the 4 byte chunk length before proceeding with decoding the
|
||||
@@ -323,7 +321,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||
return;
|
||||
|
||||
if (png_ptr->mode & PNG_AFTER_IDAT)
|
||||
png_error(png_ptr, "Too many IDAT's found");
|
||||
png_benign_error(png_ptr, "Too many IDATs found");
|
||||
}
|
||||
|
||||
png_ptr->idat_size = png_ptr->push_length;
|
||||
@@ -700,7 +698,7 @@ png_push_save_buffer(png_structp png_ptr)
|
||||
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
||||
old_buffer = png_ptr->save_buffer;
|
||||
png_ptr->save_buffer = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)new_max);
|
||||
(png_size_t)new_max);
|
||||
png_memcpy(png_ptr->save_buffer, old_buffer, png_ptr->save_buffer_size);
|
||||
png_free(png_ptr, old_buffer);
|
||||
png_ptr->save_buffer_max = new_max;
|
||||
@@ -729,9 +727,7 @@ png_push_restore_buffer(png_structp png_ptr, png_bytep buffer,
|
||||
void /* PRIVATE */
|
||||
png_push_read_IDAT(png_structp png_ptr)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IDAT;
|
||||
#endif
|
||||
PNG_IDAT;
|
||||
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
|
||||
{
|
||||
png_byte chunk_length[4];
|
||||
@@ -828,7 +824,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
||||
int ret;
|
||||
|
||||
if ((png_ptr->flags & PNG_FLAG_ZLIB_FINISHED) && buffer_length)
|
||||
png_error(png_ptr, "Extra compression data");
|
||||
png_benign_error(png_ptr, "Extra compression data");
|
||||
|
||||
png_ptr->zstream.next_in = buffer;
|
||||
png_ptr->zstream.avail_in = (uInt)buffer_length;
|
||||
@@ -840,7 +836,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
|
||||
if (ret == Z_STREAM_END)
|
||||
{
|
||||
if (png_ptr->zstream.avail_in)
|
||||
png_error(png_ptr, "Extra compressed data");
|
||||
png_benign_error(png_ptr, "Extra compressed data");
|
||||
|
||||
if (!(png_ptr->zstream.avail_out))
|
||||
{
|
||||
@@ -897,8 +893,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
|
||||
(int)(png_ptr->row_buf[0]));
|
||||
|
||||
png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
|
||||
png_ptr->rowbytes + 1);
|
||||
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);
|
||||
@@ -929,7 +924,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, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -938,14 +933,14 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
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, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -965,7 +960,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, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -985,7 +980,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, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -993,7 +988,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -1015,7 +1010,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
{
|
||||
for (i = 0; i < 2 && png_ptr->pass == 4; i++)
|
||||
{
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -1035,13 +1030,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, png_bytep_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, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -1060,7 +1055,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
|
||||
if (png_ptr->pass == 6) /* Skip top generated row */
|
||||
{
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
|
||||
@@ -1074,7 +1069,7 @@ png_push_process_row(png_structp png_ptr)
|
||||
if (png_ptr->pass != 6)
|
||||
break;
|
||||
|
||||
png_push_have_row(png_ptr, png_bytep_NULL);
|
||||
png_push_have_row(png_ptr, NULL);
|
||||
png_read_push_finish_row(png_ptr);
|
||||
}
|
||||
}
|
||||
@@ -1090,7 +1085,6 @@ png_push_process_row(png_structp png_ptr)
|
||||
void /* PRIVATE */
|
||||
png_read_push_finish_row(png_structp png_ptr)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||
|
||||
/* Start of interlace block */
|
||||
@@ -1109,7 +1103,6 @@ png_read_push_finish_row(png_structp png_ptr)
|
||||
* it, uncomment it here and in png.h
|
||||
PNG_CONST int FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||
*/
|
||||
#endif
|
||||
|
||||
png_ptr->row_number++;
|
||||
if (png_ptr->row_number < png_ptr->num_rows)
|
||||
@@ -1119,7 +1112,7 @@ png_read_push_finish_row(png_structp png_ptr)
|
||||
if (png_ptr->interlaced)
|
||||
{
|
||||
png_ptr->row_number = 0;
|
||||
png_memset_check(png_ptr, png_ptr->prev_row, 0,
|
||||
png_memset(png_ptr->prev_row, 0,
|
||||
png_ptr->rowbytes + 1);
|
||||
do
|
||||
{
|
||||
@@ -1179,7 +1172,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
#endif
|
||||
|
||||
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)(length + 1));
|
||||
(png_size_t)(length + 1));
|
||||
png_ptr->current_text[length] = '\0';
|
||||
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||
png_ptr->current_text_size = (png_size_t)length;
|
||||
@@ -1233,7 +1226,7 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
||||
text++;
|
||||
|
||||
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
text_ptr->compression = PNG_TEXT_COMPRESSION_NONE;
|
||||
text_ptr->key = key;
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
@@ -1249,7 +1242,7 @@ png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr)
|
||||
png_ptr->current_text = NULL;
|
||||
|
||||
if (ret)
|
||||
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||
png_warning(png_ptr, "Insufficient memory to store text chunk");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1279,7 +1272,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
#endif
|
||||
|
||||
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)(length + 1));
|
||||
(png_size_t)(length + 1));
|
||||
png_ptr->current_text[length] = '\0';
|
||||
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||
png_ptr->current_text_size = (png_size_t)length;
|
||||
@@ -1372,7 +1365,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
if (text == NULL)
|
||||
{
|
||||
text = (png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->zbuf_size
|
||||
(png_ptr->zbuf_size
|
||||
- png_ptr->zstream.avail_out + key_size + 1));
|
||||
|
||||
png_memcpy(text + key_size, png_ptr->zbuf,
|
||||
@@ -1391,7 +1384,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
tmp = text;
|
||||
text = (png_charp)png_malloc(png_ptr, text_size +
|
||||
(png_uint_32)(png_ptr->zbuf_size
|
||||
(png_ptr->zbuf_size
|
||||
- png_ptr->zstream.avail_out + 1));
|
||||
|
||||
png_memcpy(text, tmp, text_size);
|
||||
@@ -1435,7 +1428,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
text += key_size;
|
||||
|
||||
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt;
|
||||
text_ptr->key = key;
|
||||
#ifdef PNG_iTXt_SUPPORTED
|
||||
@@ -1450,7 +1443,7 @@ png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
png_free(png_ptr, text_ptr);
|
||||
|
||||
if (ret)
|
||||
png_warning(png_ptr, "Insufficient memory to store text chunk.");
|
||||
png_warning(png_ptr, "Insufficient memory to store text chunk");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1478,7 +1471,7 @@ png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
#endif
|
||||
|
||||
png_ptr->current_text = (png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)(length + 1));
|
||||
(png_size_t)(length + 1));
|
||||
png_ptr->current_text[length] = '\0';
|
||||
png_ptr->current_text_ptr = png_ptr->current_text;
|
||||
png_ptr->current_text_size = (png_size_t)length;
|
||||
@@ -1555,7 +1548,7 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
text++;
|
||||
|
||||
text_ptr = (png_textp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
|
||||
text_ptr->compression = comp_flag + 2;
|
||||
text_ptr->key = key;
|
||||
@@ -1571,7 +1564,7 @@ png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
png_free(png_ptr, text_ptr);
|
||||
if (ret)
|
||||
png_warning(png_ptr, "Insufficient memory to store iTXt chunk.");
|
||||
png_warning(png_ptr, "Insufficient memory to store iTXt chunk");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1626,7 +1619,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
else
|
||||
{
|
||||
png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)length);
|
||||
(png_size_t)length);
|
||||
png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, length);
|
||||
}
|
||||
|
||||
@@ -1691,10 +1684,8 @@ void PNGAPI
|
||||
png_progressive_combine_row (png_structp png_ptr,
|
||||
png_bytep old_row, png_bytep new_row)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST int FARDATA png_pass_dsp_mask[7] =
|
||||
{0xff, 0x0f, 0xff, 0x33, 0xff, 0x55, 0xff};
|
||||
#endif
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
964
pngpriv.h
Normal file
964
pngpriv.h
Normal file
@@ -0,0 +1,964 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* libpng version 1.4.0beta97 - November 13, 2009
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* The symbols declared in this file (including the functions declared
|
||||
* as PNG_EXTERN) are PRIVATE. They are not part of the libpng public
|
||||
* interface, and are not recommended for use by regular applications.
|
||||
* Some of them may become public in the future; others may stay private,
|
||||
* change in an incompatible way, or even disappear.
|
||||
* Although the libpng users are not forbidden to include this header,
|
||||
* they should be well aware of the issues that may arise from doing so.
|
||||
*/
|
||||
|
||||
#ifndef PNGPRIV_H
|
||||
#define PNGPRIV_H
|
||||
|
||||
#ifndef PNG_VERSION_INFO_ONLY
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* 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
|
||||
|
||||
/* Other defines specific to compilers can go here. Try to keep
|
||||
* them inside an appropriate ifdef/endif pair for portability.
|
||||
*/
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
# ifdef MACOS
|
||||
/* We need to check that <math.h> hasn't already been included earlier
|
||||
* as it seems it doesn't agree with <fp.h>, yet we should really use
|
||||
* <fp.h> if possible.
|
||||
*/
|
||||
# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
|
||||
# include <fp.h>
|
||||
# endif
|
||||
# else
|
||||
# include <math.h>
|
||||
# endif
|
||||
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
|
||||
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
|
||||
* MATH=68881
|
||||
*/
|
||||
# include <m68881.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Codewarrior on NT has linking problems without this. */
|
||||
#if (defined(__MWERKS__) && defined(WIN32)) || defined(__STDC__)
|
||||
# define PNG_ALWAYS_EXTERN
|
||||
#endif
|
||||
|
||||
/* This provides the non-ANSI (far) memory allocation routines. */
|
||||
#if defined(__TURBOC__) && defined(__MSDOS__)
|
||||
# include <mem.h>
|
||||
# include <alloc.h>
|
||||
#endif
|
||||
|
||||
#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
|
||||
* zero automatically when the structure is created.
|
||||
*/
|
||||
#define PNG_HAVE_IHDR 0x01
|
||||
#define PNG_HAVE_PLTE 0x02
|
||||
#define PNG_HAVE_IDAT 0x04
|
||||
#define PNG_AFTER_IDAT 0x08 /* Have complete zlib datastream */
|
||||
#define PNG_HAVE_IEND 0x10
|
||||
#define PNG_HAVE_gAMA 0x20
|
||||
#define PNG_HAVE_cHRM 0x40
|
||||
#define PNG_HAVE_sRGB 0x80
|
||||
#define PNG_HAVE_CHUNK_HEADER 0x100
|
||||
#define PNG_WROTE_tIME 0x200
|
||||
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400
|
||||
#define PNG_BACKGROUND_IS_GRAY 0x800
|
||||
#define PNG_HAVE_PNG_SIGNATURE 0x1000
|
||||
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
|
||||
|
||||
/* Flags for the transformations the PNG library does on the image data */
|
||||
#define PNG_BGR 0x0001
|
||||
#define PNG_INTERLACE 0x0002
|
||||
#define PNG_PACK 0x0004
|
||||
#define PNG_SHIFT 0x0008
|
||||
#define PNG_SWAP_BYTES 0x0010
|
||||
#define PNG_INVERT_MONO 0x0020
|
||||
#define PNG_DITHER 0x0040
|
||||
#define PNG_BACKGROUND 0x0080
|
||||
#define PNG_BACKGROUND_EXPAND 0x0100
|
||||
/* 0x0200 unused */
|
||||
#define PNG_16_TO_8 0x0400
|
||||
#define PNG_RGBA 0x0800
|
||||
#define PNG_EXPAND 0x1000
|
||||
#define PNG_GAMMA 0x2000
|
||||
#define PNG_GRAY_TO_RGB 0x4000
|
||||
#define PNG_FILLER 0x8000L
|
||||
#define PNG_PACKSWAP 0x10000L
|
||||
#define PNG_SWAP_ALPHA 0x20000L
|
||||
#define PNG_STRIP_ALPHA 0x40000L
|
||||
#define PNG_INVERT_ALPHA 0x80000L
|
||||
#define PNG_USER_TRANSFORM 0x100000L
|
||||
#define PNG_RGB_TO_GRAY_ERR 0x200000L
|
||||
#define PNG_RGB_TO_GRAY_WARN 0x400000L
|
||||
#define PNG_RGB_TO_GRAY 0x600000L /* two bits, RGB_TO_GRAY_ERR|WARN */
|
||||
/* 0x800000L Unused */
|
||||
#define PNG_ADD_ALPHA 0x1000000L /* Added to libpng-1.2.7 */
|
||||
#define PNG_EXPAND_tRNS 0x2000000L /* Added to libpng-1.2.9 */
|
||||
#define PNG_PREMULTIPLY_ALPHA 0x4000000L /* Added to libpng-1.4.0 */
|
||||
/* by volker */
|
||||
/* 0x8000000L unused */
|
||||
/* 0x10000000L unused */
|
||||
/* 0x20000000L unused */
|
||||
/* 0x40000000L unused */
|
||||
|
||||
/* Flags for png_create_struct */
|
||||
#define PNG_STRUCT_PNG 0x0001
|
||||
#define PNG_STRUCT_INFO 0x0002
|
||||
|
||||
/* Scaling factor for filter heuristic weighting calculations */
|
||||
#define PNG_WEIGHT_SHIFT 8
|
||||
#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT))
|
||||
#define PNG_COST_SHIFT 3
|
||||
#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT))
|
||||
|
||||
/* Flags for the png_ptr->flags rather than declaring a byte for each one */
|
||||
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001
|
||||
#define PNG_FLAG_ZLIB_CUSTOM_LEVEL 0x0002
|
||||
#define PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL 0x0004
|
||||
#define PNG_FLAG_ZLIB_CUSTOM_WINDOW_BITS 0x0008
|
||||
#define PNG_FLAG_ZLIB_CUSTOM_METHOD 0x0010
|
||||
#define PNG_FLAG_ZLIB_FINISHED 0x0020
|
||||
#define PNG_FLAG_ROW_INIT 0x0040
|
||||
#define PNG_FLAG_FILLER_AFTER 0x0080
|
||||
#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100
|
||||
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200
|
||||
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400
|
||||
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800
|
||||
/* 0x1000 unused */
|
||||
/* 0x2000 unused */
|
||||
/* 0x4000 unused */
|
||||
#define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000L
|
||||
#define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000L
|
||||
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000L
|
||||
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000L
|
||||
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000L
|
||||
#define PNG_FLAG_MALLOC_NULL_MEM_OK 0x100000L
|
||||
#define PNG_FLAG_ADD_ALPHA 0x200000L /* Added to libpng-1.2.8 */
|
||||
#define PNG_FLAG_STRIP_ALPHA 0x400000L /* Added to libpng-1.2.8 */
|
||||
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x800000L /* Added to libpng-1.4.0 */
|
||||
/* 0x1000000L unused */
|
||||
/* 0x2000000L unused */
|
||||
/* 0x4000000L unused */
|
||||
/* 0x8000000L unused */
|
||||
/* 0x10000000L unused */
|
||||
/* 0x20000000L unused */
|
||||
/* 0x40000000L unused */
|
||||
|
||||
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
|
||||
PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
||||
|
||||
#define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \
|
||||
PNG_FLAG_CRC_CRITICAL_IGNORE)
|
||||
|
||||
#define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \
|
||||
PNG_FLAG_CRC_CRITICAL_MASK)
|
||||
|
||||
/* Save typing and make code easier to understand */
|
||||
|
||||
#define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \
|
||||
abs((int)((c1).green) - (int)((c2).green)) + \
|
||||
abs((int)((c1).blue) - (int)((c2).blue)))
|
||||
|
||||
/* Added to libpng-1.2.6 JB */
|
||||
#define PNG_ROWBYTES(pixel_bits, width) \
|
||||
((pixel_bits) >= 8 ? \
|
||||
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
|
||||
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
|
||||
|
||||
/* PNG_OUT_OF_RANGE returns true if value is outside the range
|
||||
* ideal-delta..ideal+delta. Each argument is evaluated twice.
|
||||
* "ideal" and "delta" should be constants, normally simple
|
||||
* integers, "value" a variable. Added to libpng-1.2.6 JB
|
||||
*/
|
||||
#define PNG_OUT_OF_RANGE(value, ideal, delta) \
|
||||
( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) )
|
||||
|
||||
/* Constant strings for known chunk types. If you need to add a chunk,
|
||||
* define the name here, and add an invocation of the macro wherever it's
|
||||
* needed.
|
||||
*/
|
||||
#define PNG_IHDR PNG_CONST png_byte png_IHDR[5] = { 73, 72, 68, 82, '\0'}
|
||||
#define PNG_IDAT PNG_CONST png_byte png_IDAT[5] = { 73, 68, 65, 84, '\0'}
|
||||
#define PNG_IEND PNG_CONST png_byte png_IEND[5] = { 73, 69, 78, 68, '\0'}
|
||||
#define PNG_PLTE PNG_CONST png_byte png_PLTE[5] = { 80, 76, 84, 69, '\0'}
|
||||
#define PNG_bKGD PNG_CONST png_byte png_bKGD[5] = { 98, 75, 71, 68, '\0'}
|
||||
#define PNG_cHRM PNG_CONST png_byte png_cHRM[5] = { 99, 72, 82, 77, '\0'}
|
||||
#define PNG_gAMA PNG_CONST png_byte png_gAMA[5] = {103, 65, 77, 65, '\0'}
|
||||
#define PNG_hIST PNG_CONST png_byte png_hIST[5] = {104, 73, 83, 84, '\0'}
|
||||
#define PNG_iCCP PNG_CONST png_byte png_iCCP[5] = {105, 67, 67, 80, '\0'}
|
||||
#define PNG_iTXt PNG_CONST png_byte png_iTXt[5] = {105, 84, 88, 116, '\0'}
|
||||
#define PNG_oFFs PNG_CONST png_byte png_oFFs[5] = {111, 70, 70, 115, '\0'}
|
||||
#define PNG_pCAL PNG_CONST png_byte png_pCAL[5] = {112, 67, 65, 76, '\0'}
|
||||
#define PNG_sCAL PNG_CONST png_byte png_sCAL[5] = {115, 67, 65, 76, '\0'}
|
||||
#define PNG_pHYs PNG_CONST png_byte png_pHYs[5] = {112, 72, 89, 115, '\0'}
|
||||
#define PNG_sBIT PNG_CONST png_byte png_sBIT[5] = {115, 66, 73, 84, '\0'}
|
||||
#define PNG_sPLT PNG_CONST png_byte png_sPLT[5] = {115, 80, 76, 84, '\0'}
|
||||
#define PNG_sRGB PNG_CONST png_byte png_sRGB[5] = {115, 82, 71, 66, '\0'}
|
||||
#define PNG_sTER PNG_CONST png_byte png_sTER[5] = {115, 84, 69, 82, '\0'}
|
||||
#define PNG_tEXt PNG_CONST png_byte png_tEXt[5] = {116, 69, 88, 116, '\0'}
|
||||
#define PNG_tIME PNG_CONST png_byte png_tIME[5] = {116, 73, 77, 69, '\0'}
|
||||
#define PNG_tRNS PNG_CONST png_byte png_tRNS[5] = {116, 82, 78, 83, '\0'}
|
||||
#define PNG_zTXt PNG_CONST png_byte png_zTXt[5] = {122, 84, 88, 116, '\0'}
|
||||
|
||||
|
||||
/* Inhibit C++ name-mangling for libpng functions but not for system calls. */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* These functions are used internally in the code. They generally
|
||||
* shouldn't be used unless you are writing code to add or replace some
|
||||
* functionality in libpng. More information about most functions can
|
||||
* be found in the files where the functions are located.
|
||||
*/
|
||||
|
||||
/* Allocate memory for an internal libpng struct */
|
||||
PNG_EXTERN png_voidp png_create_struct PNGARG((int type));
|
||||
|
||||
/* Free memory from internal libpng struct */
|
||||
PNG_EXTERN void png_destroy_struct PNGARG((png_voidp struct_ptr));
|
||||
|
||||
PNG_EXTERN png_voidp png_create_struct_2 PNGARG((int type, png_malloc_ptr
|
||||
malloc_fn, png_voidp mem_ptr));
|
||||
PNG_EXTERN void png_destroy_struct_2 PNGARG((png_voidp struct_ptr,
|
||||
png_free_ptr free_fn, png_voidp mem_ptr));
|
||||
|
||||
/* Free any memory that info_ptr points to and reset struct. */
|
||||
PNG_EXTERN void png_info_destroy PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
|
||||
/* Function to allocate memory for zlib. PNGAPI is disallowed. */
|
||||
PNG_EXTERN voidpf png_zalloc PNGARG((voidpf png_ptr, uInt items, uInt size));
|
||||
|
||||
/* Function to free memory for zlib. PNGAPI is disallowed. */
|
||||
PNG_EXTERN void png_zfree PNGARG((voidpf png_ptr, voidpf ptr));
|
||||
|
||||
/* Next four functions are used internally as callbacks. PNGAPI is required
|
||||
* but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3. */
|
||||
|
||||
PNG_EXTERN void PNGAPI png_default_read_data PNGARG((png_structp png_ptr,
|
||||
png_bytep data, png_size_t length));
|
||||
|
||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
PNG_EXTERN void PNGAPI png_push_fill_buffer PNGARG((png_structp png_ptr,
|
||||
png_bytep buffer, png_size_t length));
|
||||
#endif
|
||||
|
||||
PNG_EXTERN void PNGAPI png_default_write_data PNGARG((png_structp png_ptr,
|
||||
png_bytep data, png_size_t length));
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
PNG_EXTERN void PNGAPI png_default_flush PNGARG((png_structp png_ptr));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Reset the CRC variable */
|
||||
PNG_EXTERN void png_reset_crc PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Write the "data" buffer to whatever output you are using */
|
||||
PNG_EXTERN void png_write_data PNGARG((png_structp png_ptr, png_bytep data,
|
||||
png_size_t length));
|
||||
|
||||
/* Read the chunk header (length + type name) */
|
||||
PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Read data from whatever input you are using into the "data" buffer */
|
||||
PNG_EXTERN void png_read_data PNGARG((png_structp png_ptr, png_bytep data,
|
||||
png_size_t length));
|
||||
|
||||
/* Read bytes into buf, and update png_ptr->crc */
|
||||
PNG_EXTERN void png_crc_read PNGARG((png_structp png_ptr, png_bytep buf,
|
||||
png_size_t length));
|
||||
|
||||
/* Decompress data in a chunk that uses compression */
|
||||
#if defined(PNG_zTXt_SUPPORTED) || defined(PNG_iTXt_SUPPORTED) || \
|
||||
defined(PNG_iCCP_SUPPORTED) || defined(PNG_sPLT_SUPPORTED)
|
||||
PNG_EXTERN void png_decompress_chunk PNGARG((png_structp png_ptr,
|
||||
int comp_type, png_size_t chunklength, png_size_t prefix_length,
|
||||
png_size_t *data_length));
|
||||
#endif
|
||||
|
||||
/* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */
|
||||
PNG_EXTERN int png_crc_finish PNGARG((png_structp png_ptr, png_uint_32 skip));
|
||||
|
||||
/* Read the CRC from the file and compare it to the libpng calculated CRC */
|
||||
PNG_EXTERN int png_crc_error PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Calculate the CRC over a section of data. Note that we are only
|
||||
* passing a maximum of 64K on systems that have this as a memory limit,
|
||||
* since this is the maximum buffer size we can specify.
|
||||
*/
|
||||
PNG_EXTERN void png_calculate_crc PNGARG((png_structp png_ptr, png_bytep ptr,
|
||||
png_size_t length));
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
PNG_EXTERN void png_flush PNGARG((png_structp png_ptr));
|
||||
#endif
|
||||
|
||||
/* Write various chunks */
|
||||
|
||||
/* Write the IHDR chunk, and update the png_struct with the necessary
|
||||
* information.
|
||||
*/
|
||||
PNG_EXTERN void png_write_IHDR PNGARG((png_structp png_ptr, png_uint_32 width,
|
||||
png_uint_32 height,
|
||||
int bit_depth, int color_type, int compression_method, int filter_method,
|
||||
int interlace_method));
|
||||
|
||||
PNG_EXTERN void png_write_PLTE PNGARG((png_structp png_ptr, png_colorp palette,
|
||||
png_uint_32 num_pal));
|
||||
|
||||
PNG_EXTERN void png_write_IDAT PNGARG((png_structp png_ptr, png_bytep data,
|
||||
png_size_t length));
|
||||
|
||||
PNG_EXTERN void png_write_IEND PNGARG((png_structp png_ptr));
|
||||
|
||||
#ifdef PNG_WRITE_gAMA_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
PNG_EXTERN void png_write_gAMA PNGARG((png_structp png_ptr, double file_gamma));
|
||||
#endif
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
PNG_EXTERN void png_write_gAMA_fixed PNGARG((png_structp png_ptr, png_fixed_point
|
||||
file_gamma));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_sBIT_SUPPORTED
|
||||
PNG_EXTERN void png_write_sBIT PNGARG((png_structp png_ptr, png_color_8p sbit,
|
||||
int color_type));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_cHRM_SUPPORTED
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_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));
|
||||
#endif
|
||||
PNG_EXTERN void png_write_cHRM_fixed PNGARG((png_structp png_ptr,
|
||||
png_fixed_point int_white_x, png_fixed_point int_white_y,
|
||||
png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
|
||||
int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
|
||||
png_fixed_point int_blue_y));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_sRGB_SUPPORTED
|
||||
PNG_EXTERN void png_write_sRGB PNGARG((png_structp png_ptr,
|
||||
int intent));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_iCCP_SUPPORTED
|
||||
PNG_EXTERN void png_write_iCCP PNGARG((png_structp png_ptr,
|
||||
png_charp name, int compression_type,
|
||||
png_charp profile, int proflen));
|
||||
/* Note to maintainer: profile should be png_bytep */
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_sPLT_SUPPORTED
|
||||
PNG_EXTERN void png_write_sPLT PNGARG((png_structp png_ptr,
|
||||
png_sPLT_tp palette));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_tRNS_SUPPORTED
|
||||
PNG_EXTERN void png_write_tRNS PNGARG((png_structp png_ptr, png_bytep trans,
|
||||
png_color_16p values, int number, int color_type));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_bKGD_SUPPORTED
|
||||
PNG_EXTERN void png_write_bKGD PNGARG((png_structp png_ptr,
|
||||
png_color_16p values, int color_type));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_hIST_SUPPORTED
|
||||
PNG_EXTERN void png_write_hIST PNGARG((png_structp png_ptr, png_uint_16p hist,
|
||||
int num_hist));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_WRITE_TEXT_SUPPORTED) || defined(PNG_WRITE_pCAL_SUPPORTED) || \
|
||||
defined(PNG_WRITE_iCCP_SUPPORTED) || defined(PNG_WRITE_sPLT_SUPPORTED)
|
||||
PNG_EXTERN png_size_t png_check_keyword PNGARG((png_structp png_ptr,
|
||||
png_charp key, png_charpp new_key));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_tEXt_SUPPORTED
|
||||
PNG_EXTERN void png_write_tEXt PNGARG((png_structp png_ptr, png_charp key,
|
||||
png_charp text, png_size_t text_len));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_zTXt_SUPPORTED
|
||||
PNG_EXTERN void png_write_zTXt PNGARG((png_structp png_ptr, png_charp key,
|
||||
png_charp text, png_size_t text_len, int compression));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_iTXt_SUPPORTED
|
||||
PNG_EXTERN void png_write_iTXt PNGARG((png_structp png_ptr,
|
||||
int compression, png_charp key, png_charp lang, png_charp lang_key,
|
||||
png_charp text));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */
|
||||
PNG_EXTERN int png_set_text_2 PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_textp text_ptr, int num_text));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_oFFs_SUPPORTED
|
||||
PNG_EXTERN void png_write_oFFs PNGARG((png_structp png_ptr,
|
||||
png_int_32 x_offset, png_int_32 y_offset, int unit_type));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_pCAL_SUPPORTED
|
||||
PNG_EXTERN void png_write_pCAL PNGARG((png_structp png_ptr, png_charp purpose,
|
||||
png_int_32 X0, png_int_32 X1, int type, int nparams,
|
||||
png_charp units, png_charpp params));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_pHYs_SUPPORTED
|
||||
PNG_EXTERN void png_write_pHYs PNGARG((png_structp png_ptr,
|
||||
png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit,
|
||||
int unit_type));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_tIME_SUPPORTED
|
||||
PNG_EXTERN void png_write_tIME PNGARG((png_structp png_ptr,
|
||||
png_timep mod_time));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_sCAL_SUPPORTED
|
||||
#if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_STDIO_SUPPORTED)
|
||||
PNG_EXTERN void png_write_sCAL PNGARG((png_structp png_ptr,
|
||||
int unit, double width, double height));
|
||||
#else
|
||||
#ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
PNG_EXTERN void png_write_sCAL_s PNGARG((png_structp png_ptr,
|
||||
int unit, png_charp width, png_charp height));
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Called when finished processing a row of data */
|
||||
PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Internal use only. Called before first row of data */
|
||||
PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
|
||||
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr));
|
||||
#endif
|
||||
|
||||
/* Combine a row of data, dealing with alpha, etc. if requested */
|
||||
PNG_EXTERN void png_combine_row PNGARG((png_structp png_ptr, png_bytep row,
|
||||
int mask));
|
||||
|
||||
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||
/* Expand an interlaced row */
|
||||
/* OLD pre-1.0.9 interface:
|
||||
PNG_EXTERN void png_do_read_interlace PNGARG((png_row_infop row_info,
|
||||
png_bytep row, int pass, png_uint_32 transformations));
|
||||
*/
|
||||
PNG_EXTERN void png_do_read_interlace PNGARG((png_structp png_ptr));
|
||||
#endif
|
||||
|
||||
/* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */
|
||||
|
||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||
/* Grab pixels out of a row for an interlaced pass */
|
||||
PNG_EXTERN void png_do_write_interlace PNGARG((png_row_infop row_info,
|
||||
png_bytep row, int pass));
|
||||
#endif
|
||||
|
||||
/* Unfilter a row */
|
||||
PNG_EXTERN void png_read_filter_row PNGARG((png_structp png_ptr,
|
||||
png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter));
|
||||
|
||||
/* Choose the best filter to use and filter the row data */
|
||||
PNG_EXTERN void png_write_find_filter PNGARG((png_structp png_ptr,
|
||||
png_row_infop row_info));
|
||||
|
||||
/* Write out the filtered row. */
|
||||
PNG_EXTERN void png_write_filtered_row PNGARG((png_structp png_ptr,
|
||||
png_bytep filtered_row));
|
||||
/* Finish a row while reading, dealing with interlacing passes, etc. */
|
||||
PNG_EXTERN void png_read_finish_row PNGARG((png_structp png_ptr));
|
||||
|
||||
/* Initialize the row buffers, etc. */
|
||||
PNG_EXTERN void png_read_start_row PNGARG((png_structp png_ptr));
|
||||
/* Optional call to update the users info structure */
|
||||
PNG_EXTERN void png_read_transform_info PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
|
||||
/* These are the functions that do the transformations */
|
||||
#ifdef PNG_READ_FILLER_SUPPORTED
|
||||
PNG_EXTERN void png_do_read_filler PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_uint_32 filler, png_uint_32 flags));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
||||
PNG_EXTERN void png_do_read_swap_alpha PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||
PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||
PNG_EXTERN void png_do_read_invert_alpha PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||
PNG_EXTERN void png_do_write_invert_alpha PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
|
||||
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
||||
PNG_EXTERN void png_do_strip_filler PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_uint_32 flags));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
|
||||
PNG_EXTERN void png_do_read_premultiply_alpha
|
||||
PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED)
|
||||
PNG_EXTERN void png_do_swap PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_PACKSWAP_SUPPORTED) || defined(PNG_WRITE_PACKSWAP_SUPPORTED)
|
||||
PNG_EXTERN void png_do_packswap PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
||||
PNG_EXTERN int png_do_rgb_to_gray PNGARG((png_structp png_ptr, png_row_infop
|
||||
row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||
PNG_EXTERN void png_do_gray_to_rgb PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PACK_SUPPORTED
|
||||
PNG_EXTERN void png_do_unpack PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
||||
PNG_EXTERN void png_do_unshift PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_8p sig_bits));
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
|
||||
PNG_EXTERN void png_do_invert PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
PNG_EXTERN void png_do_chop PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_DITHER_SUPPORTED
|
||||
PNG_EXTERN void png_do_dither PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_bytep palette_lookup, png_bytep dither_lookup));
|
||||
|
||||
# ifdef PNG_CORRECT_PALETTE_SUPPORTED
|
||||
PNG_EXTERN void png_correct_palette PNGARG((png_structp png_ptr,
|
||||
png_colorp palette, int num_palette));
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
|
||||
PNG_EXTERN void png_do_bgr PNGARG((png_row_infop row_info, png_bytep row));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||
PNG_EXTERN void png_do_pack PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_uint_32 bit_depth));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
||||
PNG_EXTERN void png_do_shift PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_8p bit_depth));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_color, png_color_16p background,
|
||||
png_color_16p background_1,
|
||||
png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
|
||||
png_uint_16pp gamma_16, png_uint_16pp gamma_16_from_1,
|
||||
png_uint_16pp gamma_16_to_1, int gamma_shift));
|
||||
#else
|
||||
PNG_EXTERN void png_do_background PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_color, png_color_16p background));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
PNG_EXTERN void png_do_gamma PNGARG((png_row_infop row_info, png_bytep row,
|
||||
png_bytep gamma_table, png_uint_16pp gamma_16_table,
|
||||
int gamma_shift));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||
PNG_EXTERN void png_do_expand_palette PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_colorp palette, png_bytep trans, int num_trans));
|
||||
PNG_EXTERN void png_do_expand PNGARG((png_row_infop row_info,
|
||||
png_bytep row, png_color_16p trans_value));
|
||||
#endif
|
||||
|
||||
/* The following decodes the appropriate chunks, and does error correction,
|
||||
* then calls the appropriate callback for the chunk if it is valid.
|
||||
*/
|
||||
|
||||
/* Decode the IHDR chunk */
|
||||
PNG_EXTERN void png_handle_IHDR PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
PNG_EXTERN void png_handle_PLTE PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
PNG_EXTERN void png_handle_IEND PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
|
||||
#ifdef PNG_READ_bKGD_SUPPORTED
|
||||
PNG_EXTERN void png_handle_bKGD PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_cHRM_SUPPORTED
|
||||
PNG_EXTERN void png_handle_cHRM PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
PNG_EXTERN void png_handle_gAMA PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
PNG_EXTERN void png_handle_hIST PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
extern void png_handle_iCCP PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif /* PNG_READ_iCCP_SUPPORTED */
|
||||
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
PNG_EXTERN void png_handle_iTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_oFFs_SUPPORTED
|
||||
PNG_EXTERN void png_handle_oFFs PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_pCAL_SUPPORTED
|
||||
PNG_EXTERN void png_handle_pCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_pHYs_SUPPORTED
|
||||
PNG_EXTERN void png_handle_pHYs PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_sBIT_SUPPORTED
|
||||
PNG_EXTERN void png_handle_sBIT PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_sCAL_SUPPORTED
|
||||
PNG_EXTERN void png_handle_sCAL PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
extern void png_handle_sPLT PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif /* PNG_READ_sPLT_SUPPORTED */
|
||||
|
||||
#ifdef PNG_READ_sRGB_SUPPORTED
|
||||
PNG_EXTERN void png_handle_sRGB PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
PNG_EXTERN void png_handle_tEXt PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_tIME_SUPPORTED
|
||||
PNG_EXTERN void png_handle_tIME PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
PNG_EXTERN void png_handle_tRNS PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr,
|
||||
png_uint_32 length));
|
||||
#endif
|
||||
|
||||
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
|
||||
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
|
||||
png_bytep chunk_name));
|
||||
|
||||
/* Handle the transformations for reading and writing */
|
||||
PNG_EXTERN void png_do_read_transformations PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_do_write_transformations PNGARG((png_structp png_ptr));
|
||||
|
||||
PNG_EXTERN void png_init_read_transformations PNGARG((png_structp png_ptr));
|
||||
|
||||
#ifdef PNG_PROGRESSIVE_READ_SUPPORTED
|
||||
PNG_EXTERN void png_push_read_chunk PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_push_read_sig PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_push_check_crc PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_push_crc_skip PNGARG((png_structp png_ptr,
|
||||
png_uint_32 length));
|
||||
PNG_EXTERN void png_push_crc_finish PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_push_save_buffer PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_push_restore_buffer PNGARG((png_structp png_ptr,
|
||||
png_bytep buffer, png_size_t buffer_length));
|
||||
PNG_EXTERN void png_push_read_IDAT PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_process_IDAT_data PNGARG((png_structp png_ptr,
|
||||
png_bytep buffer, png_size_t buffer_length));
|
||||
PNG_EXTERN void png_push_process_row PNGARG((png_structp png_ptr));
|
||||
PNG_EXTERN void png_push_handle_unknown PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
PNG_EXTERN void png_push_have_info PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_push_have_end PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_push_have_row PNGARG((png_structp png_ptr, png_bytep row));
|
||||
PNG_EXTERN void png_push_read_end PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_process_some_data PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
PNG_EXTERN void png_read_push_finish_row PNGARG((png_structp png_ptr));
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
PNG_EXTERN void png_push_handle_tEXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
PNG_EXTERN void png_push_read_tEXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
#endif
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
PNG_EXTERN void png_push_handle_zTXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
PNG_EXTERN void png_push_read_zTXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
#endif
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
PNG_EXTERN void png_push_handle_iTXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr, png_uint_32 length));
|
||||
PNG_EXTERN void png_push_read_iTXt PNGARG((png_structp png_ptr,
|
||||
png_infop info_ptr));
|
||||
#endif
|
||||
|
||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||
|
||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||
PNG_EXTERN void png_do_read_intrapixel PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
PNG_EXTERN void png_do_write_intrapixel PNGARG((png_row_infop row_info,
|
||||
png_bytep row));
|
||||
#endif
|
||||
|
||||
/* Added at libpng version 1.4.0 */
|
||||
#ifdef PNG_cHRM_SUPPORTED
|
||||
PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr,
|
||||
png_fixed_point int_white_x, png_fixed_point int_white_y,
|
||||
png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point
|
||||
int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x,
|
||||
png_fixed_point int_blue_y));
|
||||
#endif
|
||||
|
||||
#ifdef PNG_cHRM_SUPPORTED
|
||||
#ifdef PNG_CHECK_cHRM_SUPPORTED
|
||||
/* Added at libpng version 1.2.34 and 1.4.0 */
|
||||
PNG_EXTERN void png_64bit_product PNGARG((long v1, long v2,
|
||||
unsigned long *hi_product, unsigned long *lo_product));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Added at libpng version 1.4.0 */
|
||||
PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr,
|
||||
png_uint_32 width, png_uint_32 height, int bit_depth,
|
||||
int color_type, int interlace_type, int compression_type,
|
||||
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_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));
|
||||
|
||||
#ifdef USE_FAR_KEYWORD /* memory model conversion function */
|
||||
extern void *png_far_to_near PNGARG((png_structp png_ptr,png_voidp ptr,
|
||||
int check));
|
||||
#endif /* USE_FAR_KEYWORD */
|
||||
|
||||
/* Define PNG_DEBUG at compile time for debugging information. Higher
|
||||
* numbers for PNG_DEBUG mean more debugging information. This has
|
||||
* only been added since version 0.95 so it is not implemented throughout
|
||||
* libpng yet, but more support will be added as needed.
|
||||
*/
|
||||
#ifdef PNG_DEBUG
|
||||
#if (PNG_DEBUG > 0)
|
||||
#if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER)
|
||||
#include <crtdbg.h>
|
||||
#if (PNG_DEBUG > 1)
|
||||
#ifndef _DEBUG
|
||||
# define _DEBUG
|
||||
#endif
|
||||
#ifndef png_debug
|
||||
#define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE)
|
||||
#endif
|
||||
#ifndef png_debug1
|
||||
#define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1)
|
||||
#endif
|
||||
#ifndef png_debug2
|
||||
#define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2)
|
||||
#endif
|
||||
#endif
|
||||
#else /* PNG_DEBUG_FILE || !_MSC_VER */
|
||||
#ifndef PNG_DEBUG_FILE
|
||||
#define PNG_DEBUG_FILE stderr
|
||||
#endif /* PNG_DEBUG_FILE */
|
||||
|
||||
#if (PNG_DEBUG > 1)
|
||||
/* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on
|
||||
* non-ISO compilers
|
||||
*/
|
||||
# ifdef __STDC__
|
||||
# ifndef png_debug
|
||||
# define png_debug(l,m) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \
|
||||
}
|
||||
# endif
|
||||
# ifndef png_debug1
|
||||
# define png_debug1(l,m,p1) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \
|
||||
}
|
||||
# endif
|
||||
# ifndef png_debug2
|
||||
# define png_debug2(l,m,p1,p2) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \
|
||||
}
|
||||
# endif
|
||||
# else /* __STDC __ */
|
||||
# ifndef png_debug
|
||||
# define png_debug(l,m) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
char format[256]; \
|
||||
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
|
||||
m,PNG_STRING_NEWLINE); \
|
||||
fprintf(PNG_DEBUG_FILE,format); \
|
||||
}
|
||||
# endif
|
||||
# ifndef png_debug1
|
||||
# define png_debug1(l,m,p1) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
char format[256]; \
|
||||
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
|
||||
m,PNG_STRING_NEWLINE); \
|
||||
fprintf(PNG_DEBUG_FILE,format,p1); \
|
||||
}
|
||||
# endif
|
||||
# ifndef png_debug2
|
||||
# define png_debug2(l,m,p1,p2) \
|
||||
{ \
|
||||
int num_tabs=l; \
|
||||
char format[256]; \
|
||||
snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \
|
||||
(num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \
|
||||
m,PNG_STRING_NEWLINE); \
|
||||
fprintf(PNG_DEBUG_FILE,format,p1,p2); \
|
||||
}
|
||||
# endif
|
||||
# endif /* __STDC __ */
|
||||
#endif /* (PNG_DEBUG > 1) */
|
||||
|
||||
#endif /* _MSC_VER */
|
||||
#endif /* (PNG_DEBUG > 0) */
|
||||
#endif /* PNG_DEBUG */
|
||||
#ifndef png_debug
|
||||
#define png_debug(l, m)
|
||||
#endif
|
||||
#ifndef png_debug1
|
||||
#define png_debug1(l, m, p1)
|
||||
#endif
|
||||
#ifndef png_debug2
|
||||
#define png_debug2(l, m, p1, p2)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
extern PNG_EXPORT(png_bytep,png_sig_bytes) PNGARG((void));
|
||||
#endif
|
||||
|
||||
/* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PNG_VERSION_INFO_ONLY */
|
||||
#endif /* PNGPRIV_H */
|
||||
390
pngread.c
390
pngread.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngread.c - read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -14,9 +14,9 @@
|
||||
* read a PNG file or stream.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
|
||||
/* Create a PNG structure for reading, and allocate any memory needed. */
|
||||
@@ -27,7 +27,7 @@ png_create_read_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_read_struct_2(user_png_ver, error_ptr, error_fn,
|
||||
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
||||
warn_fn, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
/* Alternate create PNG structure for reading, and allocate any memory needed. */
|
||||
@@ -42,6 +42,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
volatile
|
||||
#endif
|
||||
png_structp png_ptr;
|
||||
int png_cleanup_needed = 0;
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
@@ -55,7 +56,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG,
|
||||
(png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr);
|
||||
malloc_fn, mem_ptr);
|
||||
#else
|
||||
png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
|
||||
#endif
|
||||
@@ -66,28 +67,20 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
|
||||
png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
|
||||
/* Added at libpng-1.4.0 */
|
||||
png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Applications that neglect to set up their own setjmp() and then
|
||||
encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||
then meaningless we abort instead of returning. */
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
#else
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf = NULL;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr,
|
||||
(png_free_ptr)free_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
PNG_ABORT();
|
||||
#endif /* PNG_SETJMP_SUPPORTED */
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
@@ -120,7 +113,7 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
|
||||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char msg[80];
|
||||
if (user_png_ver)
|
||||
{
|
||||
@@ -137,194 +130,64 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
png_warning(png_ptr,
|
||||
"Incompatible libpng version in application and library");
|
||||
|
||||
png_cleanup_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!png_cleanup_needed)
|
||||
{
|
||||
/* Initialize zbuf - compression buffer */
|
||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr,
|
||||
png_ptr->zbuf_size);
|
||||
if (png_ptr->zbuf == NULL)
|
||||
png_cleanup_needed = 1;
|
||||
}
|
||||
png_ptr->zstream.zalloc = png_zalloc;
|
||||
png_ptr->zstream.zfree = png_zfree;
|
||||
png_ptr->zstream.opaque = (voidpf)png_ptr;
|
||||
|
||||
if (!png_cleanup_needed)
|
||||
{
|
||||
switch (inflateInit(&png_ptr->zstream))
|
||||
{
|
||||
case Z_OK: /* Do nothing */ break;
|
||||
case Z_MEM_ERROR:
|
||||
case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error");
|
||||
break;
|
||||
case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error");
|
||||
break;
|
||||
default: png_error(png_ptr, "Unknown zlib error");
|
||||
case Z_STREAM_ERROR: png_warning(png_ptr, "zlib memory error");
|
||||
png_cleanup_needed = 1; break;
|
||||
case Z_VERSION_ERROR: png_warning(png_ptr, "zlib version error");
|
||||
png_cleanup_needed = 1; break;
|
||||
default: png_warning(png_ptr, "Unknown zlib error");
|
||||
png_cleanup_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (png_cleanup_needed)
|
||||
{
|
||||
/* Clean up PNG structure and deallocate any memory. */
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf = NULL;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr,
|
||||
(png_free_ptr)free_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
|
||||
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
||||
png_set_read_fn(png_ptr, NULL, NULL);
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Applications that neglect to set up their own setjmp() and then
|
||||
encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||
then meaningless we abort instead of returning. */
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
PNG_ABORT();
|
||||
png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
|
||||
#else
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
PNG_ABORT();
|
||||
#endif
|
||||
#endif /* PNG_SETJMP_SUPPORTED */
|
||||
|
||||
return (png_ptr);
|
||||
}
|
||||
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
/* Initialize PNG structure for reading, and allocate any memory needed.
|
||||
* This interface is deprecated in favour of the png_create_read_struct(),
|
||||
* and it will disappear as of libpng-1.3.0.
|
||||
*/
|
||||
#undef png_read_init
|
||||
void PNGAPI
|
||||
png_read_init(png_structp png_ptr)
|
||||
{
|
||||
/* We only come here via pre-1.0.7-compiled applications */
|
||||
png_read_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||
}
|
||||
|
||||
void PNGAPI
|
||||
png_read_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size, png_size_t png_info_size)
|
||||
{
|
||||
/* We only come here via pre-1.0.12-compiled applications */
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
if (png_sizeof(png_struct) > png_struct_size ||
|
||||
png_sizeof(png_info) > png_info_size)
|
||||
{
|
||||
char msg[80];
|
||||
png_ptr->warning_fn = NULL;
|
||||
if (user_png_ver)
|
||||
{
|
||||
png_snprintf(msg, 80,
|
||||
"Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
png_snprintf(msg, 80,
|
||||
"Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
#endif
|
||||
if (png_sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_ptr->error_fn = NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The png struct allocated by the application for reading is too small.");
|
||||
}
|
||||
if (png_sizeof(png_info) > png_info_size)
|
||||
{
|
||||
png_ptr->error_fn = NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The info struct allocated by application for reading is too small.");
|
||||
}
|
||||
png_read_init_3(&png_ptr, user_png_ver, png_struct_size);
|
||||
}
|
||||
#endif /* PNG_1_0_X || PNG_1_2_X */
|
||||
|
||||
void PNGAPI
|
||||
png_read_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size)
|
||||
{
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
jmp_buf tmp_jmp; /* to save current jump buffer */
|
||||
#endif
|
||||
|
||||
int i = 0;
|
||||
|
||||
png_structp png_ptr=*ptr_ptr;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
if (user_png_ver[i] != png_libpng_ver[i])
|
||||
{
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||
#else
|
||||
png_ptr->warning_fn = NULL;
|
||||
png_warning(png_ptr,
|
||||
"Application uses deprecated png_read_init() and should be recompiled.");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
} while (png_libpng_ver[i++]);
|
||||
|
||||
png_debug(1, "in png_read_init_3");
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Save jump buffer and error functions */
|
||||
png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
|
||||
if (png_sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_destroy_struct(png_ptr);
|
||||
*ptr_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
|
||||
png_ptr = *ptr_ptr;
|
||||
}
|
||||
|
||||
/* Reset all variables to 0 */
|
||||
png_memset(png_ptr, 0, png_sizeof(png_struct));
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Restore jump buffer */
|
||||
png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
|
||||
/* Added at libpng-1.2.6 */
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
|
||||
png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
|
||||
#endif
|
||||
|
||||
/* Initialize zbuf - compression buffer */
|
||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||
png_ptr->zstream.zalloc = png_zalloc;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
png_ptr->zstream.zalloc = png_zalloc;
|
||||
png_ptr->zstream.zfree = png_zfree;
|
||||
png_ptr->zstream.opaque = (voidpf)png_ptr;
|
||||
|
||||
switch (inflateInit(&png_ptr->zstream))
|
||||
{
|
||||
case Z_OK: /* Do nothing */ break;
|
||||
case Z_STREAM_ERROR: png_error(png_ptr, "zlib memory error"); break;
|
||||
case Z_VERSION_ERROR: png_error(png_ptr, "zlib version error"); break;
|
||||
default: png_error(png_ptr, "Unknown zlib error");
|
||||
}
|
||||
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
|
||||
png_set_read_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL);
|
||||
}
|
||||
|
||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
|
||||
/* Read the information before the actual image data. This has been
|
||||
@@ -349,6 +212,10 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
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;
|
||||
|
||||
@@ -366,63 +233,61 @@ png_read_info(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IHDR;
|
||||
PNG_CONST PNG_IDAT;
|
||||
PNG_CONST PNG_IEND;
|
||||
PNG_CONST PNG_PLTE;
|
||||
PNG_IHDR;
|
||||
PNG_IDAT;
|
||||
PNG_IEND;
|
||||
PNG_PLTE;
|
||||
#ifdef PNG_READ_bKGD_SUPPORTED
|
||||
PNG_CONST PNG_bKGD;
|
||||
PNG_bKGD;
|
||||
#endif
|
||||
#ifdef PNG_READ_cHRM_SUPPORTED
|
||||
PNG_CONST PNG_cHRM;
|
||||
PNG_cHRM;
|
||||
#endif
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
PNG_CONST PNG_gAMA;
|
||||
PNG_gAMA;
|
||||
#endif
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
PNG_CONST PNG_hIST;
|
||||
PNG_hIST;
|
||||
#endif
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
PNG_CONST PNG_iCCP;
|
||||
PNG_iCCP;
|
||||
#endif
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
PNG_CONST PNG_iTXt;
|
||||
PNG_iTXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_oFFs_SUPPORTED
|
||||
PNG_CONST PNG_oFFs;
|
||||
PNG_oFFs;
|
||||
#endif
|
||||
#ifdef PNG_READ_pCAL_SUPPORTED
|
||||
PNG_CONST PNG_pCAL;
|
||||
PNG_pCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_pHYs_SUPPORTED
|
||||
PNG_CONST PNG_pHYs;
|
||||
PNG_pHYs;
|
||||
#endif
|
||||
#ifdef PNG_READ_sBIT_SUPPORTED
|
||||
PNG_CONST PNG_sBIT;
|
||||
PNG_sBIT;
|
||||
#endif
|
||||
#ifdef PNG_READ_sCAL_SUPPORTED
|
||||
PNG_CONST PNG_sCAL;
|
||||
PNG_sCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
PNG_CONST PNG_sPLT;
|
||||
PNG_sPLT;
|
||||
#endif
|
||||
#ifdef PNG_READ_sRGB_SUPPORTED
|
||||
PNG_CONST PNG_sRGB;
|
||||
PNG_sRGB;
|
||||
#endif
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
PNG_CONST PNG_tEXt;
|
||||
PNG_tEXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_tIME_SUPPORTED
|
||||
PNG_CONST PNG_tIME;
|
||||
PNG_tIME;
|
||||
#endif
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
PNG_CONST PNG_tRNS;
|
||||
PNG_tRNS;
|
||||
#endif
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
PNG_CONST PNG_zTXt;
|
||||
PNG_zTXt;
|
||||
#endif
|
||||
#endif /* PNG_USE_LOCAL_ARRAYS */
|
||||
png_uint_32 length = png_read_chunk_header(png_ptr);
|
||||
PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
|
||||
|
||||
@@ -582,7 +447,7 @@ png_start_read_image(png_structp png_ptr)
|
||||
void PNGAPI
|
||||
png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
{
|
||||
PNG_CONST PNG_IDAT;
|
||||
PNG_IDAT;
|
||||
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};
|
||||
@@ -592,7 +457,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
return;
|
||||
|
||||
png_debug2(1, "in png_read_row (row %lu, pass %d)",
|
||||
png_ptr->row_number, png_ptr->pass);
|
||||
(unsigned long) png_ptr->row_number, png_ptr->pass);
|
||||
|
||||
if (!(png_ptr->flags & PNG_FLAG_ROW_INIT))
|
||||
png_read_start_row(png_ptr);
|
||||
@@ -601,31 +466,31 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
/* Check for transforms that have been set but were defined out */
|
||||
#if defined(PNG_WRITE_INVERT_SUPPORTED) && !defined(PNG_READ_INVERT_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||
png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_INVERT_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) && !defined(PNG_READ_FILLER_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_FILLER)
|
||||
png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_FILLER_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) && !defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||
png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_PACKSWAP_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_PACK_SUPPORTED) && !defined(PNG_READ_PACK_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_PACK)
|
||||
png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_PACK_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_SHIFT_SUPPORTED) && !defined(PNG_READ_SHIFT_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_SHIFT)
|
||||
png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_SHIFT_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_BGR_SUPPORTED) && !defined(PNG_READ_BGR_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_BGR)
|
||||
png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_BGR_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if defined(PNG_WRITE_SWAP_SUPPORTED) && !defined(PNG_READ_SWAP_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
||||
png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -736,7 +601,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
{
|
||||
if (png_ptr->zstream.avail_out || png_ptr->zstream.avail_in ||
|
||||
png_ptr->idat_size)
|
||||
png_error(png_ptr, "Extra compressed data");
|
||||
png_benign_error(png_ptr, "Extra compressed data");
|
||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
break;
|
||||
@@ -760,8 +625,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
|
||||
(int)(png_ptr->row_buf[0]));
|
||||
|
||||
png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
|
||||
png_ptr->rowbytes + 1);
|
||||
png_memcpy(png_ptr->prev_row, png_ptr->row_buf, png_ptr->rowbytes + 1);
|
||||
|
||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||
if ((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
|
||||
@@ -861,14 +725,14 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
|
||||
for (i = 0; i < num_rows; i++)
|
||||
{
|
||||
png_bytep rptr = *rp;
|
||||
png_read_row(png_ptr, rptr, png_bytep_NULL);
|
||||
png_read_row(png_ptr, rptr, NULL);
|
||||
rp++;
|
||||
}
|
||||
else if (dp != NULL)
|
||||
for (i = 0; i < num_rows; i++)
|
||||
{
|
||||
png_bytep dptr = *dp;
|
||||
png_read_row(png_ptr, png_bytep_NULL, dptr);
|
||||
png_read_row(png_ptr, NULL, dptr);
|
||||
dp++;
|
||||
}
|
||||
}
|
||||
@@ -904,7 +768,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
#else
|
||||
if (png_ptr->interlaced)
|
||||
png_error(png_ptr,
|
||||
"Cannot read interlaced image -- interlace handler disabled.");
|
||||
"Cannot read interlaced image -- interlace handler disabled");
|
||||
pass = 1;
|
||||
#endif
|
||||
|
||||
@@ -917,7 +781,7 @@ png_read_image(png_structp png_ptr, png_bytepp image)
|
||||
rp = image;
|
||||
for (i = 0; i < image_height; i++)
|
||||
{
|
||||
png_read_row(png_ptr, *rp, png_bytep_NULL);
|
||||
png_read_row(png_ptr, *rp, NULL);
|
||||
rp++;
|
||||
}
|
||||
}
|
||||
@@ -940,63 +804,61 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
do
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IHDR;
|
||||
PNG_CONST PNG_IDAT;
|
||||
PNG_CONST PNG_IEND;
|
||||
PNG_CONST PNG_PLTE;
|
||||
PNG_IHDR;
|
||||
PNG_IDAT;
|
||||
PNG_IEND;
|
||||
PNG_PLTE;
|
||||
#ifdef PNG_READ_bKGD_SUPPORTED
|
||||
PNG_CONST PNG_bKGD;
|
||||
PNG_bKGD;
|
||||
#endif
|
||||
#ifdef PNG_READ_cHRM_SUPPORTED
|
||||
PNG_CONST PNG_cHRM;
|
||||
PNG_cHRM;
|
||||
#endif
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
PNG_CONST PNG_gAMA;
|
||||
PNG_gAMA;
|
||||
#endif
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
PNG_CONST PNG_hIST;
|
||||
PNG_hIST;
|
||||
#endif
|
||||
#ifdef PNG_READ_iCCP_SUPPORTED
|
||||
PNG_CONST PNG_iCCP;
|
||||
PNG_iCCP;
|
||||
#endif
|
||||
#ifdef PNG_READ_iTXt_SUPPORTED
|
||||
PNG_CONST PNG_iTXt;
|
||||
PNG_iTXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_oFFs_SUPPORTED
|
||||
PNG_CONST PNG_oFFs;
|
||||
PNG_oFFs;
|
||||
#endif
|
||||
#ifdef PNG_READ_pCAL_SUPPORTED
|
||||
PNG_CONST PNG_pCAL;
|
||||
PNG_pCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_pHYs_SUPPORTED
|
||||
PNG_CONST PNG_pHYs;
|
||||
PNG_pHYs;
|
||||
#endif
|
||||
#ifdef PNG_READ_sBIT_SUPPORTED
|
||||
PNG_CONST PNG_sBIT;
|
||||
PNG_sBIT;
|
||||
#endif
|
||||
#ifdef PNG_READ_sCAL_SUPPORTED
|
||||
PNG_CONST PNG_sCAL;
|
||||
PNG_sCAL;
|
||||
#endif
|
||||
#ifdef PNG_READ_sPLT_SUPPORTED
|
||||
PNG_CONST PNG_sPLT;
|
||||
PNG_sPLT;
|
||||
#endif
|
||||
#ifdef PNG_READ_sRGB_SUPPORTED
|
||||
PNG_CONST PNG_sRGB;
|
||||
PNG_sRGB;
|
||||
#endif
|
||||
#ifdef PNG_READ_tEXt_SUPPORTED
|
||||
PNG_CONST PNG_tEXt;
|
||||
PNG_tEXt;
|
||||
#endif
|
||||
#ifdef PNG_READ_tIME_SUPPORTED
|
||||
PNG_CONST PNG_tIME;
|
||||
PNG_tIME;
|
||||
#endif
|
||||
#ifdef PNG_READ_tRNS_SUPPORTED
|
||||
PNG_CONST PNG_tRNS;
|
||||
PNG_tRNS;
|
||||
#endif
|
||||
#ifdef PNG_READ_zTXt_SUPPORTED
|
||||
PNG_CONST PNG_zTXt;
|
||||
PNG_zTXt;
|
||||
#endif
|
||||
#endif /* PNG_USE_LOCAL_ARRAYS */
|
||||
png_uint_32 length = png_read_chunk_header(png_ptr);
|
||||
PNG_CONST png_bytep chunk_name = png_ptr->chunk_name;
|
||||
|
||||
@@ -1010,7 +872,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
if (!png_memcmp(chunk_name, png_IDAT, 4))
|
||||
{
|
||||
if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
|
||||
png_error(png_ptr, "Too many IDAT's found");
|
||||
png_benign_error(png_ptr, "Too many IDATs found");
|
||||
}
|
||||
png_handle_unknown(png_ptr, info_ptr, length);
|
||||
if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
@@ -1023,7 +885,7 @@ png_read_end(png_structp png_ptr, png_infop info_ptr)
|
||||
* read, but not after other chunks have been read.
|
||||
*/
|
||||
if ((length > 0) || (png_ptr->mode & PNG_HAVE_CHUNK_AFTER_IDAT))
|
||||
png_error(png_ptr, "Too many IDAT's found");
|
||||
png_benign_error(png_ptr, "Too many IDATs found");
|
||||
png_crc_finish(png_ptr, length);
|
||||
}
|
||||
else if (!png_memcmp(chunk_name, png_PLTE, 4))
|
||||
@@ -1212,37 +1074,19 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
|
||||
png_free(png_ptr, png_ptr->gamma_from_1);
|
||||
png_free(png_ptr, png_ptr->gamma_to_1);
|
||||
#endif
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if (png_ptr->free_me & PNG_FREE_PLTE)
|
||||
png_zfree(png_ptr, png_ptr->palette);
|
||||
png_ptr->free_me &= ~PNG_FREE_PLTE;
|
||||
#else
|
||||
if (png_ptr->flags & PNG_FLAG_FREE_PLTE)
|
||||
png_zfree(png_ptr, png_ptr->palette);
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_PLTE;
|
||||
#endif
|
||||
#if defined(PNG_tRNS_SUPPORTED) || \
|
||||
defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if (png_ptr->free_me & PNG_FREE_TRNS)
|
||||
png_free(png_ptr, png_ptr->trans);
|
||||
png_free(png_ptr, png_ptr->trans_alpha);
|
||||
png_ptr->free_me &= ~PNG_FREE_TRNS;
|
||||
#else
|
||||
if (png_ptr->flags & PNG_FLAG_FREE_TRNS)
|
||||
png_free(png_ptr, png_ptr->trans);
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef PNG_READ_hIST_SUPPORTED
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
if (png_ptr->free_me & PNG_FREE_HIST)
|
||||
png_free(png_ptr, png_ptr->hist);
|
||||
png_ptr->free_me &= ~PNG_FREE_HIST;
|
||||
#else
|
||||
if (png_ptr->flags & PNG_FLAG_FREE_HIST)
|
||||
png_free(png_ptr, png_ptr->hist);
|
||||
png_ptr->flags &= ~PNG_FLAG_FREE_HIST;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
if (png_ptr->gamma_16_table != NULL)
|
||||
@@ -1342,12 +1186,6 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||
/* Invert the alpha channel from opacity to transparency
|
||||
*/
|
||||
if (transforms & PNG_TRANSFORM_INVERT_ALPHA)
|
||||
png_set_invert_alpha(png_ptr);
|
||||
#endif
|
||||
|
||||
/* png_read_info() gives us all of the information from the
|
||||
* PNG file before the first IDAT (image data chunk).
|
||||
@@ -1474,19 +1312,17 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
|
||||
/* -------------- image transformations end here ------------------- */
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_ROWS, 0);
|
||||
#endif
|
||||
if (info_ptr->row_pointers == NULL)
|
||||
{
|
||||
png_uint_32 iptr;
|
||||
|
||||
info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
|
||||
info_ptr->height * png_sizeof(png_bytep));
|
||||
png_memset(info_ptr->row_pointers, 0, info_ptr->height
|
||||
* png_sizeof(png_bytep));
|
||||
for (iptr=0; iptr<info_ptr->height; iptr++)
|
||||
info_ptr->row_pointers[iptr] = NULL;
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_ROWS;
|
||||
#endif
|
||||
|
||||
for (row = 0; row < (int)info_ptr->height; row++)
|
||||
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
|
||||
|
||||
28
pngrio.c
28
pngrio.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrio.c - functions for data input
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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,9 +18,9 @@
|
||||
* libpng use it at run time with png_set_read_fn(...).
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Read the data from whatever input you are using. The default routine
|
||||
* reads from a file pointer. Note that this routine sometimes gets called
|
||||
@@ -56,13 +56,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||
* instead of an int, which is what fread() actually returns.
|
||||
*/
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
|
||||
check = 0;
|
||||
#else
|
||||
check = (png_size_t)fread(data, (png_size_t)1, length,
|
||||
(png_FILE_p)png_ptr->io_ptr);
|
||||
#endif
|
||||
check = fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
|
||||
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Read Error");
|
||||
@@ -79,7 +73,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
static void PNGAPI
|
||||
png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
int check;
|
||||
png_size_t check;
|
||||
png_byte *n_data;
|
||||
png_FILE_p io_ptr;
|
||||
|
||||
@@ -90,12 +84,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
|
||||
if ((png_bytep)n_data == data)
|
||||
{
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
|
||||
check = 0;
|
||||
#else
|
||||
check = fread(n_data, 1, length, io_ptr);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -106,12 +95,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
do
|
||||
{
|
||||
read = MIN(NEAR_BUF_SIZE, remaining);
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) )
|
||||
err = 0;
|
||||
#else
|
||||
err = fread(buf, (png_size_t)1, read, io_ptr);
|
||||
#endif
|
||||
err = fread(buf, 1, read, io_ptr);
|
||||
png_memcpy(data, buf, read); /* copy far buffer to near buffer */
|
||||
if (err != read)
|
||||
break;
|
||||
@@ -168,7 +152,7 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
png_warning(png_ptr,
|
||||
"It's an error to set both read_data_fn and write_data_fn in the ");
|
||||
png_warning(png_ptr,
|
||||
"same structure. Resetting write_data_fn to NULL.");
|
||||
"same structure. Resetting write_data_fn to NULL");
|
||||
}
|
||||
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
|
||||
463
pngrtran.c
463
pngrtran.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -16,9 +16,9 @@
|
||||
* in pngtrans.c.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Set the action on getting a CRC error for an ancillary or critical chunk. */
|
||||
void PNGAPI
|
||||
@@ -48,7 +48,7 @@ png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action)
|
||||
|
||||
case PNG_CRC_WARN_DISCARD: /* Not a valid action for critical data */
|
||||
png_warning(png_ptr,
|
||||
"Can't discard critical data on CRC error.");
|
||||
"Can't discard critical data on CRC error");
|
||||
case PNG_CRC_ERROR_QUIT: /* Error/quit */
|
||||
|
||||
case PNG_CRC_DEFAULT:
|
||||
@@ -140,6 +140,22 @@ png_set_strip_alpha(png_structp png_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_premultiply_alpha(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_premultiply_alpha");
|
||||
|
||||
if(png_ptr == NULL)
|
||||
return;
|
||||
png_ptr->transformations |=
|
||||
(PNG_PREMULTIPLY_ALPHA | PNG_EXPAND_tRNS);
|
||||
png_ptr->transformations |=
|
||||
PNG_EXPAND; /* This shouldn't be necessary */
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_DITHER_SUPPORTED
|
||||
/* Dither file to 8 bit. Supply a palette, the current number
|
||||
* of elements in the palette, the maximum number of elements
|
||||
@@ -609,7 +625,6 @@ png_set_palette_to_rgb(png_structp png_ptr)
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
|
||||
#ifndef PNG_1_0_X
|
||||
/* Expand grayscale images of less than 8-bit depth to 8 bits. */
|
||||
void PNGAPI
|
||||
png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
@@ -622,22 +637,7 @@ png_set_expand_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
png_ptr->transformations |= PNG_EXPAND;
|
||||
png_ptr->flags &= ~PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
/* Expand grayscale images of less than 8-bit depth to 8 bits. */
|
||||
/* Deprecated as of libpng-1.2.9 */
|
||||
void PNGAPI
|
||||
png_set_gray_1_2_4_to_8(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_set_gray_1_2_4_to_8");
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Expand tRNS chunks to alpha channels. */
|
||||
@@ -705,7 +705,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
#else
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED.");
|
||||
"Cannot do RGB_TO_GRAY without EXPAND_SUPPORTED");
|
||||
png_ptr->transformations &= ~PNG_RGB_TO_GRAY;
|
||||
}
|
||||
#endif
|
||||
@@ -736,7 +736,6 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
|
||||
defined(PNG_LEGACY_SUPPORTED) || \
|
||||
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
|
||||
void PNGAPI
|
||||
png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
|
||||
@@ -751,11 +750,6 @@ png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr
|
||||
png_ptr->transformations |= PNG_USER_TRANSFORM;
|
||||
png_ptr->read_user_transform_fn = read_user_transform_fn;
|
||||
#endif
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
if (read_user_transform_fn)
|
||||
png_warning(png_ptr,
|
||||
"This version of libpng does not support user transforms");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -767,9 +761,6 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
{
|
||||
png_debug(1, "in png_init_read_transformations");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (png_ptr != NULL)
|
||||
#endif
|
||||
{
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || defined(PNG_READ_SHIFT_SUPPORTED) \
|
||||
|| defined(PNG_READ_GAMMA_SUPPORTED)
|
||||
@@ -818,9 +809,9 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
{
|
||||
png_ptr->trans_values.gray *= (png_uint_16)0xff;
|
||||
png_ptr->trans_values.red = png_ptr->trans_values.green
|
||||
= png_ptr->trans_values.blue = png_ptr->trans_values.gray;
|
||||
png_ptr->trans_color.gray *= (png_uint_16)0xff;
|
||||
png_ptr->trans_color.red = png_ptr->trans_color.green
|
||||
= png_ptr->trans_color.blue = png_ptr->trans_color.gray;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -830,9 +821,9 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
{
|
||||
png_ptr->trans_values.gray *= (png_uint_16)0x55;
|
||||
png_ptr->trans_values.red = png_ptr->trans_values.green
|
||||
= png_ptr->trans_values.blue = png_ptr->trans_values.gray;
|
||||
png_ptr->trans_color.gray *= (png_uint_16)0x55;
|
||||
png_ptr->trans_color.red = png_ptr->trans_color.green
|
||||
= png_ptr->trans_color.blue = png_ptr->trans_color.gray;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -842,9 +833,9 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
= png_ptr->background.blue = png_ptr->background.gray;
|
||||
if (!(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
{
|
||||
png_ptr->trans_values.gray *= (png_uint_16)0x11;
|
||||
png_ptr->trans_values.red = png_ptr->trans_values.green
|
||||
= png_ptr->trans_values.blue = png_ptr->trans_values.gray;
|
||||
png_ptr->trans_color.gray *= (png_uint_16)0x11;
|
||||
png_ptr->trans_color.red = png_ptr->trans_color.green
|
||||
= png_ptr->trans_color.blue = png_ptr->trans_color.gray;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -878,7 +869,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
int i, istop;
|
||||
istop=(int)png_ptr->num_trans;
|
||||
for (i=0; i<istop; i++)
|
||||
png_ptr->trans[i] = (png_byte)(255 - png_ptr->trans[i]);
|
||||
png_ptr->trans_alpha[i] = (png_byte)(255 - png_ptr->trans_alpha[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -900,7 +891,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
k=0;
|
||||
for (i=0; i<png_ptr->num_trans; i++)
|
||||
{
|
||||
if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
|
||||
if (png_ptr->trans_alpha[i] != 0 && png_ptr->trans_alpha[i] != 0xff)
|
||||
k=1; /* Partial transparency is present */
|
||||
}
|
||||
if (k == 0)
|
||||
@@ -982,26 +973,26 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
if (i < (int)png_ptr->num_trans && png_ptr->trans[i] != 0xff)
|
||||
if (i < (int)png_ptr->num_trans && png_ptr->trans_alpha[i] != 0xff)
|
||||
{
|
||||
if (png_ptr->trans[i] == 0)
|
||||
if (png_ptr->trans_alpha[i] == 0)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else /* if (png_ptr->trans[i] != 0xff) */
|
||||
else /* if (png_ptr->trans_alpha[i] != 0xff) */
|
||||
{
|
||||
png_byte v, w;
|
||||
|
||||
v = png_ptr->gamma_to_1[palette[i].red];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.red);
|
||||
png_composite(w, v, png_ptr->trans_alpha[i], back_1.red);
|
||||
palette[i].red = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[palette[i].green];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.green);
|
||||
png_composite(w, v, png_ptr->trans_alpha[i], back_1.green);
|
||||
palette[i].green = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[palette[i].blue];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.blue);
|
||||
png_composite(w, v, png_ptr->trans_alpha[i], back_1.blue);
|
||||
palette[i].blue = png_ptr->gamma_from_1[w];
|
||||
}
|
||||
}
|
||||
@@ -1121,19 +1112,19 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
|
||||
for (i = 0; i < istop; i++)
|
||||
{
|
||||
if (png_ptr->trans[i] == 0)
|
||||
if (png_ptr->trans_alpha[i] == 0)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else if (png_ptr->trans[i] != 0xff)
|
||||
else if (png_ptr->trans_alpha[i] != 0xff)
|
||||
{
|
||||
/* The png_composite() macro is defined in png.h */
|
||||
png_composite(palette[i].red, palette[i].red,
|
||||
png_ptr->trans[i], back.red);
|
||||
png_ptr->trans_alpha[i], back.red);
|
||||
png_composite(palette[i].green, palette[i].green,
|
||||
png_ptr->trans[i], back.green);
|
||||
png_ptr->trans_alpha[i], back.green);
|
||||
png_composite(palette[i].blue, palette[i].blue,
|
||||
png_ptr->trans[i], back.blue);
|
||||
png_ptr->trans_alpha[i], back.blue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1287,10 +1278,8 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
info_ptr->channels++;
|
||||
/* If adding a true alpha channel not just filler */
|
||||
#ifndef PNG_1_0_X
|
||||
if (png_ptr->transformations & PNG_ADD_ALPHA)
|
||||
info_ptr->color_type |= PNG_COLOR_MASK_ALPHA;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1327,7 +1316,7 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
|
||||
if (png_ptr->row_buf == NULL)
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char msg[50];
|
||||
|
||||
png_snprintf2(msg, 50,
|
||||
@@ -1357,14 +1346,14 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
|
||||
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (png_ptr->num_trans &&
|
||||
(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||
png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
&(png_ptr->trans_values));
|
||||
&(png_ptr->trans_color));
|
||||
else
|
||||
png_do_expand(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
NULL);
|
||||
@@ -1446,7 +1435,7 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
((png_ptr->num_trans != 0 ) ||
|
||||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA)))
|
||||
png_do_background(&(png_ptr->row_info), png_ptr->row_buf + 1,
|
||||
&(png_ptr->trans_values), &(png_ptr->background)
|
||||
&(png_ptr->trans_color), &(png_ptr->background)
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
, &(png_ptr->background_1),
|
||||
png_ptr->gamma_table, png_ptr->gamma_from_1,
|
||||
@@ -1519,6 +1508,12 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
(png_uint_32)png_ptr->filler, png_ptr->flags);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_PREMULTIPLY_ALPHA)
|
||||
png_do_read_premultiply_alpha(&(png_ptr->row_info),
|
||||
png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
||||
png_do_read_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1);
|
||||
@@ -1575,11 +1570,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_unpack");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL && row_info->bit_depth < 8)
|
||||
#else
|
||||
if (row_info->bit_depth < 8)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 i;
|
||||
png_uint_32 row_width=row_info->width;
|
||||
@@ -1669,9 +1660,6 @@ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits)
|
||||
png_debug(1, "in png_do_unshift");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL && sig_bits != NULL &&
|
||||
#endif
|
||||
row_info->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
int shift[4];
|
||||
@@ -1778,11 +1766,7 @@ png_do_chop(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_chop");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL && row_info->bit_depth == 16)
|
||||
#else
|
||||
if (row_info->bit_depth == 16)
|
||||
#endif
|
||||
{
|
||||
png_bytep sp = row;
|
||||
png_bytep dp = row;
|
||||
@@ -1836,9 +1820,6 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_swap_alpha");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
@@ -1929,9 +1910,6 @@ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_invert_alpha");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
@@ -2022,6 +2000,85 @@ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PREMULTIPLY_ALPHA_SUPPORTED
|
||||
void /* PRIVATE */
|
||||
png_do_read_premultiply_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_read_premultiply_alpha");
|
||||
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
/* This premultiplies the pixels with the alpha channel in RGBA */
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep sp = row + row_info->rowbytes;
|
||||
png_bytep dp = sp;
|
||||
png_uint_16 a = 0;
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
a = *(--sp); --dp;
|
||||
|
||||
*(--dp) = (*(--sp) * a) / 255;
|
||||
*(--dp) = (*(--sp) * a) / 255;
|
||||
*(--dp) = (*(--sp) * a) / 255;
|
||||
}
|
||||
}
|
||||
/* This premultiplies the pixels with the alpha channel in RRGGBBAA */
|
||||
else
|
||||
{
|
||||
png_uint_16p sp = (png_uint_16p)(row + row_info->rowbytes);
|
||||
png_uint_16p dp = sp;
|
||||
png_uint_32 a = 0;
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
a = *(--sp); --dp;
|
||||
*(--dp) = (png_uint_16) ((*(--sp) * a) / 65535);
|
||||
*(--dp) = (png_uint_16) ((*(--sp) * a) / 65535);
|
||||
*(--dp) = (png_uint_16) ((*(--sp) * a) / 65535);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
|
||||
{
|
||||
/* This premultiplies the pixels with the alpha channel in GA */
|
||||
if (row_info->bit_depth == 8)
|
||||
{
|
||||
png_bytep sp = row + row_info->rowbytes;
|
||||
png_bytep dp = sp;
|
||||
png_uint_16 a = 0;
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
a = *(--sp); --dp;
|
||||
*(--dp) = (*(--sp) * a) / 255;
|
||||
}
|
||||
}
|
||||
/* This premultiplies the pixels with the alpha channel in GGAA */
|
||||
else
|
||||
{
|
||||
png_uint_16p sp = (png_uint_16p) (row + row_info->rowbytes);
|
||||
png_uint_16p dp = sp;
|
||||
png_uint_32 a = 0;
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
a = *(--sp); --dp;
|
||||
*(--dp) = (png_uint_16) ((*(--sp) * a) / 65535);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_FILLER_SUPPORTED
|
||||
/* Add filler channel if we have RGB color */
|
||||
void /* PRIVATE */
|
||||
@@ -2037,9 +2094,6 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||
png_debug(1, "in png_do_read_filler");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
if (row_info->bit_depth == 8)
|
||||
@@ -2210,9 +2264,6 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_gray_to_rgb");
|
||||
|
||||
if (row_info->bit_depth >= 8 &&
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
!(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
@@ -2317,9 +2368,6 @@ 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 (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 rc = png_ptr->rgb_to_gray_red_coeff;
|
||||
@@ -2594,188 +2642,6 @@ png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is currently unused. Do we really need it? */
|
||||
#if defined(PNG_READ_DITHER_SUPPORTED) && defined(PNG_CORRECT_PALETTE_SUPPORTED)
|
||||
void /* PRIVATE */
|
||||
png_correct_palette(png_structp png_ptr, png_colorp palette,
|
||||
int num_palette)
|
||||
{
|
||||
png_debug(1, "in png_correct_palette");
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
|
||||
defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED)
|
||||
if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND))
|
||||
{
|
||||
png_color back, back_1;
|
||||
|
||||
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_FILE)
|
||||
{
|
||||
back.red = png_ptr->gamma_table[png_ptr->background.red];
|
||||
back.green = png_ptr->gamma_table[png_ptr->background.green];
|
||||
back.blue = png_ptr->gamma_table[png_ptr->background.blue];
|
||||
|
||||
back_1.red = png_ptr->gamma_to_1[png_ptr->background.red];
|
||||
back_1.green = png_ptr->gamma_to_1[png_ptr->background.green];
|
||||
back_1.blue = png_ptr->gamma_to_1[png_ptr->background.blue];
|
||||
}
|
||||
else
|
||||
{
|
||||
double g;
|
||||
|
||||
g = 1.0 / (png_ptr->background_gamma * png_ptr->screen_gamma);
|
||||
|
||||
if (png_ptr->background_gamma_type == PNG_BACKGROUND_GAMMA_SCREEN ||
|
||||
fabs(g - 1.0) < PNG_GAMMA_THRESHOLD)
|
||||
{
|
||||
back.red = png_ptr->background.red;
|
||||
back.green = png_ptr->background.green;
|
||||
back.blue = png_ptr->background.blue;
|
||||
}
|
||||
else
|
||||
{
|
||||
back.red =
|
||||
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||
255.0 + 0.5);
|
||||
back.green =
|
||||
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||
255.0 + 0.5);
|
||||
back.blue =
|
||||
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||
255.0 + 0.5);
|
||||
}
|
||||
|
||||
g = 1.0 / png_ptr->background_gamma;
|
||||
|
||||
back_1.red =
|
||||
(png_byte)(pow((double)png_ptr->background.red/255, g) *
|
||||
255.0 + 0.5);
|
||||
back_1.green =
|
||||
(png_byte)(pow((double)png_ptr->background.green/255, g) *
|
||||
255.0 + 0.5);
|
||||
back_1.blue =
|
||||
(png_byte)(pow((double)png_ptr->background.blue/255, g) *
|
||||
255.0 + 0.5);
|
||||
}
|
||||
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_uint_32 i;
|
||||
|
||||
for (i = 0; i < (png_uint_32)num_palette; i++)
|
||||
{
|
||||
if (i < png_ptr->num_trans && png_ptr->trans[i] == 0)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else if (i < png_ptr->num_trans && png_ptr->trans[i] != 0xff)
|
||||
{
|
||||
png_byte v, w;
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].red];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.red);
|
||||
palette[i].red = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].green];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.green);
|
||||
palette[i].green = png_ptr->gamma_from_1[w];
|
||||
|
||||
v = png_ptr->gamma_to_1[png_ptr->palette[i].blue];
|
||||
png_composite(w, v, png_ptr->trans[i], back_1.blue);
|
||||
palette[i].blue = png_ptr->gamma_from_1[w];
|
||||
}
|
||||
else
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
if (palette[i].red == (png_byte)png_ptr->trans_values.gray)
|
||||
{
|
||||
palette[i] = back;
|
||||
}
|
||||
else
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_GAMMA)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
palette[i].red = png_ptr->gamma_table[palette[i].red];
|
||||
palette[i].green = png_ptr->gamma_table[palette[i].green];
|
||||
palette[i].blue = png_ptr->gamma_table[palette[i].blue];
|
||||
}
|
||||
}
|
||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_BACKGROUND)
|
||||
{
|
||||
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
png_color back;
|
||||
|
||||
back.red = (png_byte)png_ptr->background.red;
|
||||
back.green = (png_byte)png_ptr->background.green;
|
||||
back.blue = (png_byte)png_ptr->background.blue;
|
||||
|
||||
for (i = 0; i < (int)png_ptr->num_trans; i++)
|
||||
{
|
||||
if (png_ptr->trans[i] == 0)
|
||||
{
|
||||
palette[i].red = back.red;
|
||||
palette[i].green = back.green;
|
||||
palette[i].blue = back.blue;
|
||||
}
|
||||
else if (png_ptr->trans[i] != 0xff)
|
||||
{
|
||||
png_composite(palette[i].red, png_ptr->palette[i].red,
|
||||
png_ptr->trans[i], back.red);
|
||||
png_composite(palette[i].green, png_ptr->palette[i].green,
|
||||
png_ptr->trans[i], back.green);
|
||||
png_composite(palette[i].blue, png_ptr->palette[i].blue,
|
||||
png_ptr->trans[i], back.blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* Assume grayscale palette (what else could it be?) */
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_palette; i++)
|
||||
{
|
||||
if (i == (png_byte)png_ptr->trans_values.gray)
|
||||
{
|
||||
palette[i].red = (png_byte)png_ptr->background.red;
|
||||
palette[i].green = (png_byte)png_ptr->background.green;
|
||||
palette[i].blue = (png_byte)png_ptr->background.blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_BACKGROUND_SUPPORTED
|
||||
/* Replace any alpha or transparency with the supplied background color.
|
||||
@@ -2784,7 +2650,7 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_color_16p trans_values, png_color_16p background
|
||||
png_color_16p trans_color, png_color_16p background
|
||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||
, png_color_16p background_1,
|
||||
png_bytep gamma_table, png_bytep gamma_from_1, png_bytep gamma_to_1,
|
||||
@@ -2801,11 +2667,8 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_debug(1, "in png_do_background");
|
||||
|
||||
if (background != NULL &&
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(!(row_info->color_type & PNG_COLOR_MASK_ALPHA) ||
|
||||
(row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_values)))
|
||||
(row_info->color_type != PNG_COLOR_TYPE_PALETTE && trans_color)))
|
||||
{
|
||||
switch (row_info->color_type)
|
||||
{
|
||||
@@ -2820,7 +2683,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if ((png_uint_16)((*sp >> shift) & 0x01)
|
||||
== trans_values->gray)
|
||||
== trans_color->gray)
|
||||
{
|
||||
*sp &= (png_byte)((0x7f7f >> (7 - shift)) & 0xff);
|
||||
*sp |= (png_byte)(background->gray << shift);
|
||||
@@ -2846,7 +2709,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if ((png_uint_16)((*sp >> shift) & 0x03)
|
||||
== trans_values->gray)
|
||||
== trans_color->gray)
|
||||
{
|
||||
*sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
|
||||
*sp |= (png_byte)(background->gray << shift);
|
||||
@@ -2876,7 +2739,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if ((png_uint_16)((*sp >> shift) & 0x03)
|
||||
== trans_values->gray)
|
||||
== trans_color->gray)
|
||||
{
|
||||
*sp &= (png_byte)((0x3f3f >> (6 - shift)) & 0xff);
|
||||
*sp |= (png_byte)(background->gray << shift);
|
||||
@@ -2903,7 +2766,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if ((png_uint_16)((*sp >> shift) & 0x0f)
|
||||
== trans_values->gray)
|
||||
== trans_color->gray)
|
||||
{
|
||||
*sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
|
||||
*sp |= (png_byte)(background->gray << shift);
|
||||
@@ -2933,7 +2796,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
for (i = 0; i < row_width; i++)
|
||||
{
|
||||
if ((png_uint_16)((*sp >> shift) & 0x0f)
|
||||
== trans_values->gray)
|
||||
== trans_color->gray)
|
||||
{
|
||||
*sp &= (png_byte)((0xf0f >> (4 - shift)) & 0xff);
|
||||
*sp |= (png_byte)(background->gray << shift);
|
||||
@@ -2958,7 +2821,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
sp = row;
|
||||
for (i = 0; i < row_width; i++, sp++)
|
||||
{
|
||||
if (*sp == trans_values->gray)
|
||||
if (*sp == trans_color->gray)
|
||||
{
|
||||
*sp = (png_byte)background->gray;
|
||||
}
|
||||
@@ -2974,7 +2837,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
sp = row;
|
||||
for (i = 0; i < row_width; i++, sp++)
|
||||
{
|
||||
if (*sp == trans_values->gray)
|
||||
if (*sp == trans_color->gray)
|
||||
{
|
||||
*sp = (png_byte)background->gray;
|
||||
}
|
||||
@@ -2994,7 +2857,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_uint_16 v;
|
||||
|
||||
v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
|
||||
if (v == trans_values->gray)
|
||||
if (v == trans_color->gray)
|
||||
{
|
||||
/* Background is already in screen gamma */
|
||||
*sp = (png_byte)((background->gray >> 8) & 0xff);
|
||||
@@ -3017,7 +2880,7 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_uint_16 v;
|
||||
|
||||
v = (png_uint_16)(((*sp) << 8) + *(sp + 1));
|
||||
if (v == trans_values->gray)
|
||||
if (v == trans_color->gray)
|
||||
{
|
||||
*sp = (png_byte)((background->gray >> 8) & 0xff);
|
||||
*(sp + 1) = (png_byte)(background->gray & 0xff);
|
||||
@@ -3040,9 +2903,9 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
sp = row;
|
||||
for (i = 0; i < row_width; i++, sp += 3)
|
||||
{
|
||||
if (*sp == trans_values->red &&
|
||||
*(sp + 1) == trans_values->green &&
|
||||
*(sp + 2) == trans_values->blue)
|
||||
if (*sp == trans_color->red &&
|
||||
*(sp + 1) == trans_color->green &&
|
||||
*(sp + 2) == trans_color->blue)
|
||||
{
|
||||
*sp = (png_byte)background->red;
|
||||
*(sp + 1) = (png_byte)background->green;
|
||||
@@ -3062,9 +2925,9 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
sp = row;
|
||||
for (i = 0; i < row_width; i++, sp += 3)
|
||||
{
|
||||
if (*sp == trans_values->red &&
|
||||
*(sp + 1) == trans_values->green &&
|
||||
*(sp + 2) == trans_values->blue)
|
||||
if (*sp == trans_color->red &&
|
||||
*(sp + 1) == trans_color->green &&
|
||||
*(sp + 2) == trans_color->blue)
|
||||
{
|
||||
*sp = (png_byte)background->red;
|
||||
*(sp + 1) = (png_byte)background->green;
|
||||
@@ -3084,8 +2947,8 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_uint_16 r = (png_uint_16)(((*sp) << 8) + *(sp + 1));
|
||||
png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
|
||||
png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5));
|
||||
if (r == trans_values->red && g == trans_values->green &&
|
||||
b == trans_values->blue)
|
||||
if (r == trans_color->red && g == trans_color->green &&
|
||||
b == trans_color->blue)
|
||||
{
|
||||
/* Background is already in screen gamma */
|
||||
*sp = (png_byte)((background->red >> 8) & 0xff);
|
||||
@@ -3119,8 +2982,8 @@ png_do_background(png_row_infop row_info, png_bytep row,
|
||||
png_uint_16 g = (png_uint_16)(((*(sp+2)) << 8) + *(sp+3));
|
||||
png_uint_16 b = (png_uint_16)(((*(sp+4)) << 8) + *(sp+5));
|
||||
|
||||
if (r == trans_values->red && g == trans_values->green &&
|
||||
b == trans_values->blue)
|
||||
if (r == trans_color->red && g == trans_color->green &&
|
||||
b == trans_color->blue)
|
||||
{
|
||||
*sp = (png_byte)((background->red >> 8) & 0xff);
|
||||
*(sp + 1) = (png_byte)(background->red & 0xff);
|
||||
@@ -3491,9 +3354,6 @@ png_do_gamma(png_row_infop row_info, png_bytep row,
|
||||
png_debug(1, "in png_do_gamma");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
((row_info->bit_depth <= 8 && gamma_table != NULL) ||
|
||||
(row_info->bit_depth == 16 && gamma_16_table != NULL)))
|
||||
{
|
||||
@@ -3670,7 +3530,7 @@ png_do_gamma(png_row_infop row_info, png_bytep row,
|
||||
*/
|
||||
void /* PRIVATE */
|
||||
png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
png_colorp palette, png_bytep trans, int num_trans)
|
||||
png_colorp palette, png_bytep trans_alpha, int num_trans)
|
||||
{
|
||||
int shift, value;
|
||||
png_bytep sp, dp;
|
||||
@@ -3680,9 +3540,6 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
png_debug(1, "in png_do_expand_palette");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
if (row_info->bit_depth < 8)
|
||||
@@ -3765,7 +3622,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
{
|
||||
case 8:
|
||||
{
|
||||
if (trans != NULL)
|
||||
if (trans_alpha != NULL)
|
||||
{
|
||||
sp = row + (png_size_t)row_width - 1;
|
||||
dp = row + (png_size_t)(row_width << 2) - 1;
|
||||
@@ -3775,7 +3632,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||
if ((int)(*sp) >= num_trans)
|
||||
*dp-- = 0xff;
|
||||
else
|
||||
*dp-- = trans[*sp];
|
||||
*dp-- = trans_alpha[*sp];
|
||||
*dp-- = palette[*sp].blue;
|
||||
*dp-- = palette[*sp].green;
|
||||
*dp-- = palette[*sp].red;
|
||||
@@ -3826,9 +3683,6 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_expand");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
@@ -4038,9 +3892,6 @@ png_do_dither(png_row_infop row_info, png_bytep row,
|
||||
|
||||
png_debug(1, "in png_do_dither");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB &&
|
||||
palette_lookup && row_info->bit_depth == 8)
|
||||
@@ -4140,6 +3991,7 @@ static PNG_CONST int png_gamma_shift[] =
|
||||
* AND
|
||||
* {
|
||||
* the screen_gamma is known
|
||||
*
|
||||
* OR
|
||||
*
|
||||
* RGB_to_gray transformation is being performed
|
||||
@@ -4385,9 +4237,6 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_read_intrapixel");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
int bytes_per_pixel;
|
||||
|
||||
257
pngrutil.c
257
pngrutil.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -14,57 +14,20 @@
|
||||
* libpng itself during the course of reading an image.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_READ_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
#if defined(_WIN32_WCE) && (_WIN32_WCE<0x500)
|
||||
# define WIN32_WCE_OLD
|
||||
#endif
|
||||
|
||||
#ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
# ifdef WIN32_WCE_OLD
|
||||
/* The strtod() function is not supported on WindowsCE */
|
||||
__inline double png_strtod(png_structp png_ptr, PNG_CONST char *nptr, char **endptr)
|
||||
{
|
||||
double result = 0;
|
||||
int len;
|
||||
wchar_t *str, *end;
|
||||
|
||||
len = MultiByteToWideChar(CP_ACP, 0, nptr, -1, NULL, 0);
|
||||
str = (wchar_t *)png_malloc(png_ptr, len * png_sizeof(wchar_t));
|
||||
if ( NULL != str )
|
||||
{
|
||||
MultiByteToWideChar(CP_ACP, 0, nptr, -1, str, len);
|
||||
result = wcstod(str, &end);
|
||||
len = WideCharToMultiByte(CP_ACP, 0, end, -1, NULL, 0, NULL, NULL);
|
||||
*endptr = (char *)nptr + (png_strlen(nptr) - len + 1);
|
||||
png_free(png_ptr, str);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
# else
|
||||
# define png_strtod(p,a,b) strtod(a,b)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_uint_31(png_structp png_ptr, png_bytep buf)
|
||||
{
|
||||
#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||
png_uint_32 i = png_get_uint_32(buf);
|
||||
#else
|
||||
/* Avoid an extra function call by inlining the result. */
|
||||
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));
|
||||
#endif
|
||||
if (i > PNG_UINT_31_MAX)
|
||||
png_error(png_ptr, "PNG unsigned integer out of range.");
|
||||
png_error(png_ptr, "PNG unsigned integer out of range");
|
||||
return (i);
|
||||
}
|
||||
#ifndef PNG_READ_BIG_ENDIAN_SUPPORTED
|
||||
#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)
|
||||
@@ -101,7 +64,7 @@ png_get_uint_16(png_bytep buf)
|
||||
|
||||
return (i);
|
||||
}
|
||||
#endif /* PNG_READ_BIG_ENDIAN_SUPPORTED */
|
||||
#endif /* PNG_USE_READ_MACROS */
|
||||
|
||||
/* Read the chunk header (length + type name).
|
||||
* Put the type name into png_ptr->chunk_name, and return the length.
|
||||
@@ -112,6 +75,13 @@ png_read_chunk_header(png_structp png_ptr)
|
||||
png_byte buf[8];
|
||||
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 */
|
||||
png_read_data(png_ptr, buf, 8);
|
||||
length = png_get_uint_31(png_ptr, buf);
|
||||
@@ -129,6 +99,13 @@ png_read_chunk_header(png_structp png_ptr)
|
||||
/* 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.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
|
||||
#endif
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
@@ -173,7 +150,8 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
|
||||
}
|
||||
else
|
||||
{
|
||||
png_chunk_error(png_ptr, "CRC error");
|
||||
png_chunk_benign_error(png_ptr, "CRC error");
|
||||
return (0);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
@@ -203,6 +181,12 @@ png_crc_error(png_structp png_ptr)
|
||||
need_crc = 0;
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
png_read_data(png_ptr, crc_bytes, 4);
|
||||
|
||||
if (need_crc)
|
||||
@@ -290,7 +274,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_error(png_ptr,
|
||||
"Not enough memory to decompress chunk.");
|
||||
"Not enough memory to decompress chunk");
|
||||
}
|
||||
png_memcpy(text + prefix_size, png_ptr->zbuf,
|
||||
text_size - prefix_size);
|
||||
@@ -302,16 +286,30 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
png_charp tmp;
|
||||
|
||||
tmp = text;
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
if ((png_ptr->user_chunk_cache_max != 0) &&
|
||||
(--png_ptr->user_chunk_cache_max == 0))
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache");
|
||||
text = NULL;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
#endif
|
||||
text = (png_charp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(text_size +
|
||||
(png_size_t)(text_size +
|
||||
png_ptr->zbuf_size - png_ptr->zstream.avail_out + 1));
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
}
|
||||
#endif
|
||||
if (text == NULL)
|
||||
{
|
||||
png_free(png_ptr, tmp);
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_error(png_ptr,
|
||||
"Not enough memory to decompress chunk..");
|
||||
"Not enough memory to decompress chunk");
|
||||
}
|
||||
png_memcpy(text, tmp, text_size);
|
||||
png_free(png_ptr, tmp);
|
||||
@@ -331,7 +329,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
}
|
||||
if (ret != Z_STREAM_END)
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char umsg[52];
|
||||
|
||||
if (ret == Z_BUF_ERROR)
|
||||
@@ -362,7 +360,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
{
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_error(png_ptr, "Not enough memory for text.");
|
||||
png_error(png_ptr, "Not enough memory for text");
|
||||
}
|
||||
png_memcpy(text, png_ptr->chunkdata, prefix_size);
|
||||
}
|
||||
@@ -378,7 +376,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type,
|
||||
}
|
||||
else /* if (comp_type != PNG_COMPRESSION_TYPE_BASE) */
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char umsg[50];
|
||||
|
||||
png_snprintf(umsg, 50, "Unknown zTXt compression type %d", comp_type);
|
||||
@@ -571,7 +569,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
if (png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN)
|
||||
{
|
||||
png_chunk_error(png_ptr, "CRC error");
|
||||
png_chunk_benign_error(png_ptr, "CRC error");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1109,7 +1107,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_warning(png_ptr, "Ignoring truncated iCCP profile.");
|
||||
png_warning(png_ptr, "Ignoring truncated iCCP profile");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1136,6 +1134,24 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_sPLT");
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
|
||||
if (png_ptr->user_chunk_cache_max != 0)
|
||||
{
|
||||
if (png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (--png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache for sPLT");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before sPLT");
|
||||
else if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||
@@ -1300,7 +1316,7 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_crc_read(png_ptr, buf, 2);
|
||||
png_ptr->num_trans = 1;
|
||||
png_ptr->trans_values.gray = png_get_uint_16(buf);
|
||||
png_ptr->trans_color.gray = png_get_uint_16(buf);
|
||||
}
|
||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_RGB)
|
||||
{
|
||||
@@ -1314,9 +1330,9 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
png_crc_read(png_ptr, buf, (png_size_t)length);
|
||||
png_ptr->num_trans = 1;
|
||||
png_ptr->trans_values.red = png_get_uint_16(buf);
|
||||
png_ptr->trans_values.green = png_get_uint_16(buf + 2);
|
||||
png_ptr->trans_values.blue = png_get_uint_16(buf + 4);
|
||||
png_ptr->trans_color.red = png_get_uint_16(buf);
|
||||
png_ptr->trans_color.green = png_get_uint_16(buf + 2);
|
||||
png_ptr->trans_color.blue = png_get_uint_16(buf + 4);
|
||||
}
|
||||
else if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
@@ -1355,7 +1371,7 @@ png_handle_tRNS(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
}
|
||||
|
||||
png_set_tRNS(png_ptr, info_ptr, readbuf, png_ptr->num_trans,
|
||||
&(png_ptr->trans_values));
|
||||
&(png_ptr->trans_color));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1623,7 +1639,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "No memory for pCAL purpose.");
|
||||
png_warning(png_ptr, "No memory for pCAL purpose");
|
||||
return;
|
||||
}
|
||||
slength = (png_size_t)length;
|
||||
@@ -1684,12 +1700,12 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(3, "Allocating pCAL parameters array");
|
||||
params = (png_charpp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(nparams * png_sizeof(png_charp))) ;
|
||||
(png_size_t)(nparams * png_sizeof(png_charp)));
|
||||
if (params == NULL)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_warning(png_ptr, "No memory for pCAL params.");
|
||||
png_warning(png_ptr, "No memory for pCAL params");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1792,7 +1808,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 width");
|
||||
return;
|
||||
}
|
||||
png_memcpy(swidth, ep, (png_size_t)png_strlen(ep));
|
||||
png_memcpy(swidth, ep, png_strlen(ep));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1827,7 +1843,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");
|
||||
return;
|
||||
}
|
||||
png_memcpy(sheight, ep, (png_size_t)png_strlen(ep));
|
||||
png_memcpy(sheight, ep, png_strlen(ep));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1922,6 +1938,23 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_tEXt");
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
if (png_ptr->user_chunk_cache_max != 0)
|
||||
{
|
||||
if (png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (--png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache for tEXt");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before tEXt");
|
||||
|
||||
@@ -1942,7 +1975,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "No memory to process text chunk.");
|
||||
png_warning(png_ptr, "No memory to process text chunk");
|
||||
return;
|
||||
}
|
||||
slength = (png_size_t)length;
|
||||
@@ -1966,10 +1999,10 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
text++;
|
||||
|
||||
text_ptr = (png_textp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
if (text_ptr == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Not enough memory to process text chunk.");
|
||||
png_warning(png_ptr, "Not enough memory to process text chunk");
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
return;
|
||||
@@ -1990,7 +2023,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->chunkdata = NULL;
|
||||
png_free(png_ptr, text_ptr);
|
||||
if (ret)
|
||||
png_warning(png_ptr, "Insufficient memory to process text chunk.");
|
||||
png_warning(png_ptr, "Insufficient memory to process text chunk");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2007,6 +2040,23 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_zTXt");
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
if (png_ptr->user_chunk_cache_max != 0)
|
||||
{
|
||||
if (png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (--png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache for zTXt");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before zTXt");
|
||||
|
||||
@@ -2028,7 +2078,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Out of memory processing zTXt chunk.");
|
||||
png_warning(png_ptr, "Out of memory processing zTXt chunk");
|
||||
return;
|
||||
}
|
||||
slength = (png_size_t)length;
|
||||
@@ -2069,10 +2119,10 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
(png_size_t)length, prefix_len, &data_len);
|
||||
|
||||
text_ptr = (png_textp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
if (text_ptr == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Not enough memory to process zTXt chunk.");
|
||||
png_warning(png_ptr, "Not enough memory to process zTXt chunk");
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
return;
|
||||
@@ -2093,7 +2143,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
if (ret)
|
||||
png_error(png_ptr, "Insufficient memory to store zTXt chunk.");
|
||||
png_error(png_ptr, "Insufficient memory to store zTXt chunk");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2111,6 +2161,23 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_iTXt");
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
if (png_ptr->user_chunk_cache_max != 0)
|
||||
{
|
||||
if (png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (--png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache for iTXt");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR))
|
||||
png_error(png_ptr, "Missing IHDR before iTXt");
|
||||
|
||||
@@ -2132,7 +2199,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
|
||||
if (png_ptr->chunkdata == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "No memory to process iTXt chunk.");
|
||||
png_warning(png_ptr, "No memory to process iTXt chunk");
|
||||
return;
|
||||
}
|
||||
slength = (png_size_t)length;
|
||||
@@ -2200,10 +2267,10 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
else
|
||||
data_len = png_strlen(png_ptr->chunkdata + prefix_len);
|
||||
text_ptr = (png_textp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)png_sizeof(png_text));
|
||||
png_sizeof(png_text));
|
||||
if (text_ptr == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Not enough memory to process iTXt chunk.");
|
||||
png_warning(png_ptr, "Not enough memory to process iTXt chunk");
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
return;
|
||||
@@ -2222,7 +2289,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_free(png_ptr, png_ptr->chunkdata);
|
||||
png_ptr->chunkdata = NULL;
|
||||
if (ret)
|
||||
png_error(png_ptr, "Insufficient memory to store iTXt chunk.");
|
||||
png_error(png_ptr, "Insufficient memory to store iTXt chunk");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2238,11 +2305,26 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_debug(1, "in png_handle_unknown");
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
if (png_ptr->user_chunk_cache_max != 0)
|
||||
{
|
||||
if (png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
if (--png_ptr->user_chunk_cache_max == 1)
|
||||
{
|
||||
png_warning(png_ptr, "No space in chunk cache for unknown chunk");
|
||||
png_crc_finish(png_ptr, length);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (png_ptr->mode & PNG_HAVE_IDAT)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IDAT;
|
||||
#endif
|
||||
PNG_IDAT;
|
||||
if (png_memcmp(png_ptr->chunk_name, png_IDAT, 4)) /* Not an IDAT */
|
||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||
}
|
||||
@@ -2933,7 +3015,7 @@ png_read_finish_row(png_structp png_ptr)
|
||||
if (png_ptr->interlaced)
|
||||
{
|
||||
png_ptr->row_number = 0;
|
||||
png_memset_check(png_ptr, png_ptr->prev_row, 0,
|
||||
png_memset(png_ptr->prev_row, 0,
|
||||
png_ptr->rowbytes + 1);
|
||||
do
|
||||
{
|
||||
@@ -2968,9 +3050,7 @@ png_read_finish_row(png_structp png_ptr)
|
||||
|
||||
if (!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_CONST PNG_IDAT;
|
||||
#endif
|
||||
PNG_IDAT;
|
||||
char extra;
|
||||
int ret;
|
||||
|
||||
@@ -3017,7 +3097,7 @@ png_read_finish_row(png_structp png_ptr)
|
||||
|
||||
if (!(png_ptr->zstream.avail_out))
|
||||
{
|
||||
png_warning(png_ptr, "Extra compressed data.");
|
||||
png_warning(png_ptr, "Extra compressed data");
|
||||
png_ptr->mode |= PNG_AFTER_IDAT;
|
||||
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
|
||||
break;
|
||||
@@ -3213,22 +3293,21 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
}
|
||||
|
||||
#ifdef PNG_MAX_MALLOC_64K
|
||||
if ((png_uint_32)row_bytes + 1 > (png_uint_32)65536L)
|
||||
if ((png_uint_32)png_ptr->rowbytes + 1 > (png_uint_32)65536L)
|
||||
png_error(png_ptr, "This image requires a row greater than 64KB");
|
||||
#endif
|
||||
if ((png_uint_32)row_bytes > (png_uint_32)(PNG_SIZE_MAX - 1))
|
||||
png_error(png_ptr, "Row has too many bytes to allocate in memory.");
|
||||
if ((png_uint_32)png_ptr->rowbytes > (png_uint_32)(PNG_SIZE_MAX - 1))
|
||||
png_error(png_ptr, "Row has too many bytes to allocate in memory");
|
||||
|
||||
if (row_bytes + 1 > png_ptr->old_prev_row_size)
|
||||
if (png_ptr->rowbytes + 1 > png_ptr->old_prev_row_size)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->prev_row);
|
||||
png_ptr->prev_row = (png_bytep)png_malloc(png_ptr, (png_uint_32)(
|
||||
row_bytes + 1));
|
||||
png_memset_check(png_ptr, png_ptr->prev_row, 0, row_bytes + 1);
|
||||
png_ptr->old_prev_row_size = row_bytes + 1;
|
||||
png_ptr->rowbytes + 1));
|
||||
png_ptr->old_prev_row_size = png_ptr->rowbytes + 1;
|
||||
}
|
||||
|
||||
png_ptr->rowbytes = row_bytes;
|
||||
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);
|
||||
|
||||
192
pngset.c
192
pngset.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -16,9 +16,9 @@
|
||||
* info struct and allows us to change the structure in the future.
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#include "pngpriv.h"
|
||||
|
||||
#ifdef PNG_bKGD_SUPPORTED
|
||||
void PNGAPI
|
||||
@@ -191,21 +191,19 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
||||
> PNG_MAX_PALETTE_LENGTH)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Invalid palette size, hIST allocation skipped.");
|
||||
"Invalid palette size, hIST allocation skipped");
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_HIST, 0);
|
||||
#endif
|
||||
/* Changed from info->num_palette to PNG_MAX_PALETTE_LENGTH in
|
||||
* version 1.2.1
|
||||
*/
|
||||
png_ptr->hist = (png_uint_16p)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16)));
|
||||
PNG_MAX_PALETTE_LENGTH * png_sizeof(png_uint_16));
|
||||
if (png_ptr->hist == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory for hIST chunk data.");
|
||||
png_warning(png_ptr, "Insufficient memory for hIST chunk data");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -214,11 +212,7 @@ png_set_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p hist)
|
||||
info_ptr->hist = png_ptr->hist;
|
||||
info_ptr->valid |= PNG_INFO_hIST;
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_HIST;
|
||||
#else
|
||||
png_ptr->flags |= PNG_FLAG_FREE_HIST;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -262,7 +256,7 @@ png_set_IHDR(png_structp png_ptr, png_infop info_ptr,
|
||||
- 1 /* filter byte */
|
||||
- 7*8 /* rounding of width to multiple of 8 pixels */
|
||||
- 8) /* extra max_pixel_depth pad */
|
||||
info_ptr->rowbytes = (png_size_t)0;
|
||||
info_ptr->rowbytes = 0;
|
||||
else
|
||||
info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width);
|
||||
}
|
||||
@@ -290,7 +284,7 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams,
|
||||
png_charp units, png_charpp params)
|
||||
{
|
||||
png_uint_32 length;
|
||||
png_size_t length;
|
||||
int i;
|
||||
|
||||
png_debug1(1, "in %s storage function", "pCAL");
|
||||
@@ -304,10 +298,10 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_purpose == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL purpose.");
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL purpose");
|
||||
return;
|
||||
}
|
||||
png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length);
|
||||
png_memcpy(info_ptr->pcal_purpose, purpose, length);
|
||||
|
||||
png_debug(3, "storing X0, X1, type, and nparams in info");
|
||||
info_ptr->pcal_X0 = X0;
|
||||
@@ -321,16 +315,16 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_units == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL units.");
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL units");
|
||||
return;
|
||||
}
|
||||
png_memcpy(info_ptr->pcal_units, units, (png_size_t)length);
|
||||
png_memcpy(info_ptr->pcal_units, units, length);
|
||||
|
||||
info_ptr->pcal_params = (png_charpp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)((nparams + 1) * png_sizeof(png_charp)));
|
||||
(png_size_t)((nparams + 1) * png_sizeof(png_charp)));
|
||||
if (info_ptr->pcal_params == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL params.");
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL params");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -344,16 +338,14 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (info_ptr->pcal_params[i] == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL parameter.");
|
||||
png_warning(png_ptr, "Insufficient memory for pCAL parameter");
|
||||
return;
|
||||
}
|
||||
png_memcpy(info_ptr->pcal_params[i], params[i], (png_size_t)length);
|
||||
png_memcpy(info_ptr->pcal_params[i], params[i], length);
|
||||
}
|
||||
|
||||
info_ptr->valid |= PNG_INFO_pCAL;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_PCAL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -380,7 +372,7 @@ void PNGAPI
|
||||
png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
int unit, png_charp swidth, png_charp sheight)
|
||||
{
|
||||
png_uint_32 length;
|
||||
png_size_t length;
|
||||
|
||||
png_debug1(1, "in %s storage function", "sCAL");
|
||||
|
||||
@@ -396,10 +388,10 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
if (info_ptr->scal_s_width == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Memory allocation failed while processing sCAL.");
|
||||
"Memory allocation failed while processing sCAL");
|
||||
return;
|
||||
}
|
||||
png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length);
|
||||
png_memcpy(info_ptr->scal_s_width, swidth, length);
|
||||
|
||||
length = png_strlen(sheight) + 1;
|
||||
png_debug1(3, "allocating unit for info (%u bytes)",
|
||||
@@ -410,14 +402,12 @@ png_set_sCAL_s(png_structp png_ptr, png_infop info_ptr,
|
||||
png_free (png_ptr, info_ptr->scal_s_width);
|
||||
info_ptr->scal_s_width = NULL;
|
||||
png_warning(png_ptr,
|
||||
"Memory allocation failed while processing sCAL.");
|
||||
"Memory allocation failed while processing sCAL");
|
||||
return;
|
||||
}
|
||||
png_memcpy(info_ptr->scal_s_height, sheight, (png_size_t)length);
|
||||
png_memcpy(info_ptr->scal_s_height, sheight, length);
|
||||
info_ptr->valid |= PNG_INFO_sCAL;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_SCAL;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -466,9 +456,7 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
||||
* function used to do the allocation.
|
||||
*/
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_PLTE, 0);
|
||||
#endif
|
||||
|
||||
/* Changed in libpng-1.2.1 to allocate PNG_MAX_PALETTE_LENGTH instead
|
||||
* of num_palette entries, in case of an invalid PNG file that has
|
||||
@@ -480,11 +468,7 @@ png_set_PLTE(png_structp png_ptr, png_infop info_ptr,
|
||||
info_ptr->palette = png_ptr->palette;
|
||||
info_ptr->num_palette = png_ptr->num_palette = (png_uint_16)num_palette;
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_PLTE;
|
||||
#else
|
||||
png_ptr->flags |= PNG_FLAG_FREE_PLTE;
|
||||
#endif
|
||||
|
||||
info_ptr->valid |= PNG_INFO_PLTE;
|
||||
}
|
||||
@@ -608,7 +592,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
new_iccp_name = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
if (new_iccp_name == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "Insufficient memory to process iCCP chunk.");
|
||||
png_warning(png_ptr, "Insufficient memory to process iCCP chunk");
|
||||
return;
|
||||
}
|
||||
png_memcpy(new_iccp_name, name, length);
|
||||
@@ -617,7 +601,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
{
|
||||
png_free (png_ptr, new_iccp_name);
|
||||
png_warning(png_ptr,
|
||||
"Insufficient memory to process iCCP profile.");
|
||||
"Insufficient memory to process iCCP profile");
|
||||
return;
|
||||
}
|
||||
png_memcpy(new_iccp_profile, profile, (png_size_t)proflen);
|
||||
@@ -630,9 +614,7 @@ png_set_iCCP(png_structp png_ptr, png_infop info_ptr,
|
||||
/* Compression is always zero but is here so the API and info structure
|
||||
* does not have to change if we introduce multiple compression types */
|
||||
info_ptr->iccp_compression = (png_byte)compression_type;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_ICCP;
|
||||
#endif
|
||||
info_ptr->valid |= PNG_INFO_iCCP;
|
||||
}
|
||||
#endif
|
||||
@@ -675,7 +657,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
||||
old_text = info_ptr->text;
|
||||
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
||||
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
||||
if (info_ptr->text == NULL)
|
||||
{
|
||||
png_free(png_ptr, old_text);
|
||||
@@ -690,12 +672,10 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
info_ptr->max_text = num_text + 8;
|
||||
info_ptr->num_text = 0;
|
||||
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(info_ptr->max_text * png_sizeof(png_text)));
|
||||
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
||||
if (info_ptr->text == NULL)
|
||||
return(1);
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_TEXT;
|
||||
#endif
|
||||
}
|
||||
png_debug1(3, "allocated %d entries for info_ptr->text",
|
||||
info_ptr->max_text);
|
||||
@@ -733,7 +713,7 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
}
|
||||
#else /* PNG_iTXt_SUPPORTED */
|
||||
{
|
||||
png_warning(png_ptr, "iTXt chunk not supported.");
|
||||
png_warning(png_ptr, "iTXt chunk not supported");
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -756,12 +736,12 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
|
||||
}
|
||||
|
||||
textp->key = (png_charp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)
|
||||
(png_size_t)
|
||||
(key_len + text_length + lang_len + lang_key_len + 4));
|
||||
if (textp->key == NULL)
|
||||
return(1);
|
||||
png_debug2(2, "Allocated %lu bytes at %x in png_set_text",
|
||||
(png_uint_32)
|
||||
(unsigned long)(png_uint_32)
|
||||
(key_len + lang_len + lang_key_len + text_length + 4),
|
||||
(int)textp->key);
|
||||
|
||||
@@ -832,43 +812,41 @@ png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time)
|
||||
#ifdef PNG_tRNS_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
png_bytep trans, int num_trans, png_color_16p trans_values)
|
||||
png_bytep trans_alpha, int num_trans, png_color_16p trans_color)
|
||||
{
|
||||
png_debug1(1, "in %s storage function", "tRNS");
|
||||
|
||||
if (png_ptr == NULL || info_ptr == NULL)
|
||||
return;
|
||||
|
||||
if (trans != NULL)
|
||||
if (trans_alpha != NULL)
|
||||
{
|
||||
/* It may not actually be necessary to set png_ptr->trans here;
|
||||
/* It may not actually be necessary to set png_ptr->trans_alpha here;
|
||||
* we do it for backward compatibility with the way the png_handle_tRNS
|
||||
* function used to do the allocation.
|
||||
*/
|
||||
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_free_data(png_ptr, info_ptr, PNG_FREE_TRNS, 0);
|
||||
#endif
|
||||
|
||||
/* Changed from num_trans to PNG_MAX_PALETTE_LENGTH in version 1.2.1 */
|
||||
png_ptr->trans = info_ptr->trans = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)PNG_MAX_PALETTE_LENGTH);
|
||||
png_ptr->trans_alpha = info_ptr->trans_alpha = (png_bytep)png_malloc(png_ptr,
|
||||
(png_size_t)PNG_MAX_PALETTE_LENGTH);
|
||||
if (num_trans > 0 && num_trans <= PNG_MAX_PALETTE_LENGTH)
|
||||
png_memcpy(info_ptr->trans, trans, (png_size_t)num_trans);
|
||||
png_memcpy(info_ptr->trans_alpha, trans_alpha, (png_size_t)num_trans);
|
||||
}
|
||||
|
||||
if (trans_values != NULL)
|
||||
if (trans_color != NULL)
|
||||
{
|
||||
int sample_max = (1 << info_ptr->bit_depth);
|
||||
if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY &&
|
||||
(int)trans_values->gray > sample_max) ||
|
||||
(int)trans_color->gray > sample_max) ||
|
||||
(info_ptr->color_type == PNG_COLOR_TYPE_RGB &&
|
||||
((int)trans_values->red > sample_max ||
|
||||
(int)trans_values->green > sample_max ||
|
||||
(int)trans_values->blue > sample_max)))
|
||||
((int)trans_color->red > sample_max ||
|
||||
(int)trans_color->green > sample_max ||
|
||||
(int)trans_color->blue > sample_max)))
|
||||
png_warning(png_ptr,
|
||||
"tRNS chunk has out-of-range samples for bit_depth");
|
||||
png_memcpy(&(info_ptr->trans_values), trans_values,
|
||||
png_memcpy(&(info_ptr->trans_color), trans_color,
|
||||
png_sizeof(png_color_16));
|
||||
if (num_trans == 0)
|
||||
num_trans = 1;
|
||||
@@ -878,11 +856,7 @@ png_set_tRNS(png_structp png_ptr, png_infop info_ptr,
|
||||
if (num_trans != 0)
|
||||
{
|
||||
info_ptr->valid |= PNG_INFO_tRNS;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_TRNS;
|
||||
#else
|
||||
png_ptr->flags |= PNG_FLAG_FREE_TRNS;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -907,10 +881,10 @@ png_set_sPLT(png_structp png_ptr,
|
||||
|
||||
np = (png_sPLT_tp)png_malloc_warn(png_ptr,
|
||||
(info_ptr->splt_palettes_num + nentries) *
|
||||
(png_uint_32)png_sizeof(png_sPLT_t));
|
||||
(png_size_t)png_sizeof(png_sPLT_t));
|
||||
if (np == NULL)
|
||||
{
|
||||
png_warning(png_ptr, "No memory for sPLT palettes.");
|
||||
png_warning(png_ptr, "No memory for sPLT palettes");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -926,7 +900,7 @@ png_set_sPLT(png_structp png_ptr,
|
||||
png_uint_32 length;
|
||||
|
||||
length = png_strlen(from->name) + 1;
|
||||
to->name = (png_charp)png_malloc_warn(png_ptr, length);
|
||||
to->name = (png_charp)png_malloc_warn(png_ptr, (png_size_t)length);
|
||||
if (to->name == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
@@ -935,7 +909,7 @@ png_set_sPLT(png_structp png_ptr,
|
||||
}
|
||||
png_memcpy(to->name, from->name, length);
|
||||
to->entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)(from->nentries * png_sizeof(png_sPLT_entry)));
|
||||
(png_size_t)(from->nentries * png_sizeof(png_sPLT_entry)));
|
||||
if (to->entries == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
@@ -953,9 +927,7 @@ png_set_sPLT(png_structp png_ptr,
|
||||
info_ptr->splt_palettes = np;
|
||||
info_ptr->splt_palettes_num += nentries;
|
||||
info_ptr->valid |= PNG_INFO_sPLT;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_SPLT;
|
||||
#endif
|
||||
}
|
||||
#endif /* PNG_sPLT_SUPPORTED */
|
||||
|
||||
@@ -971,19 +943,18 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
return;
|
||||
|
||||
np = (png_unknown_chunkp)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)((info_ptr->unknown_chunks_num + num_unknowns) *
|
||||
(png_size_t)((info_ptr->unknown_chunks_num + num_unknowns) *
|
||||
png_sizeof(png_unknown_chunk)));
|
||||
if (np == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Out of memory while processing unknown chunk.");
|
||||
"Out of memory while processing unknown chunk");
|
||||
return;
|
||||
}
|
||||
|
||||
png_memcpy(np, info_ptr->unknown_chunks,
|
||||
info_ptr->unknown_chunks_num * png_sizeof(png_unknown_chunk));
|
||||
png_free(png_ptr, info_ptr->unknown_chunks);
|
||||
info_ptr->unknown_chunks=NULL;
|
||||
|
||||
for (i = 0; i < num_unknowns; i++)
|
||||
{
|
||||
@@ -1003,11 +974,11 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
else
|
||||
{
|
||||
to->data = (png_bytep)png_malloc_warn(png_ptr,
|
||||
(png_uint_32)from->size);
|
||||
(png_size_t)from->size);
|
||||
if (to->data == NULL)
|
||||
{
|
||||
png_warning(png_ptr,
|
||||
"Out of memory while processing unknown chunk.");
|
||||
"Out of memory while processing unknown chunk");
|
||||
to->size = 0;
|
||||
}
|
||||
else
|
||||
@@ -1017,9 +988,7 @@ png_set_unknown_chunks(png_structp png_ptr,
|
||||
|
||||
info_ptr->unknown_chunks = np;
|
||||
info_ptr->unknown_chunks_num += num_unknowns;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
info_ptr->free_me |= PNG_FREE_UNKN;
|
||||
#endif
|
||||
}
|
||||
void PNGAPI
|
||||
png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
|
||||
@@ -1031,25 +1000,6 @@ png_set_unknown_chunk_location(png_structp png_ptr, png_infop info_ptr,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
#if defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
|
||||
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
|
||||
void PNGAPI
|
||||
png_permit_empty_plte (png_structp png_ptr, int empty_plte_permitted)
|
||||
{
|
||||
/* This function is deprecated in favor of png_permit_mng_features()
|
||||
and will be removed from libpng-1.3.0 */
|
||||
|
||||
png_debug(1, "in png_permit_empty_plte, DEPRECATED.");
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
png_ptr->mng_features_permitted = (png_byte)
|
||||
((png_ptr->mng_features_permitted & (~PNG_FLAG_MNG_EMPTY_PLTE)) |
|
||||
((empty_plte_permitted & PNG_FLAG_MNG_EMPTY_PLTE)));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||
png_uint_32 PNGAPI
|
||||
@@ -1091,7 +1041,7 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
||||
return;
|
||||
old_num_chunks = png_ptr->num_chunk_list;
|
||||
new_list=(png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)
|
||||
(png_size_t)
|
||||
(5*(num_chunks + old_num_chunks)));
|
||||
if (png_ptr->chunk_list != NULL)
|
||||
{
|
||||
@@ -1106,9 +1056,7 @@ png_set_keep_unknown_chunks(png_structp png_ptr, int keep, png_bytep
|
||||
*p=(png_byte)keep;
|
||||
png_ptr->num_chunk_list = old_num_chunks + num_chunks;
|
||||
png_ptr->chunk_list = new_list;
|
||||
#ifdef PNG_FREE_ME_SUPPORTED
|
||||
png_ptr->free_me |= PNG_FREE_LIST;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1147,12 +1095,12 @@ png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers)
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
void PNGAPI
|
||||
png_set_compression_buffer_size(png_structp png_ptr,
|
||||
png_uint_32 size)
|
||||
png_size_t size)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf_size = (png_size_t)size;
|
||||
png_ptr->zbuf_size = size;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr, size);
|
||||
png_ptr->zstream.next_out = png_ptr->zbuf;
|
||||
png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size;
|
||||
@@ -1167,32 +1115,6 @@ png_set_invalid(png_structp png_ptr, png_infop info_ptr, int mask)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PNG_1_0_X
|
||||
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
|
||||
/* Function was added to libpng 1.2.0 and should always exist by default */
|
||||
void PNGAPI
|
||||
png_set_asm_flags (png_structp png_ptr, png_uint_32 asm_flags)
|
||||
{
|
||||
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
||||
if (png_ptr != NULL)
|
||||
png_ptr->asm_flags = 0;
|
||||
asm_flags = asm_flags; /* Quiet the compiler */
|
||||
}
|
||||
|
||||
/* This function was added to libpng 1.2.0 */
|
||||
void PNGAPI
|
||||
png_set_mmx_thresholds (png_structp png_ptr,
|
||||
png_byte mmx_bitdepth_threshold,
|
||||
png_uint_32 mmx_rowbytes_threshold)
|
||||
{
|
||||
/* Obsolete as of libpng-1.2.20 and will be removed from libpng-1.4.0 */
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
/* Quiet the compiler */
|
||||
mmx_bitdepth_threshold = mmx_bitdepth_threshold;
|
||||
mmx_rowbytes_threshold = mmx_rowbytes_threshold;
|
||||
}
|
||||
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
|
||||
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
/* This function was added to libpng 1.2.6 */
|
||||
@@ -1209,6 +1131,19 @@ png_set_user_limits (png_structp png_ptr, png_uint_32 user_width_max,
|
||||
png_ptr->user_width_max = user_width_max;
|
||||
png_ptr->user_height_max = user_height_max;
|
||||
}
|
||||
/* This function was added to libpng 1.4.0 */
|
||||
void PNGAPI
|
||||
png_set_chunk_cache_max (png_structp png_ptr,
|
||||
png_uint_32 user_chunk_cache_max)
|
||||
{
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
|
||||
if (user_chunk_cache_max == 0x7fffffffL) /* Unlimited */
|
||||
png_ptr->user_chunk_cache_max = 0;
|
||||
else
|
||||
png_ptr->user_chunk_cache_max = user_chunk_cache_max + 1;
|
||||
}
|
||||
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
|
||||
|
||||
|
||||
@@ -1224,5 +1159,4 @@ png_set_benign_errors(png_structp png_ptr, int allowed)
|
||||
png_ptr->flags &= ~PNG_FLAG_BENIGN_ERRORS_WARN;
|
||||
}
|
||||
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
|
||||
#endif /* ?PNG_1_0_X */
|
||||
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||
|
||||
156
pngtest.c
156
pngtest.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtest.c - a simple test program to test libpng
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -32,34 +32,14 @@
|
||||
*/
|
||||
|
||||
#include "png.h"
|
||||
#include "pngpriv.h"
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
# if _WIN32_WCE < 211
|
||||
__error__ (f|w)printf functions are not supported on old WindowsCE.;
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <stdlib.h>
|
||||
# define READFILE(file, data, length, check) \
|
||||
if (ReadFile(file, data, length, &check, NULL)) check = 0
|
||||
# define WRITEFILE(file, data, length, check)) \
|
||||
if (WriteFile(file, data, length, &check, NULL)) check = 0
|
||||
# define FCLOSE(file) CloseHandle(file)
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# define READFILE(file, data, length, check) \
|
||||
check=(png_size_t)fread(data, (png_size_t)1, length, file)
|
||||
# define WRITEFILE(file, data, length, check) \
|
||||
check=(png_size_t)fwrite(data, (png_size_t)1, length, file)
|
||||
# define FCLOSE(file) fclose(file)
|
||||
#endif
|
||||
|
||||
#ifndef PNG_STDIO_SUPPORTED
|
||||
# ifdef _WIN32_WCE
|
||||
typedef HANDLE png_FILE_p;
|
||||
# else
|
||||
typedef FILE * png_FILE_p;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Makes pngtest verbose so we can find problems (needs to be before png.h) */
|
||||
@@ -118,14 +98,8 @@ static int status_dots_requested = 0;
|
||||
static int status_dots = 1;
|
||||
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
|
||||
{
|
||||
if (png_ptr == NULL || row_number > PNG_UINT_31_MAX)
|
||||
@@ -146,14 +120,8 @@ read_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
|
||||
}
|
||||
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass);
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
|
||||
{
|
||||
if (png_ptr == NULL || row_number > PNG_UINT_31_MAX || pass > 7)
|
||||
@@ -169,14 +137,8 @@ write_row_callback(png_structp png_ptr, png_uint_32 row_number, int pass)
|
||||
*/
|
||||
static png_uint_32 filters_used[256];
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data);
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
|
||||
{
|
||||
if (png_ptr != NULL && row_info != NULL)
|
||||
@@ -192,14 +154,8 @@ count_filters(png_structp png_ptr, png_row_infop row_info, png_bytep data)
|
||||
static png_uint_32 zero_samples;
|
||||
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data);
|
||||
void
|
||||
#ifdef PNG_1_0_X
|
||||
PNGAPI
|
||||
#endif
|
||||
count_zero_samples(png_structp png_ptr, png_row_infop row_info, png_bytep data)
|
||||
{
|
||||
png_bytep dp = data;
|
||||
@@ -316,7 +272,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
|
||||
* instead of an int, which is what fread() actually returns.
|
||||
*/
|
||||
READFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
|
||||
check = fread(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
|
||||
|
||||
if (check != length)
|
||||
{
|
||||
@@ -335,7 +291,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
static void
|
||||
pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
int check;
|
||||
png_size_t check;
|
||||
png_byte *n_data;
|
||||
png_FILE_p io_ptr;
|
||||
|
||||
@@ -344,7 +300,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
|
||||
if ((png_bytep)n_data == data)
|
||||
{
|
||||
READFILE(io_ptr, n_data, length, check);
|
||||
check = fread(n_data, 1, length, io_ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -355,7 +311,7 @@ pngtest_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
do
|
||||
{
|
||||
read = MIN(NEAR_BUF_SIZE, remaining);
|
||||
READFILE(io_ptr, buf, 1, err);
|
||||
err = fread(buf, 1, 1, io_ptr);
|
||||
png_memcpy(data, buf, read); /* Copy far buffer to near buffer */
|
||||
if (err != read)
|
||||
break;
|
||||
@@ -389,9 +345,9 @@ pngtest_flush(png_structp png_ptr)
|
||||
static void
|
||||
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_uint_32 check;
|
||||
png_size_t check;
|
||||
|
||||
WRITEFILE((png_FILE_p)png_ptr->io_ptr, data, length, check);
|
||||
check = fwrite(data, 1, length, (png_FILE_p)png_ptr->io_ptr);
|
||||
if (check != length)
|
||||
{
|
||||
png_error(png_ptr, "Write Error");
|
||||
@@ -409,7 +365,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
static void
|
||||
pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
png_uint_32 check;
|
||||
png_size_t check;
|
||||
png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */
|
||||
png_FILE_p io_ptr;
|
||||
|
||||
@@ -418,7 +374,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
|
||||
if ((png_bytep)near_data == data)
|
||||
{
|
||||
WRITEFILE(io_ptr, near_data, length, check);
|
||||
check = fwrite(near_data, 1, length, io_ptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -430,7 +386,7 @@ pngtest_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
written = MIN(NEAR_BUF_SIZE, remaining);
|
||||
png_memcpy(buf, data, written); /* Copy far buffer to near buffer */
|
||||
WRITEFILE(io_ptr, buf, written, err);
|
||||
err = fwrite(buf, 1, written, io_ptr);
|
||||
if (err != written)
|
||||
break;
|
||||
else
|
||||
@@ -491,7 +447,7 @@ pngtest_error(png_structp png_ptr, png_const_charp message)
|
||||
*/
|
||||
typedef struct memory_information
|
||||
{
|
||||
png_uint_32 size;
|
||||
png_alloc_size_t size;
|
||||
png_voidp pointer;
|
||||
struct memory_information FAR *next;
|
||||
} memory_information;
|
||||
@@ -503,11 +459,12 @@ static int maximum_allocation = 0;
|
||||
static int total_allocation = 0;
|
||||
static int num_allocations = 0;
|
||||
|
||||
png_voidp png_debug_malloc PNGARG((png_structp png_ptr, png_uint_32 size));
|
||||
png_voidp png_debug_malloc
|
||||
PNGARG((png_structp png_ptr, png_alloc_size_t size));
|
||||
void png_debug_free PNGARG((png_structp png_ptr, png_voidp ptr));
|
||||
|
||||
png_voidp
|
||||
png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
png_debug_malloc(png_structp png_ptr, png_alloc_size_t size)
|
||||
{
|
||||
|
||||
/* png_malloc has already tested for NULL; png_create_struct calls
|
||||
@@ -524,24 +481,23 @@ png_debug_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
memory_infop pinfo;
|
||||
png_set_mem_fn(png_ptr, NULL, NULL, NULL);
|
||||
pinfo = (memory_infop)png_malloc(png_ptr,
|
||||
(png_uint_32)png_sizeof(*pinfo));
|
||||
png_sizeof(*pinfo));
|
||||
pinfo->size = size;
|
||||
current_allocation += size;
|
||||
total_allocation += size;
|
||||
num_allocations ++;
|
||||
if (current_allocation > maximum_allocation)
|
||||
maximum_allocation = current_allocation;
|
||||
pinfo->pointer = (png_voidp)png_malloc(png_ptr, size);
|
||||
pinfo->pointer = png_malloc(png_ptr, size);
|
||||
/* Restore malloc_fn and free_fn */
|
||||
png_set_mem_fn(png_ptr,
|
||||
png_voidp_NULL, (png_malloc_ptr)png_debug_malloc,
|
||||
(png_free_ptr)png_debug_free);
|
||||
NULL, png_debug_malloc, png_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->png_debug_malloc");
|
||||
}
|
||||
pinfo->next = pinformation;
|
||||
pinformation = pinfo;
|
||||
@@ -701,30 +657,17 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
TCHAR path[MAX_PATH];
|
||||
#endif
|
||||
char inbuf[256], outbuf[256];
|
||||
|
||||
row_buf = NULL;
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
||||
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||
#else
|
||||
if ((fpin = fopen(inname, "rb")) == NULL)
|
||||
#endif
|
||||
{
|
||||
fprintf(STDERR, "Could not find input file %s\n", inname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
||||
if ((fpout = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||
#else
|
||||
if ((fpout = fopen(outname, "wb")) == NULL)
|
||||
#endif
|
||||
{
|
||||
fprintf(STDERR, "Could not open output file %s\n", outname);
|
||||
FCLOSE(fpin);
|
||||
@@ -734,13 +677,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
png_debug(0, "Allocating read and write structures");
|
||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||
read_ptr =
|
||||
png_create_read_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL,
|
||||
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);
|
||||
#else
|
||||
read_ptr =
|
||||
png_create_read_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL);
|
||||
png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
#endif
|
||||
#ifndef PNG_STDIO_SUPPORTED
|
||||
png_set_error_fn(read_ptr, (png_voidp)inname, pngtest_error,
|
||||
@@ -759,13 +701,11 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||
write_ptr =
|
||||
png_create_write_struct_2(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL, png_voidp_NULL,
|
||||
(png_malloc_ptr)png_debug_malloc, (png_free_ptr)png_debug_free);
|
||||
png_create_write_struct_2(PNG_LIBPNG_VER_STRING, NULL,
|
||||
NULL, NULL, NULL, png_debug_malloc, png_debug_free);
|
||||
#else
|
||||
write_ptr =
|
||||
png_create_write_struct(PNG_LIBPNG_VER_STRING, png_voidp_NULL,
|
||||
png_error_ptr_NULL, png_error_ptr_NULL);
|
||||
png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||
#endif
|
||||
#ifndef PNG_STDIO_SUPPORTED
|
||||
png_set_error_fn(write_ptr, (png_voidp)inname, pngtest_error,
|
||||
@@ -855,9 +795,9 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
else
|
||||
{
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
png_set_write_status_fn(write_ptr, png_write_status_ptr_NULL);
|
||||
png_set_write_status_fn(write_ptr, NULL);
|
||||
#endif
|
||||
png_set_read_status_fn(read_ptr, png_read_status_ptr_NULL);
|
||||
png_set_read_status_fn(read_ptr, NULL);
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||
@@ -878,14 +818,14 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
# define PNG_HANDLE_CHUNK_ALWAYS 3
|
||||
# endif
|
||||
png_set_keep_unknown_chunks(read_ptr, PNG_HANDLE_CHUNK_ALWAYS,
|
||||
png_bytep_NULL, 0);
|
||||
NULL, 0);
|
||||
#endif
|
||||
#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
|
||||
# ifndef PNG_HANDLE_CHUNK_IF_SAFE
|
||||
# define PNG_HANDLE_CHUNK_IF_SAFE 2
|
||||
# endif
|
||||
png_set_keep_unknown_chunks(write_ptr, PNG_HANDLE_CHUNK_IF_SAFE,
|
||||
png_bytep_NULL, 0);
|
||||
NULL, 0);
|
||||
#endif
|
||||
|
||||
png_debug(0, "Reading info struct");
|
||||
@@ -1105,23 +1045,23 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
#endif
|
||||
#ifdef PNG_tRNS_SUPPORTED
|
||||
{
|
||||
png_bytep trans;
|
||||
png_bytep trans_alpha;
|
||||
int num_trans;
|
||||
png_color_16p trans_values;
|
||||
png_color_16p trans_color;
|
||||
|
||||
if (png_get_tRNS(read_ptr, read_info_ptr, &trans, &num_trans,
|
||||
&trans_values))
|
||||
if (png_get_tRNS(read_ptr, read_info_ptr, &trans_alpha, &num_trans,
|
||||
&trans_color))
|
||||
{
|
||||
int sample_max = (1 << bit_depth);
|
||||
/* libpng doesn't reject a tRNS chunk with out-of-range samples */
|
||||
if (!((color_type == PNG_COLOR_TYPE_GRAY &&
|
||||
(int)trans_values->gray > sample_max) ||
|
||||
(int)trans_color->gray > sample_max) ||
|
||||
(color_type == PNG_COLOR_TYPE_RGB &&
|
||||
((int)trans_values->red > sample_max ||
|
||||
(int)trans_values->green > sample_max ||
|
||||
(int)trans_values->blue > sample_max))))
|
||||
png_set_tRNS(write_ptr, write_info_ptr, trans, num_trans,
|
||||
trans_values);
|
||||
((int)trans_color->red > sample_max ||
|
||||
(int)trans_color->green > sample_max ||
|
||||
(int)trans_color->blue > sample_max))))
|
||||
png_set_tRNS(write_ptr, write_info_ptr, trans_alpha, num_trans,
|
||||
trans_color);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1224,7 +1164,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
png_debug2(0, "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, png_bytepp_NULL, 1);
|
||||
png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1);
|
||||
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#ifdef PNGTEST_TIMING
|
||||
@@ -1346,23 +1286,13 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
FCLOSE(fpout);
|
||||
|
||||
png_debug(0, "Opening files for comparison");
|
||||
#ifdef _WIN32_WCE
|
||||
MultiByteToWideChar(CP_ACP, 0, inname, -1, path, MAX_PATH);
|
||||
if ((fpin = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||
#else
|
||||
if ((fpin = fopen(inname, "rb")) == NULL)
|
||||
#endif
|
||||
{
|
||||
fprintf(STDERR, "Could not find file %s\n", inname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
MultiByteToWideChar(CP_ACP, 0, outname, -1, path, MAX_PATH);
|
||||
if ((fpout = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL)) == INVALID_HANDLE_VALUE)
|
||||
#else
|
||||
if ((fpout = fopen(outname, "rb")) == NULL)
|
||||
#endif
|
||||
{
|
||||
fprintf(STDERR, "Could not find file %s\n", outname);
|
||||
FCLOSE(fpin);
|
||||
@@ -1373,8 +1303,8 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
||||
{
|
||||
png_size_t num_in, num_out;
|
||||
|
||||
READFILE(fpin, inbuf, 1, num_in);
|
||||
READFILE(fpout, outbuf, 1, num_out);
|
||||
num_in = fread(inbuf, 1, 1, fpin);
|
||||
num_out = fread(outbuf, 1, 1, fpout);
|
||||
|
||||
if (num_in != num_out)
|
||||
{
|
||||
@@ -1689,4 +1619,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef version_1_2_41beta19 your_png_h_is_not_version_1_2_41beta19;
|
||||
typedef version_1_4_0beta97 your_png_h_is_not_version_1_4_0beta97;
|
||||
|
||||
BIN
pngtest.png
BIN
pngtest.png
Binary file not shown.
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
27
pngtrans.c
27
pngtrans.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -11,9 +11,9 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
|
||||
#include "pngpriv.h"
|
||||
|
||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
|
||||
/* Turn on BGR-to-RGB mapping */
|
||||
@@ -117,11 +117,7 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
png_ptr->transformations |= PNG_FILLER;
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
png_ptr->filler = (png_byte)filler;
|
||||
#else
|
||||
png_ptr->filler = (png_uint_16)filler;
|
||||
#endif
|
||||
if (filler_loc == PNG_FILLER_AFTER)
|
||||
png_ptr->flags |= PNG_FLAG_FILLER_AFTER;
|
||||
else
|
||||
@@ -146,7 +142,6 @@ png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef PNG_1_0_X
|
||||
/* Added to libpng-1.2.7 */
|
||||
void PNGAPI
|
||||
png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
@@ -158,7 +153,6 @@ png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc)
|
||||
png_set_filler(png_ptr, filler, filler_loc);
|
||||
png_ptr->transformations |= PNG_ADD_ALPHA;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -208,10 +202,6 @@ png_do_invert(png_row_infop row_info, png_bytep row)
|
||||
/* This test removed from libpng version 1.0.13 and 1.2.0:
|
||||
* if (row_info->bit_depth == 1 &&
|
||||
*/
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row == NULL || row_info == NULL)
|
||||
return;
|
||||
#endif
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_GRAY)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
@@ -262,9 +252,6 @@ png_do_swap(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_swap");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->bit_depth == 16)
|
||||
{
|
||||
png_bytep rp = row;
|
||||
@@ -394,9 +381,6 @@ png_do_packswap(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_packswap");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->bit_depth < 8)
|
||||
{
|
||||
png_bytep rp, end, table;
|
||||
@@ -426,9 +410,6 @@ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags)
|
||||
{
|
||||
png_debug(1, "in png_do_strip_filler");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
png_bytep sp=row;
|
||||
png_bytep dp=row;
|
||||
@@ -586,9 +567,6 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_bgr");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
png_uint_32 row_width = row_info->width;
|
||||
@@ -657,7 +635,6 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
|
||||
#endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */
|
||||
|
||||
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
|
||||
defined(PNG_LEGACY_SUPPORTED) || \
|
||||
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
|
||||
void PNGAPI
|
||||
png_set_user_transform_info(png_structp png_ptr, png_voidp
|
||||
|
||||
25
pngwio.c
25
pngwio.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwio.c - functions for data output
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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,9 +18,9 @@
|
||||
* them at run time with png_set_write_fn(...).
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Write the data to whatever output you are using. The default routine
|
||||
* writes to a file pointer. Note that this routine sometimes gets called
|
||||
@@ -52,12 +52,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
|
||||
check = 0;
|
||||
#else
|
||||
check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
|
||||
#endif
|
||||
if (check != length)
|
||||
png_error(png_ptr, "Write Error");
|
||||
}
|
||||
@@ -84,12 +79,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
|
||||
if ((png_bytep)near_data == data)
|
||||
{
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !WriteFile(io_ptr, near_data, length, &check, NULL) )
|
||||
check = 0;
|
||||
#else
|
||||
check = fwrite(near_data, 1, length, io_ptr);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -101,12 +91,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
written = MIN(NEAR_BUF_SIZE, remaining);
|
||||
png_memcpy(buf, data, written); /* Copy far buffer to near buffer */
|
||||
#ifdef _WIN32_WCE
|
||||
if ( !WriteFile(io_ptr, buf, written, &err, NULL) )
|
||||
err = 0;
|
||||
#else
|
||||
err = fwrite(buf, 1, written, io_ptr);
|
||||
#endif
|
||||
if (err != written)
|
||||
break;
|
||||
|
||||
@@ -141,15 +126,11 @@ png_flush(png_structp png_ptr)
|
||||
void PNGAPI
|
||||
png_default_flush(png_structp png_ptr)
|
||||
{
|
||||
#ifndef _WIN32_WCE
|
||||
png_FILE_p io_ptr;
|
||||
#endif
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
#ifndef _WIN32_WCE
|
||||
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
|
||||
fflush(io_ptr);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -221,7 +202,7 @@ png_set_write_fn(png_structp png_ptr, png_voidp io_ptr,
|
||||
png_warning(png_ptr,
|
||||
"Attempted to set both read_data_fn and write_data_fn in");
|
||||
png_warning(png_ptr,
|
||||
"the same structure. Resetting read_data_fn to NULL.");
|
||||
"the same structure. Resetting read_data_fn to NULL");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
233
pngwrite.c
233
pngwrite.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -12,9 +12,9 @@
|
||||
*/
|
||||
|
||||
/* Get internal access to png.h */
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Writes all the PNG information. This is the suggested way to use the
|
||||
* library. If you have a new chunk to add, make a function to write it,
|
||||
@@ -159,10 +159,10 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
|
||||
{
|
||||
int j;
|
||||
for (j = 0; j<(int)info_ptr->num_trans; j++)
|
||||
info_ptr->trans[j] = (png_byte)(255 - info_ptr->trans[j]);
|
||||
info_ptr->trans_alpha[j] = (png_byte)(255 - info_ptr->trans_alpha[j]);
|
||||
}
|
||||
#endif
|
||||
png_write_tRNS(png_ptr, info_ptr->trans, &(info_ptr->trans_values),
|
||||
png_write_tRNS(png_ptr, info_ptr->trans_alpha, &(info_ptr->trans_color),
|
||||
info_ptr->num_trans, info_ptr->color_type);
|
||||
}
|
||||
#endif
|
||||
@@ -200,7 +200,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
|
||||
#endif /* FLOATING_POINT */
|
||||
#else /* !WRITE_sCAL */
|
||||
png_warning(png_ptr,
|
||||
"png_write_sCAL not supported; sCAL chunk not written.");
|
||||
"png_write_sCAL not supported; sCAL chunk not written");
|
||||
#endif /* WRITE_sCAL */
|
||||
#endif /* sCAL */
|
||||
|
||||
@@ -412,13 +412,10 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
|
||||
/* This flush, added in libpng-1.0.8, removed from libpng-1.0.9beta03,
|
||||
* and restored again in libpng-1.2.30, may cause some applications that
|
||||
* do not set png_ptr->output_flush_fn to crash. If your application
|
||||
* experiences a problem, please try building libpng with
|
||||
* PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED defined, and report the event to
|
||||
* png-mng-implement at lists.sf.net . This kludge will be removed
|
||||
* from libpng-1.4.0.
|
||||
* experiences a problem, please report the event to
|
||||
* png-mng-implement at lists.sf.net .
|
||||
*/
|
||||
#if defined(PNG_WRITE_FLUSH_SUPPORTED) && \
|
||||
defined(PNG_WRITE_FLUSH_AFTER_IEND_SUPPORTED)
|
||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||
png_flush(png_ptr);
|
||||
#endif
|
||||
}
|
||||
@@ -457,7 +454,7 @@ png_create_write_struct(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
{
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
return (png_create_write_struct_2(user_png_ver, error_ptr, error_fn,
|
||||
warn_fn, png_voidp_NULL, png_malloc_ptr_NULL, png_free_ptr_NULL));
|
||||
warn_fn, NULL, NULL, NULL));
|
||||
}
|
||||
|
||||
/* Alternate initialize png_ptr structure, and allocate any memory needed */
|
||||
@@ -467,6 +464,7 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
png_malloc_ptr malloc_fn, png_free_ptr free_fn)
|
||||
{
|
||||
#endif /* PNG_USER_MEM_SUPPORTED */
|
||||
int png_cleanup_needed = 0;
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
volatile
|
||||
#endif
|
||||
@@ -496,25 +494,15 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Applications that neglect to set up their own setjmp() and then
|
||||
encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||
then meaningless we abort instead of returning. */
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
#else
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
#endif
|
||||
{
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf = NULL;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr,
|
||||
(png_free_ptr)free_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
PNG_ABORT();
|
||||
#endif
|
||||
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
@@ -543,7 +531,7 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
(user_png_ver[0] == '1' && user_png_ver[2] != png_libpng_ver[2]) ||
|
||||
(user_png_ver[0] == '0' && user_png_ver[2] < '9'))
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char msg[80];
|
||||
if (user_png_ver)
|
||||
{
|
||||
@@ -560,168 +548,45 @@ png_create_write_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
png_warning(png_ptr,
|
||||
"Incompatible libpng version in application and library");
|
||||
png_cleanup_needed = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize zbuf - compression buffer */
|
||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
if (!png_cleanup_needed)
|
||||
{
|
||||
png_ptr->zbuf = (png_bytep)png_malloc_warn(png_ptr,
|
||||
png_ptr->zbuf_size);
|
||||
if (png_ptr->zbuf == NULL)
|
||||
png_cleanup_needed = 1;
|
||||
}
|
||||
if (png_cleanup_needed)
|
||||
{
|
||||
/* Clean up PNG structure and deallocate any memory. */
|
||||
png_free(png_ptr, png_ptr->zbuf);
|
||||
png_ptr->zbuf = NULL;
|
||||
#ifdef PNG_USER_MEM_SUPPORTED
|
||||
png_destroy_struct_2((png_voidp)png_ptr,
|
||||
(png_free_ptr)free_fn, (png_voidp)mem_ptr);
|
||||
#else
|
||||
png_destroy_struct((png_voidp)png_ptr);
|
||||
#endif
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
||||
png_flush_ptr_NULL);
|
||||
png_set_write_fn(png_ptr, NULL, NULL, NULL);
|
||||
|
||||
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||
1, png_doublep_NULL, png_doublep_NULL);
|
||||
1, NULL, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Applications that neglect to set up their own setjmp() and then
|
||||
* encounter a png_error() will longjmp here. Since the jmpbuf is
|
||||
* then meaningless we abort instead of returning.
|
||||
*/
|
||||
#ifdef USE_FAR_KEYWORD
|
||||
if (setjmp(jmpbuf))
|
||||
PNG_ABORT();
|
||||
png_memcpy(png_ptr->jmpbuf, jmpbuf, png_sizeof(jmp_buf));
|
||||
#else
|
||||
if (setjmp(png_ptr->jmpbuf))
|
||||
PNG_ABORT();
|
||||
#endif
|
||||
#endif
|
||||
return (png_ptr);
|
||||
}
|
||||
|
||||
/* Initialize png_ptr structure, and allocate any memory needed */
|
||||
#if defined(PNG_1_0_X) || defined(PNG_1_2_X)
|
||||
/* Deprecated. */
|
||||
#undef png_write_init
|
||||
void PNGAPI
|
||||
png_write_init(png_structp png_ptr)
|
||||
{
|
||||
/* We only come here via pre-1.0.7-compiled applications */
|
||||
png_write_init_2(png_ptr, "1.0.6 or earlier", 0, 0);
|
||||
}
|
||||
|
||||
void PNGAPI
|
||||
png_write_init_2(png_structp png_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size, png_size_t png_info_size)
|
||||
{
|
||||
/* We only come here via pre-1.0.12-compiled applications */
|
||||
if (png_ptr == NULL) return;
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
if (png_sizeof(png_struct) > png_struct_size ||
|
||||
png_sizeof(png_info) > png_info_size)
|
||||
{
|
||||
char msg[80];
|
||||
png_ptr->warning_fn = NULL;
|
||||
if (user_png_ver)
|
||||
{
|
||||
png_snprintf(msg, 80,
|
||||
"Application was compiled with png.h from libpng-%.20s",
|
||||
user_png_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
png_snprintf(msg, 80,
|
||||
"Application is running with png.c from libpng-%.20s",
|
||||
png_libpng_ver);
|
||||
png_warning(png_ptr, msg);
|
||||
}
|
||||
#endif
|
||||
if (png_sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_ptr->error_fn = NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The png struct allocated by the application for writing is too small.");
|
||||
}
|
||||
if (png_sizeof(png_info) > png_info_size)
|
||||
{
|
||||
png_ptr->error_fn = NULL;
|
||||
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
|
||||
png_ptr->flags = 0;
|
||||
#endif
|
||||
png_error(png_ptr,
|
||||
"The info struct allocated by the application for writing is too small.");
|
||||
}
|
||||
png_write_init_3(&png_ptr, user_png_ver, png_struct_size);
|
||||
}
|
||||
#endif /* PNG_1_0_X || PNG_1_2_X */
|
||||
|
||||
|
||||
void PNGAPI
|
||||
png_write_init_3(png_structpp ptr_ptr, png_const_charp user_png_ver,
|
||||
png_size_t png_struct_size)
|
||||
{
|
||||
png_structp png_ptr = *ptr_ptr;
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
jmp_buf tmp_jmp; /* to save current jump buffer */
|
||||
#endif
|
||||
|
||||
int i = 0;
|
||||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
do
|
||||
{
|
||||
if (user_png_ver[i] != png_libpng_ver[i])
|
||||
{
|
||||
#ifdef PNG_LEGACY_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_LIBRARY_MISMATCH;
|
||||
#else
|
||||
png_ptr->warning_fn = NULL;
|
||||
png_warning(png_ptr,
|
||||
"Application uses deprecated png_write_init() and should be recompiled.");
|
||||
#endif
|
||||
}
|
||||
} while (png_libpng_ver[i++]);
|
||||
|
||||
png_debug(1, "in png_write_init_3");
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Save jump buffer and error functions */
|
||||
png_memcpy(tmp_jmp, png_ptr->jmpbuf, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
|
||||
if (png_sizeof(png_struct) > png_struct_size)
|
||||
{
|
||||
png_destroy_struct(png_ptr);
|
||||
png_ptr = (png_structp)png_create_struct(PNG_STRUCT_PNG);
|
||||
*ptr_ptr = png_ptr;
|
||||
}
|
||||
|
||||
/* Reset all variables to 0 */
|
||||
png_memset(png_ptr, 0, png_sizeof(png_struct));
|
||||
|
||||
/* Added at libpng-1.2.6 */
|
||||
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
|
||||
png_ptr->user_width_max = PNG_USER_WIDTH_MAX;
|
||||
png_ptr->user_height_max = PNG_USER_HEIGHT_MAX;
|
||||
#endif
|
||||
|
||||
#ifdef PNG_SETJMP_SUPPORTED
|
||||
/* Restore jump buffer */
|
||||
png_memcpy(png_ptr->jmpbuf, tmp_jmp, png_sizeof(jmp_buf));
|
||||
#endif
|
||||
|
||||
png_set_write_fn(png_ptr, png_voidp_NULL, png_rw_ptr_NULL,
|
||||
png_flush_ptr_NULL);
|
||||
|
||||
/* Initialize zbuf - compression buffer */
|
||||
png_ptr->zbuf_size = PNG_ZBUF_SIZE;
|
||||
png_ptr->zbuf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
#ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
||||
png_set_filter_heuristics(png_ptr, PNG_FILTER_HEURISTIC_DEFAULT,
|
||||
1, png_doublep_NULL, png_doublep_NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Write a few rows of image data. If the image is interlaced,
|
||||
* either you will have to write the 7 sub images, or, if you
|
||||
@@ -797,36 +662,36 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
||||
/* Make sure we wrote the header info */
|
||||
if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
|
||||
png_error(png_ptr,
|
||||
"png_write_info was never called before png_write_row.");
|
||||
"png_write_info was never called before png_write_row");
|
||||
|
||||
/* Check for transforms that have been set but were defined out */
|
||||
#if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||
png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_INVERT_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_FILLER_SUPPORTED) && defined(PNG_READ_FILLER_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_FILLER)
|
||||
png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_FILLER_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_PACKSWAP_SUPPORTED) && defined(PNG_READ_PACKSWAP_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||
png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_PACKSWAP_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_PACK_SUPPORTED) && defined(PNG_READ_PACK_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_PACK)
|
||||
png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_PACK_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_SHIFT_SUPPORTED) && defined(PNG_READ_SHIFT_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_SHIFT)
|
||||
png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_SHIFT_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_BGR_SUPPORTED) && defined(PNG_READ_BGR_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_BGR)
|
||||
png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_BGR_SUPPORTED is not defined");
|
||||
#endif
|
||||
#if !defined(PNG_WRITE_SWAP_SUPPORTED) && defined(PNG_READ_SWAP_SUPPORTED)
|
||||
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
||||
png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined.");
|
||||
png_warning(png_ptr, "PNG_WRITE_SWAP_SUPPORTED is not defined");
|
||||
#endif
|
||||
|
||||
png_write_start_row(png_ptr);
|
||||
@@ -910,8 +775,7 @@ png_write_row(png_structp png_ptr, png_bytep row)
|
||||
png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes);
|
||||
|
||||
/* Copy user's row into buffer, leaving room for filter byte. */
|
||||
png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row,
|
||||
png_ptr->row_info.rowbytes);
|
||||
png_memcpy(png_ptr->row_buf + 1, row, png_ptr->row_info.rowbytes);
|
||||
|
||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
||||
/* Handle interlacing */
|
||||
@@ -1069,7 +933,6 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
|
||||
if (png_ptr->num_chunk_list)
|
||||
{
|
||||
png_free(png_ptr, png_ptr->chunk_list);
|
||||
png_ptr->chunk_list = NULL;
|
||||
png_ptr->num_chunk_list = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
20
pngwtran.c
20
pngwtran.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -11,9 +11,9 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Transform the data according to the user's wishes. The order of
|
||||
* transformations is significant.
|
||||
@@ -92,9 +92,6 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||
png_debug(1, "in png_do_pack");
|
||||
|
||||
if (row_info->bit_depth == 8 &&
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
row_info->channels == 1)
|
||||
{
|
||||
switch ((int)bit_depth)
|
||||
@@ -218,11 +215,7 @@ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth)
|
||||
{
|
||||
png_debug(1, "in png_do_shift");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL &&
|
||||
#else
|
||||
if (
|
||||
#endif
|
||||
row_info->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
int shift_start[4], shift_dec[4];
|
||||
@@ -343,9 +336,6 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_swap_alpha");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
@@ -432,9 +422,6 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||
{
|
||||
png_debug(1, "in png_do_write_invert_alpha");
|
||||
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL)
|
||||
#endif
|
||||
{
|
||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||
{
|
||||
@@ -524,9 +511,6 @@ png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
||||
png_debug(1, "in png_do_write_intrapixel");
|
||||
|
||||
if (
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
row != NULL && row_info != NULL &&
|
||||
#endif
|
||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||
{
|
||||
int bytes_per_pixel;
|
||||
|
||||
145
pngwutil.c
145
pngwutil.c
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.2.41 [November 11, 2009]
|
||||
* Last changed in libpng 1.4.0 [November 13, 2009]
|
||||
* Copyright (c) 1998-2009 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.)
|
||||
@@ -11,9 +11,9 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_INTERNAL
|
||||
#include "png.h"
|
||||
#ifdef PNG_WRITE_SUPPORTED
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Place a 32-bit number into a buffer in PNG byte order. We work
|
||||
* with unsigned numbers for convenience, although one supported
|
||||
@@ -28,6 +28,7 @@ png_save_uint_32(png_bytep buf, png_uint_32 i)
|
||||
buf[3] = (png_byte)(i & 0xff);
|
||||
}
|
||||
|
||||
#ifdef PNG_SAVE_INT_32_SUPPORTED
|
||||
/* The png_save_int_32 function assumes integers are stored in two's
|
||||
* complement format. If this isn't the case, then this routine needs to
|
||||
* be modified to write data in two's complement format.
|
||||
@@ -40,6 +41,7 @@ png_save_int_32(png_bytep buf, png_int_32 i)
|
||||
buf[2] = (png_byte)((i >> 8) & 0xff);
|
||||
buf[3] = (png_byte)(i & 0xff);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Place a 16-bit number into a buffer in PNG byte order.
|
||||
* The parameter is declared unsigned int, not png_uint_16,
|
||||
@@ -63,6 +65,11 @@ png_write_sig(png_structp png_ptr)
|
||||
{
|
||||
png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that the signature is being written */
|
||||
png_ptr->io_state = PNG_IO_WRITING | PNG_IO_SIGNATURE;
|
||||
#endif
|
||||
|
||||
/* Write the rest of the 8 byte signature */
|
||||
png_write_data(png_ptr, &png_signature[png_ptr->sig_bytes],
|
||||
(png_size_t)(8 - png_ptr->sig_bytes));
|
||||
@@ -106,6 +113,12 @@ png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that the chunk header is being written.
|
||||
* PNG_IO_CHUNK_HDR requires a single I/O call.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_HDR;
|
||||
#endif
|
||||
|
||||
/* Write the length and the chunk name */
|
||||
png_save_uint_32(buf, length);
|
||||
@@ -115,7 +128,14 @@ png_write_chunk_start(png_structp png_ptr, png_bytep chunk_name,
|
||||
png_memcpy(png_ptr->chunk_name, chunk_name, 4);
|
||||
/* Reset the crc and run it over the chunk name */
|
||||
png_reset_crc(png_ptr);
|
||||
png_calculate_crc(png_ptr, chunk_name, (png_size_t)4);
|
||||
png_calculate_crc(png_ptr, chunk_name, 4);
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that chunk data will (possibly) be written.
|
||||
* PNG_IO_CHUNK_DATA does NOT require a specific number of I/O calls.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_DATA;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Write the data of a PNG chunk started with png_write_chunk_start().
|
||||
@@ -147,6 +167,13 @@ png_write_chunk_end(png_structp png_ptr)
|
||||
|
||||
if (png_ptr == NULL) return;
|
||||
|
||||
#ifdef PNG_IO_STATE_SUPPORTED
|
||||
/* Inform the I/O callback that the chunk CRC is being written.
|
||||
* PNG_IO_CHUNK_CRC requires a single I/O function call.
|
||||
*/
|
||||
png_ptr->io_state = PNG_IO_WRITING | PNG_IO_CHUNK_CRC;
|
||||
#endif
|
||||
|
||||
/* Write the crc in a single operation */
|
||||
png_save_uint_32(buf, png_ptr->crc);
|
||||
|
||||
@@ -193,7 +220,7 @@ png_text_compress(png_structp png_ptr,
|
||||
|
||||
if (compression >= PNG_TEXT_COMPRESSION_LAST)
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char msg[50];
|
||||
png_snprintf(msg, 50, "Unknown compression type %d", compression);
|
||||
png_warning(png_ptr, msg);
|
||||
@@ -252,7 +279,7 @@ png_text_compress(png_structp png_ptr,
|
||||
|
||||
old_ptr = comp->output_ptr;
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)
|
||||
(png_alloc_size_t)
|
||||
(comp->max_output_ptr * png_sizeof(png_charpp)));
|
||||
png_memcpy(comp->output_ptr, old_ptr, old_max
|
||||
* png_sizeof(png_charp));
|
||||
@@ -260,14 +287,14 @@ png_text_compress(png_structp png_ptr,
|
||||
}
|
||||
else
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)
|
||||
(png_alloc_size_t)
|
||||
(comp->max_output_ptr * png_sizeof(png_charp)));
|
||||
}
|
||||
|
||||
/* Save the data */
|
||||
comp->output_ptr[comp->num_output_ptr] =
|
||||
(png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
(png_alloc_size_t)png_ptr->zbuf_size);
|
||||
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
|
||||
png_ptr->zbuf_size);
|
||||
comp->num_output_ptr++;
|
||||
@@ -304,7 +331,7 @@ png_text_compress(png_structp png_ptr,
|
||||
old_ptr = comp->output_ptr;
|
||||
/* This could be optimized to realloc() */
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)(comp->max_output_ptr *
|
||||
(png_alloc_size_t)(comp->max_output_ptr *
|
||||
png_sizeof(png_charp)));
|
||||
png_memcpy(comp->output_ptr, old_ptr,
|
||||
old_max * png_sizeof(png_charp));
|
||||
@@ -312,14 +339,14 @@ png_text_compress(png_structp png_ptr,
|
||||
}
|
||||
else
|
||||
comp->output_ptr = (png_charpp)png_malloc(png_ptr,
|
||||
(png_uint_32)(comp->max_output_ptr *
|
||||
(png_alloc_size_t)(comp->max_output_ptr *
|
||||
png_sizeof(png_charp)));
|
||||
}
|
||||
|
||||
/* Save the data */
|
||||
comp->output_ptr[comp->num_output_ptr] =
|
||||
(png_charp)png_malloc(png_ptr,
|
||||
(png_uint_32)png_ptr->zbuf_size);
|
||||
(png_alloc_size_t)png_ptr->zbuf_size);
|
||||
png_memcpy(comp->output_ptr[comp->num_output_ptr], png_ptr->zbuf,
|
||||
png_ptr->zbuf_size);
|
||||
comp->num_output_ptr++;
|
||||
@@ -367,11 +394,9 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
|
||||
png_write_chunk_data(png_ptr, (png_bytep)comp->output_ptr[i],
|
||||
(png_size_t)png_ptr->zbuf_size);
|
||||
png_free(png_ptr, comp->output_ptr[i]);
|
||||
comp->output_ptr[i]=NULL;
|
||||
}
|
||||
if (comp->max_output_ptr != 0)
|
||||
png_free(png_ptr, comp->output_ptr);
|
||||
comp->output_ptr=NULL;
|
||||
/* Write anything left in zbuf */
|
||||
if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
|
||||
png_write_chunk_data(png_ptr, png_ptr->zbuf,
|
||||
@@ -392,9 +417,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
int bit_depth, int color_type, int compression_type, int filter_type,
|
||||
int interlace_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_IHDR;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
png_byte buf[13]; /* Buffer to store the IHDR info */
|
||||
@@ -570,9 +593,7 @@ png_write_IHDR(png_structp png_ptr, png_uint_32 width, png_uint_32 height,
|
||||
void /* PRIVATE */
|
||||
png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_PLTE;
|
||||
#endif
|
||||
png_uint_32 i;
|
||||
png_colorp pal_ptr;
|
||||
png_byte buf[3];
|
||||
@@ -635,9 +656,7 @@ png_write_PLTE(png_structp png_ptr, png_colorp palette, png_uint_32 num_pal)
|
||||
void /* PRIVATE */
|
||||
png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_IDAT;
|
||||
#endif
|
||||
|
||||
png_debug(1, "in png_write_IDAT");
|
||||
|
||||
@@ -690,13 +709,11 @@ png_write_IDAT(png_structp png_ptr, png_bytep data, png_size_t length)
|
||||
void /* PRIVATE */
|
||||
png_write_IEND(png_structp png_ptr)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_IEND;
|
||||
#endif
|
||||
|
||||
png_debug(1, "in png_write_IEND");
|
||||
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL,
|
||||
png_write_chunk(png_ptr, (png_bytep)png_IEND, NULL,
|
||||
(png_size_t)0);
|
||||
png_ptr->mode |= PNG_HAVE_IEND;
|
||||
}
|
||||
@@ -707,9 +724,7 @@ png_write_IEND(png_structp png_ptr)
|
||||
void /* PRIVATE */
|
||||
png_write_gAMA(png_structp png_ptr, double file_gamma)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_gAMA;
|
||||
#endif
|
||||
png_uint_32 igamma;
|
||||
png_byte buf[4];
|
||||
|
||||
@@ -725,9 +740,7 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
|
||||
void /* PRIVATE */
|
||||
png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_gAMA;
|
||||
#endif
|
||||
png_byte buf[4];
|
||||
|
||||
png_debug(1, "in png_write_gAMA");
|
||||
@@ -744,9 +757,7 @@ png_write_gAMA_fixed(png_structp png_ptr, png_fixed_point file_gamma)
|
||||
void /* PRIVATE */
|
||||
png_write_sRGB(png_structp png_ptr, int srgb_intent)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_sRGB;
|
||||
#endif
|
||||
png_byte buf[1];
|
||||
|
||||
png_debug(1, "in png_write_sRGB");
|
||||
@@ -765,9 +776,7 @@ void /* PRIVATE */
|
||||
png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
|
||||
png_charp profile, int profile_len)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_iCCP;
|
||||
#endif
|
||||
png_size_t name_len;
|
||||
png_charp new_name;
|
||||
compression_state comp;
|
||||
@@ -845,14 +854,12 @@ png_write_iCCP(png_structp png_ptr, png_charp name, int compression_type,
|
||||
void /* PRIVATE */
|
||||
png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_sPLT;
|
||||
#endif
|
||||
png_size_t name_len;
|
||||
png_charp new_name;
|
||||
png_byte entrybuf[10];
|
||||
int entry_size = (spalette->depth == 8 ? 6 : 10);
|
||||
int palette_size = entry_size * spalette->nentries;
|
||||
png_size_t entry_size = (spalette->depth == 8 ? 6 : 10);
|
||||
png_size_t palette_size = entry_size * spalette->nentries;
|
||||
png_sPLT_entryp ep;
|
||||
#ifndef PNG_POINTER_INDEXING_SUPPORTED
|
||||
int i;
|
||||
@@ -926,9 +933,7 @@ png_write_sPLT(png_structp png_ptr, png_sPLT_tp spalette)
|
||||
void /* PRIVATE */
|
||||
png_write_sBIT(png_structp png_ptr, png_color_8p sbit, int color_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_sBIT;
|
||||
#endif
|
||||
png_byte buf[4];
|
||||
png_size_t size;
|
||||
|
||||
@@ -986,9 +991,7 @@ png_write_cHRM(png_structp png_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)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_cHRM;
|
||||
#endif
|
||||
png_byte buf[32];
|
||||
|
||||
png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y,
|
||||
@@ -1035,9 +1038,7 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
|
||||
png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x,
|
||||
png_fixed_point blue_y)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_cHRM;
|
||||
#endif
|
||||
png_byte buf[32];
|
||||
|
||||
png_debug(1, "in png_write_cHRM");
|
||||
@@ -1069,12 +1070,10 @@ png_write_cHRM_fixed(png_structp png_ptr, png_fixed_point white_x,
|
||||
#ifdef PNG_WRITE_tRNS_SUPPORTED
|
||||
/* Write the tRNS chunk */
|
||||
void /* PRIVATE */
|
||||
png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
png_write_tRNS(png_structp png_ptr, png_bytep trans_alpha, png_color_16p tran,
|
||||
int num_trans, int color_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_tRNS;
|
||||
#endif
|
||||
png_byte buf[6];
|
||||
|
||||
png_debug(1, "in png_write_tRNS");
|
||||
@@ -1087,7 +1086,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
return;
|
||||
}
|
||||
/* Write the chunk out as it is */
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans,
|
||||
png_write_chunk(png_ptr, (png_bytep)png_tRNS, trans_alpha,
|
||||
(png_size_t)num_trans);
|
||||
}
|
||||
else if (color_type == PNG_COLOR_TYPE_GRAY)
|
||||
@@ -1128,9 +1127,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
|
||||
void /* PRIVATE */
|
||||
png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_bKGD;
|
||||
#endif
|
||||
png_byte buf[6];
|
||||
|
||||
png_debug(1, "in png_write_bKGD");
|
||||
@@ -1182,9 +1179,7 @@ png_write_bKGD(png_structp png_ptr, png_color_16p back, int color_type)
|
||||
void /* PRIVATE */
|
||||
png_write_hIST(png_structp png_ptr, png_uint_16p hist, int num_hist)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_hIST;
|
||||
#endif
|
||||
int i;
|
||||
png_byte buf[3];
|
||||
|
||||
@@ -1254,7 +1249,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
||||
if ((png_byte)*kp < 0x20 ||
|
||||
((png_byte)*kp > 0x7E && (png_byte)*kp < 0xA1))
|
||||
{
|
||||
#if defined(PNG_STDIO_SUPPORTED) && !defined(_WIN32_WCE)
|
||||
#ifdef PNG_STDIO_SUPPORTED
|
||||
char msg[40];
|
||||
|
||||
png_snprintf(msg, 40,
|
||||
@@ -1326,7 +1321,6 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
|
||||
if (key_len == 0)
|
||||
{
|
||||
png_free(png_ptr, *new_key);
|
||||
*new_key=NULL;
|
||||
png_warning(png_ptr, "Zero length keyword");
|
||||
}
|
||||
|
||||
@@ -1347,9 +1341,7 @@ void /* PRIVATE */
|
||||
png_write_tEXt(png_structp png_ptr, png_charp key, png_charp text,
|
||||
png_size_t text_len)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_tEXt;
|
||||
#endif
|
||||
png_size_t key_len;
|
||||
png_charp new_key;
|
||||
|
||||
@@ -1388,9 +1380,7 @@ void /* PRIVATE */
|
||||
png_write_zTXt(png_structp png_ptr, png_charp key, png_charp text,
|
||||
png_size_t text_len, int compression)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_zTXt;
|
||||
#endif
|
||||
png_size_t key_len;
|
||||
char buf[1];
|
||||
png_charp new_key;
|
||||
@@ -1448,9 +1438,7 @@ void /* PRIVATE */
|
||||
png_write_iTXt(png_structp png_ptr, int compression, png_charp key,
|
||||
png_charp lang, png_charp lang_key, png_charp text)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_iTXt;
|
||||
#endif
|
||||
png_size_t lang_len, key_len, lang_key_len, text_len;
|
||||
png_charp new_lang;
|
||||
png_charp new_key = NULL;
|
||||
@@ -1537,9 +1525,7 @@ void /* PRIVATE */
|
||||
png_write_oFFs(png_structp png_ptr, png_int_32 x_offset, png_int_32 y_offset,
|
||||
int unit_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_oFFs;
|
||||
#endif
|
||||
png_byte buf[9];
|
||||
|
||||
png_debug(1, "in png_write_oFFs");
|
||||
@@ -1560,9 +1546,7 @@ void /* PRIVATE */
|
||||
png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
png_int_32 X1, int type, int nparams, png_charp units, png_charpp params)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_pCAL;
|
||||
#endif
|
||||
png_size_t purpose_len, units_len, total_len;
|
||||
png_uint_32p params_len;
|
||||
png_byte buf[10];
|
||||
@@ -1581,7 +1565,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
total_len = purpose_len + units_len + 10;
|
||||
|
||||
params_len = (png_uint_32p)png_malloc(png_ptr,
|
||||
(png_uint_32)(nparams * png_sizeof(png_uint_32)));
|
||||
(png_alloc_size_t)(nparams * png_sizeof(png_uint_32)));
|
||||
|
||||
/* Find the length of each parameter, making sure we don't count the
|
||||
null terminator for the last parameter. */
|
||||
@@ -1623,36 +1607,17 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
|
||||
void /* PRIVATE */
|
||||
png_write_sCAL(png_structp png_ptr, int unit, double width, double height)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_sCAL;
|
||||
#endif
|
||||
char buf[64];
|
||||
png_size_t total_len;
|
||||
|
||||
png_debug(1, "in png_write_sCAL");
|
||||
|
||||
buf[0] = (char)unit;
|
||||
#ifdef _WIN32_WCE
|
||||
/* sprintf() function is not supported on WindowsCE */
|
||||
{
|
||||
wchar_t wc_buf[32];
|
||||
size_t wc_len;
|
||||
swprintf(wc_buf, TEXT("%12.12e"), width);
|
||||
wc_len = wcslen(wc_buf);
|
||||
WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + 1, wc_len, NULL, NULL);
|
||||
total_len = wc_len + 2;
|
||||
swprintf(wc_buf, TEXT("%12.12e"), height);
|
||||
wc_len = wcslen(wc_buf);
|
||||
WideCharToMultiByte(CP_ACP, 0, wc_buf, -1, buf + total_len, wc_len,
|
||||
NULL, NULL);
|
||||
total_len += wc_len;
|
||||
}
|
||||
#else
|
||||
png_snprintf(buf + 1, 63, "%12.12e", width);
|
||||
total_len = 1 + png_strlen(buf + 1) + 1;
|
||||
png_snprintf(buf + total_len, 64-total_len, "%12.12e", height);
|
||||
total_len += png_strlen(buf + total_len);
|
||||
#endif
|
||||
|
||||
png_debug1(3, "sCAL total length = %u", (unsigned int)total_len);
|
||||
png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len);
|
||||
@@ -1663,9 +1628,7 @@ void /* PRIVATE */
|
||||
png_write_sCAL_s(png_structp png_ptr, int unit, png_charp width,
|
||||
png_charp height)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_sCAL;
|
||||
#endif
|
||||
png_byte buf[64];
|
||||
png_size_t wlen, hlen, total_len;
|
||||
|
||||
@@ -1698,9 +1661,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
|
||||
png_uint_32 y_pixels_per_unit,
|
||||
int unit_type)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_pHYs;
|
||||
#endif
|
||||
png_byte buf[9];
|
||||
|
||||
png_debug(1, "in png_write_pHYs");
|
||||
@@ -1723,9 +1684,7 @@ png_write_pHYs(png_structp png_ptr, png_uint_32 x_pixels_per_unit,
|
||||
void /* PRIVATE */
|
||||
png_write_tIME(png_structp png_ptr, png_timep mod_time)
|
||||
{
|
||||
#ifdef PNG_USE_LOCAL_ARRAYS
|
||||
PNG_tIME;
|
||||
#endif
|
||||
png_byte buf[7];
|
||||
|
||||
png_debug(1, "in png_write_tIME");
|
||||
@@ -1778,7 +1737,7 @@ png_write_start_row(png_structp png_ptr)
|
||||
|
||||
/* Set up row buffer */
|
||||
png_ptr->row_buf = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)buf_size);
|
||||
(png_alloc_size_t)buf_size);
|
||||
png_ptr->row_buf[0] = PNG_FILTER_VALUE_NONE;
|
||||
|
||||
#ifdef PNG_WRITE_FILTER_SUPPORTED
|
||||
@@ -1786,7 +1745,7 @@ png_write_start_row(png_structp png_ptr)
|
||||
if (png_ptr->do_filter & PNG_FILTER_SUB)
|
||||
{
|
||||
png_ptr->sub_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
(png_alloc_size_t)(png_ptr->rowbytes + 1));
|
||||
png_ptr->sub_row[0] = PNG_FILTER_VALUE_SUB;
|
||||
}
|
||||
|
||||
@@ -1795,26 +1754,26 @@ png_write_start_row(png_structp png_ptr)
|
||||
{
|
||||
/* Set up previous row buffer */
|
||||
png_ptr->prev_row = (png_bytep)png_calloc(png_ptr,
|
||||
(png_uint_32)buf_size);
|
||||
(png_alloc_size_t)buf_size);
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_UP)
|
||||
{
|
||||
png_ptr->up_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
(png_size_t)(png_ptr->rowbytes + 1));
|
||||
png_ptr->up_row[0] = PNG_FILTER_VALUE_UP;
|
||||
}
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_AVG)
|
||||
{
|
||||
png_ptr->avg_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
(png_alloc_size_t)(png_ptr->rowbytes + 1));
|
||||
png_ptr->avg_row[0] = PNG_FILTER_VALUE_AVG;
|
||||
}
|
||||
|
||||
if (png_ptr->do_filter & PNG_FILTER_PAETH)
|
||||
{
|
||||
png_ptr->paeth_row = (png_bytep)png_malloc(png_ptr,
|
||||
(png_uint_32)(png_ptr->rowbytes + 1));
|
||||
(png_size_t)(png_ptr->rowbytes + 1));
|
||||
png_ptr->paeth_row[0] = PNG_FILTER_VALUE_PAETH;
|
||||
}
|
||||
}
|
||||
@@ -1980,11 +1939,7 @@ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass)
|
||||
png_debug(1, "in png_do_write_interlace");
|
||||
|
||||
/* We don't have to do anything on the last pass (6) */
|
||||
#ifdef PNG_USELESS_TESTS_SUPPORTED
|
||||
if (row != NULL && row_info != NULL && pass < 6)
|
||||
#else
|
||||
if (pass < 6)
|
||||
#endif
|
||||
{
|
||||
/* Each pixel depth is handled separately */
|
||||
switch (row_info->pixel_depth)
|
||||
|
||||
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
This project builds a shared library version of libpng on x86 BeOS.
|
||||
|
||||
It defines PNG_USE_PNGGCCRD, which activates the assembly code in
|
||||
pnggccrd.c; this hasn't been extensively tested on BeOS.
|
||||
|
||||
To install:
|
||||
|
||||
1) build
|
||||
|
||||
Note: As of version 1.0.10, you'll get a fair number of warnings when
|
||||
you compile pnggccrd.c. As far as I know, these are harmless,
|
||||
but it would be better if someone fixed them.
|
||||
|
||||
2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which
|
||||
you'll have to make) is a good choice
|
||||
|
||||
3) copy libpng.so to /boot/home/config/lib
|
||||
|
||||
4) build your libpng.so applications (remember to include libz.a as
|
||||
well when you link)
|
||||
|
||||
- Chris Herborth, March 27, 2001
|
||||
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
This project builds a static library version of libpng on x86 BeOS.
|
||||
|
||||
It defines PNG_USE_PNGGCCRD, which activates the assembly code in
|
||||
pnggccrd.c; this hasn't been extensively tested on BeOS.
|
||||
|
||||
To install:
|
||||
|
||||
1) build
|
||||
|
||||
Note: As of version 1.0.10, you'll get a fair number of warnings when
|
||||
you compile pnggccrd.c. As far as I know, these are harmless,
|
||||
but it would be better if someone fixed them.
|
||||
|
||||
2) copy and png.h, pngconf.h somewhere; /boot/home/config/include (which
|
||||
you'll have to make) is a good choice
|
||||
|
||||
3) copy libpng.a to /boot/home/config/lib
|
||||
|
||||
4) build your libpng.a applications (remember to include libz.a as
|
||||
well when you link)
|
||||
|
||||
- Chris Herborth, March 27, 2001
|
||||
11
projects/cbuilder5/README.txt
Normal file
11
projects/cbuilder5/README.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
The cbuilder5 project has not been updated to libpng-1.4.0.
|
||||
|
||||
It needs to depend on pngpriv.h
|
||||
|
||||
It needs to *not* depend on pnggccrd.c or pngvcrd.c
|
||||
|
||||
It needs to DEFINE PNG_CONFIGURE_LIBPNG 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,6 +0,0 @@
|
||||
A set of project files is available for Netware. Get
|
||||
libpng-1.2.5-project-netware.zip from a libpng distribution
|
||||
site such as http://libpng.sourceforge.net
|
||||
|
||||
Put the zip file in this directory (projects) and then run
|
||||
"unzip -a libpng-1.2.5-project-netware.zip"
|
||||
@@ -2,6 +2,8 @@ Microsoft Developer Studio Project File, Format Version 6.00 for libpng.
|
||||
|
||||
Copyright (C) 2000-2004 Simon-Pierre Cadieux.
|
||||
Copyright (C) 2004 Cosmin Truta.
|
||||
|
||||
This code is released under the libpng license.
|
||||
For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
|
||||
@@ -31,11 +33,11 @@ To use:
|
||||
|
||||
This project builds the libpng binaries as follows:
|
||||
|
||||
* Win32_DLL_Release\libpng13.dll DLL build
|
||||
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
|
||||
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
|
||||
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
|
||||
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
|
||||
* Win32_DLL_Release\libpng14.dll DLL build
|
||||
* Win32_DLL_Debug\libpng14d.dll DLL build (debug version)
|
||||
* Win32_DLL_ASM_Release\libpng14.dll DLL build using ASM code
|
||||
* Win32_DLL_ASM_Debug\libpng14d.dll DLL build using ASM (debug version)
|
||||
* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall
|
||||
* Win32_LIB_Release\libpng.lib static build
|
||||
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
||||
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
CFG=libpng - Win32 DLL Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "libpng.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "libpng.mak" CFG="libpng - Win32 DLL Release"
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
!MESSAGE "libpng - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "libpng - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "libpng - Win32 DLL ASM Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
@@ -27,7 +27,7 @@ CFG=libpng - Win32 DLL Release
|
||||
!MESSAGE "libpng - Win32 LIB Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libpng - Win32 LIB ASM Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "libpng - Win32 LIB ASM Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
@@ -50,7 +50,7 @@ CFG=libpng - Win32 DLL Release
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "PNG_NO_MMX_CODE" /D "ZLIB_DLL" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -63,7 +63,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_Release\libpng14.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||
|
||||
@@ -81,7 +81,7 @@ LINK32=link.exe
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "PNG_NO_MMX_CODE" /D PNG_DEBUG=1 /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
@@ -94,7 +94,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug"
|
||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_Debug\libpng14d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release"
|
||||
|
||||
@@ -112,7 +112,7 @@ LINK32=link.exe
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D "PNG_LIBPNG_SPECIALBUILD" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -125,7 +125,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\libpng13.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release"
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_ASM_Release\libpng14.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug"
|
||||
|
||||
@@ -143,7 +143,7 @@ LINK32=link.exe
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D "PNG_LIBPNG_SPECIALBUILD" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
@@ -156,7 +156,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\libpng13d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug"
|
||||
# ADD LINK32 zlib1d.lib /nologo /dll /debug /machine:I386 /out:"Win32_DLL_ASM_Debug\libpng14d.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||
|
||||
@@ -174,7 +174,7 @@ LINK32=link.exe
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /D "PNG_NO_MODULEDEF" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_BUILD_DLL" /D "ZLIB_DLL" /D PNGAPI=__stdcall /D "PNG_NO_MODULEDEF" /D "PNG_LIBPNG_SPECIALBUILD" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
MTL=midl.exe
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
@@ -187,10 +187,10 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /dll /machine:I386
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng13vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||
# ADD LINK32 zlib1.lib /nologo /dll /machine:I386 /out:"Win32_DLL_VB\libpng14vb.dll" /libpath:"..\..\..\zlib\projects\visualc6\Win32_DLL_Release"
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\Win32_DLL_VB
|
||||
TargetName=libpng13vb
|
||||
TargetName=libpng14vb
|
||||
SOURCE="$(InputPath)"
|
||||
PostBuild_Cmds=echo Deleting $(targetname) import library and export file (Not required for VB projects) del $(outdir)\$(targetname).lib del $(outdir)\$(targetname).exp
|
||||
# End Special Build Tool
|
||||
@@ -210,7 +210,7 @@ PostBuild_Cmds=echo Deleting $(targetname) import library and export file (No
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "PNG_NO_MMX_CODE" /D "WIN32" /D "NDEBUG" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||
@@ -237,7 +237,7 @@ LIB32=link.exe -lib
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D "PNG_NO_MMX_CODE" /D PNG_DEBUG=1 /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||
@@ -264,7 +264,7 @@ LIB32=link.exe -lib
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /FD /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /O2 /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "NDEBUG" /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /FD /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "NDEBUG"
|
||||
@@ -291,7 +291,7 @@ LIB32=link.exe -lib
|
||||
CPP=cl.exe
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /FD /GZ /c
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /D "_CRT_SECURE_NO_WARNINGS" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\.." /I "..\..\..\zlib" /D "WIN32" /D "_DEBUG" /D "DEBUG" /D PNG_DEBUG=1 /D "PNG_USE_PNGVCRD" /D "PNG_LIBPNG_SPECIALBUILD" /FD /GZ /c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
RSC=rc.exe
|
||||
# ADD BASE RSC /l 0x409 /d "PNG_CONFIGURE_LIBPNG" /d "_DEBUG"
|
||||
@@ -303,7 +303,7 @@ LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"Win32_LIB_ASM_Debug\libpngd.lib"
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
@@ -365,7 +365,40 @@ SOURCE=..\..\pngtrans.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\scripts\pngw32.def
|
||||
!IF "$(CFG)" == "libpng - Win32 DLL Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL ASM Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 DLL VB"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Release"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB Debug"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "libpng - Win32 LIB ASM Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\scripts\pngwin.def
|
||||
|
||||
!IF "$(CFG)" == "libpng - Win32 DLL Release"
|
||||
|
||||
@@ -395,7 +428,7 @@ SOURCE=..\..\scripts\pngw32.def
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -426,13 +459,17 @@ SOURCE=..\..\png.h
|
||||
|
||||
SOURCE=..\..\pngconf.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\pngpriv.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\scripts\pngw32.rc
|
||||
SOURCE=..\..\scripts\pngwin.rc
|
||||
|
||||
!IF "$(CFG)" == "libpng - Win32 DLL Release"
|
||||
|
||||
@@ -460,7 +497,7 @@ SOURCE=..\..\scripts\pngw32.rc
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# End Group
|
||||
|
||||
@@ -58,7 +58,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Win32_DLL_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Win32_DLL_Release\libpng14.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\Win32_DLL_Release
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -90,7 +90,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Win32_DLL_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Win32_DLL_Debug\libpng14d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\Win32_DLL_Debug
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -122,7 +122,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Win32_DLL_ASM_Release\libpng13.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 Win32_DLL_ASM_Release\libpng14.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Release\zlib1.lib /nologo /subsystem:console /machine:I386
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\Win32_DLL_ASM_Release
|
||||
SOURCE="$(InputPath)"
|
||||
@@ -154,7 +154,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Win32_DLL_ASM_Debug\libpng13d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 Win32_DLL_ASM_Debug\libpng14d.lib ..\..\..\zlib\projects\visualc6\Win32_DLL_ASM_Debug\zlib1d.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# Begin Special Build Tool
|
||||
OutDir=.\Win32_DLL_ASM_Debug
|
||||
SOURCE="$(InputPath)"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Prevent "Cannot find missing dependency..." warnings while compiling
|
||||
# pngw32.rc (PRJ0041).
|
||||
# pngwin.rc (PRJ0041).
|
||||
|
||||
all: $(IntDir)\alloc.h \
|
||||
$(IntDir)\fp.h \
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
Microsoft Developer Studio Project File, Format Version 7.10 for libpng.
|
||||
|
||||
Copyright (C) 2004 Simon-Pierre Cadieux.
|
||||
|
||||
This code is released under the libpng license.
|
||||
For conditions of distribution and use, see copyright notice in png.h
|
||||
|
||||
Assumptions:
|
||||
@@ -32,11 +34,11 @@ To use:
|
||||
|
||||
This project builds the libpng binaries as follows:
|
||||
|
||||
* Win32_DLL_Release\libpng13.dll DLL build
|
||||
* Win32_DLL_Debug\libpng13d.dll DLL build (debug version)
|
||||
* Win32_DLL_ASM_Release\libpng13.dll DLL build using ASM code
|
||||
* Win32_DLL_ASM_Debug\libpng13d.dll DLL build using ASM (debug version)
|
||||
* Win32_DLL_VB\libpng13vb.dll DLL build for Visual Basic, using stdcall
|
||||
* Win32_DLL_Release\libpng14.dll DLL build
|
||||
* Win32_DLL_Debug\libpng14d.dll DLL build (debug version)
|
||||
* Win32_DLL_ASM_Release\libpng14.dll DLL build using ASM code
|
||||
* Win32_DLL_ASM_Debug\libpng14d.dll DLL build using ASM (debug version)
|
||||
* Win32_DLL_VB\libpng14vb.dll DLL build for Visual Basic, using stdcall
|
||||
* Win32_LIB_Release\libpng.lib static build
|
||||
* Win32_LIB_Debug\libpngd.lib static build (debug version)
|
||||
* Win32_LIB_ASM_Release\libpng.lib static build using ASM code
|
||||
|
||||
@@ -6,6 +6,8 @@ Microsoft Developer Studio Project File, Format Version 7.10 for zlib.
|
||||
|
||||
Copyright (C) 2004 Simon-Pierre Cadieux.
|
||||
Copyright (C) 2004 Cosmin Truta.
|
||||
|
||||
This code is released under the libpng license.
|
||||
For conditions of distribution and use, see copyright notice in zlib.h.
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;PNG_NO_MMX_CODE;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -30,9 +30,9 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng13.dll"
|
||||
OutputFile="$(OutDir)/libpng14.dll"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
@@ -43,7 +43,7 @@
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
@@ -66,7 +66,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_NO_MMX_CODE;PNG_DEBUG=1;PNG_BUILD_DLL;ZLIB_DLL;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_BUILD_DLL;ZLIB_DLL"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="3"
|
||||
@@ -78,8 +78,8 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng13d.dll"
|
||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
||||
OutputFile="$(OutDir)/libpng14d.dll"
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"
|
||||
GenerateDebugInformation="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
@@ -91,7 +91,7 @@
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
@@ -114,7 +114,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_BUILD_DLL;ZLIB_DLL;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_BUILD_DLL;ZLIB_DLL;PNG_LIBPNG_SPECIALBUILD"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -126,9 +126,9 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng13.dll"
|
||||
OutputFile="$(OutDir)/libpng14.dll"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"/>
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
@@ -140,7 +140,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
||||
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
@@ -163,7 +163,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_BUILD_DLL;ZLIB_DLL;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_BUILD_DLL;ZLIB_DLL;PNG_LIBPNG_SPECIALBUILD"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="3"
|
||||
@@ -175,8 +175,8 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng13d.dll"
|
||||
ModuleDefinitionFile="..\..\scripts\pngw32.def"
|
||||
OutputFile="$(OutDir)/libpng14d.dll"
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"
|
||||
GenerateDebugInformation="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
@@ -189,7 +189,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_SPECIALBUILD=""""Use MMX instructions"""""
|
||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="_DEBUG,PNG_DEBUG=1"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
@@ -212,7 +212,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MMX_CODE;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_BUILD_DLL;ZLIB_DLL;PNGAPI=__stdcall;PNG_NO_MODULEDEF;PNG_LIBPNG_SPECIALBUILD"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -224,7 +224,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng13vb.dll"
|
||||
OutputFile="$(OutDir)/libpng14vb.dll"
|
||||
LinkIncremental="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
@@ -237,7 +237,7 @@
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
AdditionalOptions="/d PNG_CONFIGURE_LIBPNG /d PNG_LIBPNG_DLLFNAME_POSTFIX=""""VB"""" /d PNG_LIBPNG_SPECIALBUILD=""""__stdcall calling convention used for exported functions"""""
|
||||
PreprocessorDefinitions="NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib;$(IntDir)"/>
|
||||
<Tool
|
||||
@@ -260,7 +260,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="PNG_NO_MMX_CODE;WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -301,7 +301,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..;..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_NO_MMX_CODE;PNG_DEBUG=1;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="3"
|
||||
@@ -342,7 +342,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..,..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
@@ -383,7 +383,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..,..\..\..\zlib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD;_CRT_SECURE_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;DEBUG;PNG_DEBUG=1;PNG_USE_PNGVCRD;PNG_LIBPNG_SPECIALBUILD"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="3"
|
||||
@@ -564,7 +564,40 @@
|
||||
RelativePath="..\..\pngtrans.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\scripts\pngw32.def">
|
||||
RelativePath="..\..\pngvcrd.c">
|
||||
<FileConfiguration
|
||||
Name="DLL Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="DLL Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="DLL VB|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="LIB Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="LIB Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\scripts\pngwin.def">
|
||||
<FileConfiguration
|
||||
Name="DLL VB|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
@@ -618,12 +651,15 @@
|
||||
<File
|
||||
RelativePath="..\..\pngconf.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\pngpriv.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
<File
|
||||
RelativePath="..\..\scripts\pngw32.rc">
|
||||
RelativePath="..\..\scripts\pngwin.rc">
|
||||
<FileConfiguration
|
||||
Name="LIB Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
|
||||
@@ -226,7 +226,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/pngtest.exe"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="$(IntDir)\libpng13vb.lib"
|
||||
IgnoreDefaultLibraryNames="$(IntDir)\libpng14vb.lib"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
A set of project files is available for WinCE. Get
|
||||
libpng-1.2.41beta19-project-wince.zip from a libpng distribution
|
||||
site such as http://libpng.sourceforge.net/index.html
|
||||
|
||||
Put the zip file in this directory (projects) and then run
|
||||
"unzip -a libpng-1.2.41beta19-project-wince.zip"
|
||||
9
projects/xcode/README.txt
Normal file
9
projects/xcode/README.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
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_CONFIGURE_LIBPNG 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.
|
||||
@@ -26,6 +26,7 @@
|
||||
14461C8209C3C37F005840C0 /* pngwrite.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6E09C3C37F005840C0 /* pngwrite.c */; };
|
||||
14461C8309C3C37F005840C0 /* pngwtran.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C6F09C3C37F005840C0 /* pngwtran.c */; };
|
||||
14461C8409C3C37F005840C0 /* pngwutil.c in Sources */ = {isa = PBXBuildFile; fileRef = 14461C7009C3C37F005840C0 /* pngwutil.c */; };
|
||||
67FA470510693F6B0078FB9E /* pngpriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 67FA470410693F6B0078FB9E /* pngpriv.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -48,6 +49,7 @@
|
||||
14461C6E09C3C37F005840C0 /* pngwrite.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwrite.c; path = ../../pngwrite.c; sourceTree = SOURCE_ROOT; };
|
||||
14461C6F09C3C37F005840C0 /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwtran.c; path = ../../pngwtran.c; sourceTree = SOURCE_ROOT; };
|
||||
14461C7009C3C37F005840C0 /* pngwutil.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = pngwutil.c; path = ../../pngwutil.c; sourceTree = SOURCE_ROOT; };
|
||||
67FA470410693F6B0078FB9E /* pngpriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pngpriv.h; path = ../../pngpriv.h; sourceTree = SOURCE_ROOT; };
|
||||
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
8D07F2C80486CC7A007CD1D0 /* libpng.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libpng.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
@@ -92,6 +94,7 @@
|
||||
08FB77ACFE841707C02AAC07 /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
67FA470410693F6B0078FB9E /* pngpriv.h */,
|
||||
14461C5D09C3C37F005840C0 /* png.c */,
|
||||
14461C5E09C3C37F005840C0 /* png.h */,
|
||||
14461C5F09C3C37F005840C0 /* pngconf.h */,
|
||||
@@ -124,6 +127,7 @@
|
||||
files = (
|
||||
14461C7209C3C37F005840C0 /* png.h in Headers */,
|
||||
14461C7309C3C37F005840C0 /* pngconf.h in Headers */,
|
||||
67FA470510693F6B0078FB9E /* pngpriv.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -220,9 +224,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DYLIB_COMPATIBILITY_VERSION = 3;
|
||||
DYLIB_CURRENT_VERSION = 3;
|
||||
FRAMEWORK_VERSION = 1.2.41beta19;
|
||||
DYLIB_COMPATIBILITY_VERSION = 14;
|
||||
DYLIB_CURRENT_VERSION = 14;
|
||||
FRAMEWORK_VERSION = 1.4.0beta97;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
@@ -238,9 +242,9 @@
|
||||
4FADC24408B4156D00ABE55E /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
DYLIB_COMPATIBILITY_VERSION = 3;
|
||||
DYLIB_CURRENT_VERSION = 3;
|
||||
FRAMEWORK_VERSION = 1.2.41beta19;
|
||||
DYLIB_COMPATIBILITY_VERSION = 14;
|
||||
DYLIB_CURRENT_VERSION = 14;
|
||||
FRAMEWORK_VERSION = 1.4.0beta97;
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = NO;
|
||||
GCC_PREFIX_HEADER = "";
|
||||
INFOPLIST_FILE = Info.plist;
|
||||
|
||||
@@ -33,20 +33,20 @@ clean :
|
||||
|
||||
|
||||
# Other dependencies.
|
||||
png.obj : png.h, pngconf.h
|
||||
pngpread.obj : png.h, pngconf.h
|
||||
pngset.obj : png.h, pngconf.h
|
||||
pngget.obj : png.h, pngconf.h
|
||||
pngread.obj : png.h, pngconf.h
|
||||
pngrtran.obj : png.h, pngconf.h
|
||||
pngrutil.obj : png.h, pngconf.h
|
||||
pngerror.obj : png.h, pngconf.h
|
||||
pngmem.obj : png.h, pngconf.h
|
||||
pngrio.obj : png.h, pngconf.h
|
||||
pngwio.obj : png.h, pngconf.h
|
||||
pngtrans.obj : png.h, pngconf.h
|
||||
pngwrite.obj : png.h, pngconf.h
|
||||
pngwtran.obj : png.h, pngconf.h
|
||||
pngwutil.obj : png.h, pngconf.h
|
||||
png.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngpread.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngset.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngget.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngread.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngrtran.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngrutil.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngerror.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngmem.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngrio.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngwio.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngtrans.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngwrite.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngwtran.obj : png.h, pngconf.h, pngpriv.h
|
||||
pngwutil.obj : png.h, pngconf.h, pngpriv.h
|
||||
|
||||
pngtest.obj : png.h, pngconf.h
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.2.41beta19
|
||||
version=1.4.0beta97
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -22,7 +22,7 @@ I_opts="-I${includedir}"
|
||||
L_opts="-L${libdir}"
|
||||
R_opts=""
|
||||
cppflags=""
|
||||
ccopts="@LIBPNG_NO_MMX@"
|
||||
ccopts=""
|
||||
ldopts=""
|
||||
|
||||
usage()
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
// Project file for libpng (static)
|
||||
// IBM VisualAge/C++ version 4.0 or later
|
||||
// Copyright (C) 2000 Cosmin Truta
|
||||
//
|
||||
// This code is released under the libpng license.
|
||||
// For conditions of distribution and use, see the disclaimer
|
||||
// and license in png.h
|
||||
//
|
||||
// Notes:
|
||||
// All modules are compiled in C mode
|
||||
// Tested with IBM VAC++ 4.0 under Win32
|
||||
// Expected to work with IBM VAC++ 4.0 or later under OS/2 and Win32
|
||||
// Can be easily adapted for IBM VAC++ 4.0 or later under AIX
|
||||
|
||||
option incl(searchpath, "../zlib"), opt(level, "2"),
|
||||
link(libsearchpath, "../zlib")
|
||||
{
|
||||
target type(lib) "libpng.lib"
|
||||
{
|
||||
source type(c) "png.c"
|
||||
source type(c) "pngerror.c"
|
||||
source type(c) "pngget.c"
|
||||
source type(c) "pngmem.c"
|
||||
source type(c) "pngpread.c"
|
||||
source type(c) "pngread.c"
|
||||
source type(c) "pngrio.c"
|
||||
source type(c) "pngrtran.c"
|
||||
source type(c) "pngrutil.c"
|
||||
source type(c) "pngset.c"
|
||||
source type(c) "pngtrans.c"
|
||||
source type(c) "pngwio.c"
|
||||
source type(c) "pngwrite.c"
|
||||
source type(c) "pngwtran.c"
|
||||
source type(c) "pngwutil.c"
|
||||
}
|
||||
}
|
||||
|
||||
option incl(searchpath, "../zlib"), opt(level, "2"),
|
||||
link(libsearchpath, "../zlib")
|
||||
{
|
||||
target type(exe) "pngtest.exe"
|
||||
{
|
||||
source type(c) "pngtest.c"
|
||||
source type(lib) "libpng.lib"
|
||||
source type(lib) "zlib.lib"
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,4 @@ Description: Loads and saves PNG files
|
||||
Version: @PNGLIB_VERSION@
|
||||
Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
Libs.private: @LIBS@
|
||||
Cflags: -I${includedir} @LIBPNG_NO_MMX@
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@/libpng12
|
||||
includedir=@includedir@/libpng14
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.2.41beta19
|
||||
Libs: -L${libdir} -lpng12
|
||||
Version: 1.4.0beta97
|
||||
Libs: -L${libdir} -lpng14
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# and license in png.h
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.so.14
|
||||
OLDSOVER=libpng.so.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
CC=cc
|
||||
@@ -33,7 +33,7 @@ RM_F=/bin/rm -f
|
||||
SUN_CC_FLAGS=-fast -xtarget=ultra
|
||||
SUN_LD_FLAGS=-fast -xtarget=ultra
|
||||
|
||||
# where make install puts libpng.a, libpng12.so and libpng12/png.h
|
||||
# where make install puts libpng.a, libpng14.so and libpng14/png.h
|
||||
prefix=/a
|
||||
exec_prefix=$(prefix)
|
||||
|
||||
@@ -95,7 +95,7 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@@ -106,7 +106,7 @@ libpng-config:
|
||||
echo R_opts=\"-R$(LIBPATH)\"; \
|
||||
echo ccopts=\"-xtarget=ultra\"; \
|
||||
echo ldopts=\"-xtarget=ultra\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -238,20 +238,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# and license in png.h
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.so.14
|
||||
OLDSOVER=libpng.so.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
CC=cc
|
||||
@@ -33,7 +33,7 @@ RM_F=/bin/rm -f
|
||||
SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||
SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
||||
|
||||
# where make install puts libpng.a, libpng12.so and libpng12/png.h
|
||||
# where make install puts libpng.a, libpng14.so and libpng14/png.h
|
||||
prefix=/a
|
||||
exec_prefix=$(prefix)
|
||||
|
||||
@@ -51,7 +51,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) $(SUN_CC_FLAGS) \
|
||||
# $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng12 -lz -lm
|
||||
LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng14 -lz -lm
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(exec_prefix)/lib
|
||||
@@ -95,7 +95,7 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@@ -106,7 +106,7 @@ libpng-config:
|
||||
echo R_opts=\"-R$(LIBPATH)\"; \
|
||||
echo ccopts=\"-xtarget=ultra -xarch=v9\"; \
|
||||
echo ldopts=\"-xtarget=ultra -xarch=v9\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -238,20 +238,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -21,9 +21,9 @@ RANLIB = ranlib
|
||||
RM_F = rm -f
|
||||
LN_SF = ln -f -s
|
||||
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
prefix=/usr/local
|
||||
@@ -49,7 +49,7 @@ CRELEASE = -O2
|
||||
LDRELEASE = -s
|
||||
WARNMORE=-W -Wall
|
||||
CFLAGS = -DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
|
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng12 -lz -lm $(LDRELEASE)
|
||||
LDFLAGS = -L. -L$(ZLIBLIB) -lpng14 -lz -lm $(LDRELEASE)
|
||||
|
||||
# File extensions
|
||||
O=.o
|
||||
@@ -97,20 +97,20 @@ install: $(LIBNAME)$(A)
|
||||
clean:
|
||||
$(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png
|
||||
|
||||
png$(O): png.h pngconf.h
|
||||
pngerror$(O): png.h pngconf.h
|
||||
pngget$(O): png.h pngconf.h
|
||||
pngmem$(O): png.h pngconf.h
|
||||
pngpread$(O): png.h pngconf.h
|
||||
pngread$(O): png.h pngconf.h
|
||||
pngrio$(O): png.h pngconf.h
|
||||
pngrtran$(O): png.h pngconf.h
|
||||
pngrutil$(O): png.h pngconf.h
|
||||
pngset$(O): png.h pngconf.h
|
||||
pngtrans$(O): png.h pngconf.h
|
||||
pngwio$(O): png.h pngconf.h
|
||||
pngwrite$(O): png.h pngconf.h
|
||||
pngwtran$(O): png.h pngconf.h
|
||||
pngwutil$(O): png.h pngconf.h
|
||||
png$(O): png.h pngconf.h pngpriv.h
|
||||
pngerror$(O): png.h pngconf.h pngpriv.h
|
||||
pngget$(O): png.h pngconf.h pngpriv.h
|
||||
pngmem$(O): png.h pngconf.h pngpriv.h
|
||||
pngpread$(O): png.h pngconf.h pngpriv.h
|
||||
pngread$(O): png.h pngconf.h pngpriv.h
|
||||
pngrio$(O): png.h pngconf.h pngpriv.h
|
||||
pngrtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngrutil$(O): png.h pngconf.h pngpriv.h
|
||||
pngset$(O): png.h pngconf.h pngpriv.h
|
||||
pngtrans$(O): png.h pngconf.h pngpriv.h
|
||||
pngwio$(O): png.h pngconf.h pngpriv.h
|
||||
pngwrite$(O): png.h pngconf.h pngpriv.h
|
||||
pngwtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngwutil$(O): png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest$(O): png.h pngconf.h
|
||||
|
||||
@@ -109,21 +109,21 @@ test: pngtest.exe
|
||||
|
||||
## Minor Targets
|
||||
|
||||
png.obj: png.c png.h pngconf.h
|
||||
pngerror.obj: pngerror.c png.h pngconf.h
|
||||
pngget.obj: pngget.c png.h pngconf.h
|
||||
pngmem.obj: pngmem.c png.h pngconf.h
|
||||
pngpread.obj: pngpread.c png.h pngconf.h
|
||||
pngread.obj: pngread.c png.h pngconf.h
|
||||
pngrio.obj: pngrio.c png.h pngconf.h
|
||||
pngrtran.obj: pngrtran.c png.h pngconf.h
|
||||
pngrutil.obj: pngrutil.c png.h pngconf.h
|
||||
pngset.obj: pngset.c png.h pngconf.h
|
||||
pngtrans.obj: pngtrans.c png.h pngconf.h
|
||||
pngwio.obj: pngwio.c png.h pngconf.h
|
||||
pngwrite.obj: pngwrite.c png.h pngconf.h
|
||||
pngwtran.obj: pngwtran.c png.h pngconf.h
|
||||
pngwutil.obj: pngwutil.c png.h pngconf.h
|
||||
png.obj: png.c png.h pngconf.h pngpriv.h
|
||||
pngerror.obj: pngerror.c png.h pngconf.h pngpriv.h
|
||||
pngget.obj: pngget.c png.h pngconf.h pngpriv.h
|
||||
pngmem.obj: pngmem.c png.h pngconf.h pngpriv.h
|
||||
pngpread.obj: pngpread.c png.h pngconf.h pngpriv.h
|
||||
pngread.obj: pngread.c png.h pngconf.h pngpriv.h
|
||||
pngrio.obj: pngrio.c png.h pngconf.h pngpriv.h
|
||||
pngrtran.obj: pngrtran.c png.h pngconf.h pngpriv.h
|
||||
pngrutil.obj: pngrutil.c png.h pngconf.h pngpriv.h
|
||||
pngset.obj: pngset.c png.h pngconf.h pngpriv.h
|
||||
pngtrans.obj: pngtrans.c png.h pngconf.h pngpriv.h
|
||||
pngwio.obj: pngwio.c png.h pngconf.h pngpriv.h
|
||||
pngwrite.obj: pngwrite.c png.h pngconf.h pngpriv.h
|
||||
pngwtran.obj: pngwtran.c png.h pngconf.h pngpriv.h
|
||||
pngwutil.obj: pngwutil.c png.h pngconf.h pngpriv.h
|
||||
pngtest.obj: pngtest.c png.h pngconf.h
|
||||
|
||||
$(LIBNAME): $(OBJS)
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# and license in png.h
|
||||
|
||||
# Library name:
|
||||
LIBNAME=libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME=libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.so.14
|
||||
OLDSOVER=libpng.so.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
CC=gcc
|
||||
@@ -49,7 +49,7 @@ CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
|
||||
# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
|
||||
LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
|
||||
|
||||
# where make install puts libpng.a, libpng12.so*, and png.h
|
||||
# where make install puts libpng.a, libpng14.so*, and png.h
|
||||
prefix=/usr/local
|
||||
exec_prefix=$(prefix)
|
||||
INCPATH=$(prefix)/include
|
||||
@@ -91,13 +91,13 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
echo prefix=\"$(prefix)\"; \
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo libs=\"-lpng12 -lz \"; \
|
||||
echo libs=\"-lpng14 -lz \"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -117,7 +117,7 @@ $(OLDSOVER): $(OBJSDLL)
|
||||
$(OLDSOVER) $(OBJSDLL) $(LDFLAGS)
|
||||
|
||||
pngtest: pngtest.o $(LIBSO)
|
||||
$(CC) -L$(ZLIBLIB) -L. -lz -lpng12 -o pngtest pngtest.o
|
||||
$(CC) -L$(ZLIBLIB) -L. -lz -lpng14 -o pngtest pngtest.o
|
||||
|
||||
test: pngtest
|
||||
./pngtest
|
||||
@@ -211,20 +211,20 @@ clean:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -117,21 +117,21 @@ test: pngtest$(MODEL).exe
|
||||
|
||||
## Minor Targets
|
||||
|
||||
png.obj: png.c png.h pngconf.h
|
||||
pngerror.obj: pngerror.c png.h pngconf.h
|
||||
pngget.obj: pngget.c png.h pngconf.h
|
||||
pngmem.obj: pngmem.c png.h pngconf.h
|
||||
pngpread.obj: pngpread.c png.h pngconf.h
|
||||
pngread.obj: pngread.c png.h pngconf.h
|
||||
pngrio.obj: pngrio.c png.h pngconf.h
|
||||
pngrtran.obj: pngrtran.c png.h pngconf.h
|
||||
pngrutil.obj: pngrutil.c png.h pngconf.h
|
||||
pngset.obj: pngset.c png.h pngconf.h
|
||||
pngtrans.obj: pngtrans.c png.h pngconf.h
|
||||
pngwio.obj: pngwio.c png.h pngconf.h
|
||||
pngwrite.obj: pngwrite.c png.h pngconf.h
|
||||
pngwtran.obj: pngwtran.c png.h pngconf.h
|
||||
pngwutil.obj: pngwutil.c png.h pngconf.h
|
||||
png.obj: png.c png.h pngconf.h pngpriv.h
|
||||
pngerror.obj: pngerror.c png.h pngconf.h pngpriv.h
|
||||
pngget.obj: pngget.c png.h pngconf.h pngpriv.h
|
||||
pngmem.obj: pngmem.c png.h pngconf.h pngpriv.h
|
||||
pngpread.obj: pngpread.c png.h pngconf.h pngpriv.h
|
||||
pngread.obj: pngread.c png.h pngconf.h pngpriv.h
|
||||
pngrio.obj: pngrio.c png.h pngconf.h pngpriv.h
|
||||
pngrtran.obj: pngrtran.c png.h pngconf.h pngpriv.h
|
||||
pngrutil.obj: pngrutil.c png.h pngconf.h pngpriv.h
|
||||
pngset.obj: pngset.c png.h pngconf.h pngpriv.h
|
||||
pngtrans.obj: pngtrans.c png.h pngconf.h pngpriv.h
|
||||
pngwio.obj: pngwio.c png.h pngconf.h pngpriv.h
|
||||
pngwrite.obj: pngwrite.c png.h pngconf.h pngpriv.h
|
||||
pngwtran.obj: pngwtran.c png.h pngconf.h pngpriv.h
|
||||
pngwutil.obj: pngwutil.c png.h pngconf.h pngpriv.h
|
||||
|
||||
$(LIBNAME): $(OBJS)
|
||||
-del $(LIBNAME)
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
# make clean
|
||||
|
||||
VERMAJ = 1
|
||||
VERMIN = 2
|
||||
VERMIC = 41
|
||||
VERMIN = 4
|
||||
VERMIC = 0
|
||||
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
|
||||
NAME = libpng
|
||||
PACKAGE = $(NAME)-$(VER)
|
||||
|
||||
BIN = libpng12-0.dll libpng-3.dll
|
||||
LIB = libpng12.a libpng12.dll.a libpng.a libpng.dll.a scripts/png32ce.def
|
||||
INCLUDE = png.h pngconf.h
|
||||
PC = libpng12.pc libpng.pc
|
||||
BIN = libpng14-0.dll libpng-14.dll
|
||||
LIB = libpng14.a libpng14.dll.a libpng.a libpng.dll.a scripts/png32ce.def
|
||||
INCLUDE = png.h pngconf.h pngpriv.h
|
||||
PC = libpng14.pc libpng.pc
|
||||
|
||||
MANIFESTVERBIN = "Libpng-$(VER): Binary files"
|
||||
MANIFESTVERDEV = "Libpng-$(VER): Developer files"
|
||||
|
||||
@@ -61,23 +61,14 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
### if you don't need thread safety, but want the asm accel
|
||||
#CFLAGS= $(strip $(MINGW_CCFLAGS) -DPNG_THREAD_UNSAFE_OK \
|
||||
# $(addprefix -I,$(ZLIBINC)) -W -Wall -O $(ALIGN) -funroll-loops \
|
||||
# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
### if you need thread safety and want (minimal) asm accel
|
||||
#CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
# -W -Wall -O $(ALIGN) -funroll-loops \
|
||||
# -fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
### Normal (non-asm) compilation
|
||||
CFLAGS= $(strip $(MINGW_CCFLAGS) $(addprefix -I,$(ZLIBINC)) \
|
||||
-W -Wall -O3 $(ALIGN) -funroll-loops -DPNG_NO_MMX_CODE \
|
||||
-W -Wall -O3 $(ALIGN) -funroll-loops \
|
||||
-fomit-frame-pointer) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
CYGDLL = 12
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
CYGDLL = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
SHAREDLIB=cygpng$(CYGDLL).dll
|
||||
@@ -141,7 +132,7 @@ libpng.pc: scripts/libpng.pc.in
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz! > libpng.pc
|
||||
|
||||
libpng-config: scripts/libpng-config-head.in scripts/libpng-config-body.in
|
||||
@echo -e Making $(LIBNAME) libpng-config file for this libpng \
|
||||
@@ -163,7 +154,7 @@ $(STATLIB): $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
$(SHAREDDEF): scripts/pngw32.def
|
||||
$(SHAREDDEF): scripts/pngwin.def
|
||||
cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \
|
||||
sed -e 's/\([^;]*\);/;/' > $@
|
||||
|
||||
@@ -254,16 +245,16 @@ test-dd:
|
||||
echo
|
||||
echo Testing installed dynamic shared library in $(DL).
|
||||
$(CC) -I$(DI) $(CFLAGS) \
|
||||
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
|
||||
`$(BINPATH)/libpng14-config --cflags` pngtest.c \
|
||||
-L$(DL) -L$(ZLIBLIB) \
|
||||
-o pngtestd `$(BINPATH)/libpng12-config --ldflags`
|
||||
-o pngtestd `$(BINPATH)/libpng14-config --ldflags`
|
||||
./pngtestd pngtest.png
|
||||
|
||||
test-installed:
|
||||
$(CC) $(CFLAGS) \
|
||||
`$(BINPATH)/libpng12-config --cflags` pngtest.c \
|
||||
`$(BINPATH)/libpng14-config --cflags` pngtest.c \
|
||||
-L$(ZLIBLIB) \
|
||||
-o pngtesti$(EXE) `$(BINPATH)/libpng12-config --ldflags`
|
||||
-o pngtesti$(EXE) `$(BINPATH)/libpng14-config --ldflags`
|
||||
./pngtesti$(EXE) pngtest.png
|
||||
|
||||
clean:
|
||||
@@ -279,21 +270,21 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h png.c
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngset.c
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h png.c
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h pngerror.c
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h pngrio.c
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h pngwio.c
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h pngmem.c
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h pngset.c
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h pngget.c
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h pngread.c
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h pngrtran.c
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h pngrutil.c
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h pngtrans.c
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h pngwrite.c
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h pngwtran.c
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h pngwutil.c
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h pngpread.c
|
||||
|
||||
pngtest.o: png.h pngconf.h pngtest.c
|
||||
pngtest-stat.o: png.h pngconf.h pngtest.c
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h
|
||||
# where "make install" puts libpng.a, libpng14.dylib, png.h and pngconf.h
|
||||
prefix=/usr/local
|
||||
exec_prefix=$(prefix)
|
||||
|
||||
@@ -20,9 +20,9 @@ ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 12
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -30,8 +30,8 @@ LIBSO=$(LIBNAME).dylib
|
||||
LIBSOMAJ=$(LIBNAME).$(PNGMAJ).dylib
|
||||
LIBSOVER=$(LIBNAME).$(PNGVER).dylib
|
||||
OLDSO=libpng.dylib
|
||||
OLDSOMAJ=libpng.3.dylib
|
||||
OLDSOVER=libpng.3.$(PNGMIN).dylib
|
||||
OLDSOMAJ=libpng.14.dylib
|
||||
OLDSOVER=libpng.14.$(PNGMIN).dylib
|
||||
|
||||
# Utilities:
|
||||
CC=cc
|
||||
@@ -41,9 +41,9 @@ LN_SF=ln -sf
|
||||
RANLIB=ranlib
|
||||
RM_F=/bin/rm -f
|
||||
|
||||
# CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE
|
||||
# CFLAGS=--DPNG_CONFIGURE_LIBPNG I$(ZLIBINC) -W -Wall -O3 -funroll-loops
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O -funroll-loops
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng14 -lz
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(exec_prefix)/lib
|
||||
@@ -87,14 +87,14 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
echo prefix=\"$(prefix)\"; \
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng12 -lz\"; \
|
||||
echo libs=\"-lpng14 -lz\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -107,14 +107,14 @@ $(LIBSOMAJ): $(LIBSOVER)
|
||||
$(LIBSOVER): $(OBJSDLL)
|
||||
$(CC) -dynamiclib \
|
||||
-install_name $(LIBPATH)/$(LIBSOMAJ) \
|
||||
-current_version 0 -compatibility_version 0 \
|
||||
-current_version 14 -compatibility_version 14 \
|
||||
-o $(LIBSOVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
|
||||
$(OLDSOVER): $(OBJSDLL)
|
||||
$(CC) -dynamiclib \
|
||||
-install_name $(LIBPATH)/$(OLDSOMAJ) \
|
||||
-current_version 3 -compatibility_version 3 \
|
||||
-current_version 14 -compatibility_version 14 \
|
||||
-o $(OLDSOVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -lz
|
||||
|
||||
@@ -218,20 +218,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
# and license in png.h
|
||||
|
||||
# Library name:
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
LIBNAME = libpng12
|
||||
LIBNAME = libpng14
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.so.14
|
||||
OLDSOVER=libpng.so.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
AR_RC=ar rc
|
||||
@@ -75,7 +75,7 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@@ -83,7 +83,7 @@ libpng-config:
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo ccopts=\"-std\"; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -198,20 +198,20 @@ clean:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o: png.h pngconf.h
|
||||
pngerror.o: png.h pngconf.h
|
||||
pngrio.o: png.h pngconf.h
|
||||
pngwio.o: png.h pngconf.h
|
||||
pngmem.o: png.h pngconf.h
|
||||
pngset.o: png.h pngconf.h
|
||||
pngget.o: png.h pngconf.h
|
||||
pngread.o: png.h pngconf.h
|
||||
pngrtran.o: png.h pngconf.h
|
||||
pngrutil.o: png.h pngconf.h
|
||||
pngtrans.o: png.h pngconf.h
|
||||
pngwrite.o: png.h pngconf.h
|
||||
pngwtran.o: png.h pngconf.h
|
||||
pngwutil.o: png.h pngconf.h
|
||||
pngpread.o: png.h pngconf.h
|
||||
png.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -39,20 +39,20 @@ clean:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o: png.h pngconf.h
|
||||
pngerror.o: png.h pngconf.h
|
||||
pngrio.o: png.h pngconf.h
|
||||
pngwio.o: png.h pngconf.h
|
||||
pngmem.o: png.h pngconf.h
|
||||
pngset.o: png.h pngconf.h
|
||||
pngget.o: png.h pngconf.h
|
||||
pngread.o: png.h pngconf.h
|
||||
pngpread.o: png.h pngconf.h
|
||||
pngrtran.o: png.h pngconf.h
|
||||
pngrutil.o: png.h pngconf.h
|
||||
pngtrans.o: png.h pngconf.h
|
||||
pngwrite.o: png.h pngconf.h
|
||||
pngwtran.o: png.h pngconf.h
|
||||
pngwutil.o: png.h pngconf.h
|
||||
png.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# makefile for libpng.a and libpng12.so on Linux ELF with gcc
|
||||
# makefile for libpng.a and libpng14.so on Linux ELF with gcc
|
||||
# Copyright (C) 1998, 1999, 2002, 2006, 2008 Greg Roelofs
|
||||
# and Glenn Randers-Pehrson
|
||||
# Copyright (C) 1996, 1997 Andreas Dilger
|
||||
@@ -10,13 +10,13 @@
|
||||
# Modified for Debian by Junichi Uekawa and Josselin Mouette
|
||||
# Major modifications are:
|
||||
# * link libpng explicitly with libz and libm
|
||||
# * $(OLDSO).3 is a symlink rather than a different library
|
||||
# * $(OLDSO).14 is a symlink rather than a different library
|
||||
# * versioned symbols
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -24,8 +24,8 @@ LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.so.14
|
||||
OLDSOVER=libpng.so.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
AR_RC=ar rc
|
||||
@@ -35,8 +35,8 @@ LN_SF=ln -sf
|
||||
RANLIB=ranlib
|
||||
RM_F=/bin/rm -f
|
||||
|
||||
# where "make install" puts libpng12.a, libpng12.so*,
|
||||
# libpng12/png.h and libpng12/pngconf.h
|
||||
# where "make install" puts libpng14.a, libpng14.so*,
|
||||
# libpng14/png.h and libpng14/pngconf.h
|
||||
# Prefix must be a full pathname.
|
||||
prefix=/usr/local
|
||||
exec_prefix=$(prefix)
|
||||
@@ -60,7 +60,7 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -W -Wall -D_REENTRANT -O2 \
|
||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
|
||||
LDFLAGS=-L. -lpng12
|
||||
LDFLAGS=-L. -lpng14
|
||||
LDFLAGS_A=libpng.a -lz -lm
|
||||
LIBADDFLAGS=-lz -lm
|
||||
|
||||
@@ -107,11 +107,11 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng.syms: png.h pngconf.h
|
||||
$(CC) $(CFLAGS) -E -DPNG_BUILDSYMS -DPNG_INTERNAL png.h |\
|
||||
awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG12_%s {global:\n",PNGMAJ)}\
|
||||
awk -F '[\t [\\]();]' -v PNGMAJ=$(PNGMAJ) 'BEGIN{printf("PNG14_%s {global:\n",PNGMAJ)}\
|
||||
{ for (i=1;i+2<=NF;++i)\
|
||||
if ($$(i)=="PNG_FUNCTION_EXPORT" && $$(i+2)=="END")\
|
||||
print $$(i+1) ";";\
|
||||
@@ -128,8 +128,8 @@ libpng-config:
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo L_opts=\"\"; \
|
||||
echo R_opts=\"\"; \
|
||||
echo libs=\"-lpng12\"; \
|
||||
echo all_libs=\"-lpng12 $(LIBADDFLAGS)\"; \
|
||||
echo libs=\"-lpng14\"; \
|
||||
echo all_libs=\"-lpng14 $(LIBADDFLAGS)\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -260,20 +260,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# and license in png.h
|
||||
|
||||
PREFIX?= /usr/local
|
||||
SHLIB_VER?= 5
|
||||
SHLIB_VER?= 14
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= ${SHLIB_VER}
|
||||
@@ -17,7 +17,7 @@ NOOBJ= YES
|
||||
# where make install puts libpng.a and png.h
|
||||
DESTDIR= ${PREFIX}
|
||||
LIBDIR= /lib
|
||||
INCS= png.h pngconf.h
|
||||
INCS= png.h pngconf.h pngpriv.h
|
||||
INCSDIR= /include/libpng
|
||||
INCDIR= ${INCSDIR} # for 4.x bsd.lib.mk
|
||||
MAN= libpng.3 libpngpf.3 png.5
|
||||
@@ -28,9 +28,6 @@ LDADD+= -lm -lz
|
||||
DPADD+= ${LIBM} ${LIBZ}
|
||||
|
||||
CFLAGS+= -DPNG_CONFIGURE_LIBPNG -I.
|
||||
.if (${MACHINE_ARCH} != "i386")
|
||||
CFLAGS+= -DPNG_CONFIGURE_LIBPNG -DPNG_NO_MMX_CODE
|
||||
.endif
|
||||
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
|
||||
@@ -64,20 +64,20 @@ pngtest$(EXE): pngtest$(O) libpng$(A)
|
||||
clean:
|
||||
$(RM_F) *$(O) libpng$(A) pngtest$(EXE) pngout.png
|
||||
|
||||
png$(O): png.h pngconf.h
|
||||
pngerror$(O): png.h pngconf.h
|
||||
pngget$(O): png.h pngconf.h
|
||||
pngmem$(O): png.h pngconf.h
|
||||
pngpread$(O): png.h pngconf.h
|
||||
pngread$(O): png.h pngconf.h
|
||||
pngrio$(O): png.h pngconf.h
|
||||
pngrtran$(O): png.h pngconf.h
|
||||
pngrutil$(O): png.h pngconf.h
|
||||
pngset$(O): png.h pngconf.h
|
||||
pngtrans$(O): png.h pngconf.h
|
||||
pngwio$(O): png.h pngconf.h
|
||||
pngwrite$(O): png.h pngconf.h
|
||||
pngwtran$(O): png.h pngconf.h
|
||||
pngwutil$(O): png.h pngconf.h
|
||||
png$(O): png.h pngconf.h pngpriv.h
|
||||
pngerror$(O): png.h pngconf.h pngpriv.h
|
||||
pngget$(O): png.h pngconf.h pngpriv.h
|
||||
pngmem$(O): png.h pngconf.h pngpriv.h
|
||||
pngpread$(O): png.h pngconf.h pngpriv.h
|
||||
pngread$(O): png.h pngconf.h pngpriv.h
|
||||
pngrio$(O): png.h pngconf.h pngpriv.h
|
||||
pngrtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngrutil$(O): png.h pngconf.h pngpriv.h
|
||||
pngset$(O): png.h pngconf.h pngpriv.h
|
||||
pngtrans$(O): png.h pngconf.h pngpriv.h
|
||||
pngwio$(O): png.h pngconf.h pngpriv.h
|
||||
pngwrite$(O): png.h pngconf.h pngpriv.h
|
||||
pngwtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngwutil$(O): png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest$(O): png.h pngconf.h
|
||||
|
||||
@@ -1,274 +0,0 @@
|
||||
# makefile for libpng.a and libpng12.so on Linux ELF with gcc using MMX
|
||||
# assembler code
|
||||
# Copyright 2002, 2006, 2008 Greg Roelofs and Glenn Randers-Pehrson
|
||||
# Copyright 1998-2001 Greg Roelofs
|
||||
# Copyright 1996-1997 Andreas Dilger
|
||||
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# CAUTION: Do not use this makefile with gcc versions 2.7.2.2 and earlier.
|
||||
|
||||
# NOTE: When testing MMX performance on a multitasking system, make sure
|
||||
# there are no floating-point programs (e.g., SETI@Home) running in
|
||||
# the background! Context switches between MMX and FPU are expensive.
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
LIBSO=$(LIBNAME).so
|
||||
LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).so.$(PNGVER)
|
||||
OLDSO=libpng.so
|
||||
OLDSOMAJ=libpng.so.3
|
||||
OLDSOVER=libpng.so.3.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
CC = gcc
|
||||
LD = $(CC)
|
||||
AR_RC = ar rc
|
||||
LN_SF = ln -sf
|
||||
MKDIR_P = mkdir -p
|
||||
RANLIB = ranlib
|
||||
RM_F = /bin/rm -f
|
||||
|
||||
# where "make install" puts libpng12.a, libpng12.so*,
|
||||
# libpng12/png.h and libpng12/pngconf.h
|
||||
# Prefix must be a full pathname.
|
||||
prefix=/usr/local
|
||||
exec_prefix=$(prefix)
|
||||
|
||||
# Where the zlib library and include files are located.
|
||||
#ZLIBLIB=/usr/local/lib
|
||||
#ZLIBINC=/usr/local/include
|
||||
ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
# Remove -DPNG_THREAD_UNSAFE_OK if you need thread safety
|
||||
### for generic gcc:
|
||||
CFLAGS=-DPNG_THREAD_UNSAFE_OK -I$(ZLIBINC) -W -Wall -O \
|
||||
$(ALIGN) -funroll-loops \
|
||||
-fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
### for gcc 2.95.2 on 686:
|
||||
#CFLAGS=-DPNG_THREAD_UNSAFE_OK -I$(ZLIBINC) -W -Wall -O \
|
||||
# -mcpu=i686 -malign-double -ffast-math -fstrict-aliasing \
|
||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
||||
### for gcc 2.7.2.3 on 486 and up:
|
||||
#CFLAGS=-DPNG_THREAD_UNSAFE_OK -I$(ZLIBINC) -W -Wall -O \
|
||||
# -m486 -malign-double -ffast-math \
|
||||
# $(ALIGN) -funroll-loops -funroll-all-loops -fomit-frame-pointer
|
||||
|
||||
LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
|
||||
LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
|
||||
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(exec_prefix)/lib
|
||||
MANPATH=$(prefix)/man
|
||||
BINPATH=$(exec_prefix)/bin
|
||||
|
||||
# override DESTDIR= on the make install command line to easily support
|
||||
# installing into a temporary location. Example:
|
||||
#
|
||||
# make install DESTDIR=/tmp/build/libpng
|
||||
#
|
||||
# If you're going to install into a temporary location
|
||||
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
|
||||
# you execute make install.
|
||||
DESTDIR=
|
||||
|
||||
DB=$(DESTDIR)$(BINPATH)
|
||||
DI=$(DESTDIR)$(INCPATH)
|
||||
DL=$(DESTDIR)$(LIBPATH)
|
||||
DM=$(DESTDIR)$(MANPATH)
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||
|
||||
OBJSDLL = $(OBJS:.o=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
|
||||
|
||||
libpng.a: $(OBJS)
|
||||
$(AR_RC) $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libpng.pc:
|
||||
cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
echo prefix=\"$(prefix)\"; \
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo cppflags=\"-DPNG_THREAD_UNSAFE_OK \"; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
$(LIBSO): $(LIBSOMAJ)
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO)
|
||||
|
||||
$(LIBSOMAJ): $(LIBSOVER)
|
||||
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ)
|
||||
|
||||
$(LIBSOVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,$(LIBSOMAJ) \
|
||||
-o $(LIBSOVER) \
|
||||
$(OBJSDLL)
|
||||
|
||||
$(OLDSOVER): $(OBJSDLL)
|
||||
$(CC) -shared -Wl,-soname,$(OLDSOMAJ) \
|
||||
-o $(OLDSOVER) \
|
||||
$(OBJSDLL)
|
||||
|
||||
pngtest: pngtest.o $(LIBSO)
|
||||
$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
||||
|
||||
pngtest-static: pngtest.o libpng.a
|
||||
$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
|
||||
|
||||
test: pngtest pngtest-static
|
||||
@echo ""
|
||||
@echo " Running pngtest dynamically linked with $(LIBSO):"
|
||||
@echo ""
|
||||
./pngtest
|
||||
@echo ""
|
||||
@echo " Running pngtest statically linked with libpng.a:"
|
||||
@echo ""
|
||||
./pngtest-static
|
||||
|
||||
install-headers: png.h pngconf.h
|
||||
-@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
|
||||
-@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
|
||||
cp png.h pngconf.h $(DI)/$(LIBNAME)
|
||||
chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h
|
||||
-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h
|
||||
-@$(RM_F) $(DI)/libpng
|
||||
(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
|
||||
|
||||
install-static: install-headers libpng.a
|
||||
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
||||
cp libpng.a $(DL)/$(LIBNAME).a
|
||||
chmod 644 $(DL)/$(LIBNAME).a
|
||||
-@$(RM_F) $(DL)/libpng.a
|
||||
(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
|
||||
|
||||
install-shared: install-headers $(LIBSOVER) libpng.pc \
|
||||
$(OLDSOVER)
|
||||
-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
|
||||
-@$(RM_F) $(DL)/$(LIBSOVER)* $(DL)/$(LIBSO)
|
||||
-@$(RM_F) $(DL)/$(LIBSOMAJ)
|
||||
-@$(RM_F) $(DL)/$(OLDSO)
|
||||
-@$(RM_F) $(DL)/$(OLDSOMAJ)
|
||||
-@$(RM_F) $(DL)/$(OLDSOVER)*
|
||||
cp $(LIBSOVER) $(DL)
|
||||
cp $(OLDSOVER) $(DL)
|
||||
chmod 755 $(DL)/$(LIBSOVER)
|
||||
chmod 755 $(DL)/$(OLDSOVER)
|
||||
(cd $(DL); \
|
||||
$(LN_SF) $(OLDSOVER) $(OLDSOMAJ); \
|
||||
$(LN_SF) $(OLDSOMAJ) $(OLDSO); \
|
||||
$(LN_SF) $(LIBSOVER) $(LIBSOMAJ); \
|
||||
$(LN_SF) $(LIBSOMAJ) $(LIBSO))
|
||||
-@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
|
||||
-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
-@$(RM_F) $(DL)/pkgconfig/libpng.pc
|
||||
cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
|
||||
(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
|
||||
|
||||
install-man: libpng.3 libpngpf.3 png.5
|
||||
-@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
|
||||
-@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
|
||||
-@$(RM_F) $(DM)/man3/libpng.3
|
||||
-@$(RM_F) $(DM)/man3/libpngpf.3
|
||||
cp libpng.3 $(DM)/man3
|
||||
cp libpngpf.3 $(DM)/man3
|
||||
-@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
|
||||
-@$(RM_F) $(DM)/man5/png.5
|
||||
cp png.5 $(DM)/man5
|
||||
|
||||
install-config: libpng-config
|
||||
-@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
|
||||
-@$(RM_F) $(DB)/libpng-config
|
||||
-@$(RM_F) $(DB)/$(LIBNAME)-config
|
||||
cp libpng-config $(DB)/$(LIBNAME)-config
|
||||
chmod 755 $(DB)/$(LIBNAME)-config
|
||||
(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
|
||||
|
||||
install: install-static install-shared install-man install-config
|
||||
|
||||
# If you installed in $(DESTDIR), test-installed won't work until you
|
||||
# move the library to its final location. Use test-dd to test it
|
||||
# before then.
|
||||
|
||||
test-dd:
|
||||
echo
|
||||
echo Testing installed dynamic shared library in $(DL).
|
||||
$(CC) -I$(DI) -I$(ZLIBINC) \
|
||||
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
||||
-L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
||||
./pngtestd pngtest.png
|
||||
|
||||
test-installed:
|
||||
$(CC) -I$(ZLIBINC) \
|
||||
`$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
|
||||
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
|
||||
./pngtesti pngtest.png
|
||||
|
||||
clean:
|
||||
$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
|
||||
$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
|
||||
$(OLDSOVER) \
|
||||
libpng.pc
|
||||
|
||||
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
|
||||
writelock:
|
||||
chmod a-w *.[ch35] $(DOCS) scripts/*
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h png.c
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngset.c
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c
|
||||
|
||||
pngtest.o: png.h pngconf.h pngtest.c
|
||||
@@ -19,9 +19,9 @@ ZLIBINC=/opt/zlib/include
|
||||
# SHAREDLIB=libz.sl
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -29,8 +29,8 @@ LIBSO=$(LIBNAME).sl
|
||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||
OLDSO=libpng.sl
|
||||
OLDSOMAJ=libpng.sl.3
|
||||
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.sl.14
|
||||
OLDSOVER=libpng.sl.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
AR_RC=ar rc
|
||||
@@ -48,7 +48,7 @@ CCFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae -Wl,+vnocompatwarnings +DD64
|
||||
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
|
||||
# where make install puts libpng.a, libpng12.sl, and png.h
|
||||
# where make install puts libpng.a, libpng14.sl, and png.h
|
||||
prefix=/opt/libpng
|
||||
exec_prefix=$(prefix)
|
||||
INCPATH=$(prefix)/include
|
||||
@@ -93,7 +93,7 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@@ -101,7 +101,7 @@ libpng-config:
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -220,20 +220,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o: png.h pngconf.h
|
||||
pngerror.o: png.h pngconf.h
|
||||
pngrio.o: png.h pngconf.h
|
||||
pngwio.o: png.h pngconf.h
|
||||
pngmem.o: png.h pngconf.h
|
||||
pngset.o: png.h pngconf.h
|
||||
pngget.o: png.h pngconf.h
|
||||
pngread.o: png.h pngconf.h
|
||||
pngrtran.o: png.h pngconf.h
|
||||
pngrutil.o: png.h pngconf.h
|
||||
pngtrans.o: png.h pngconf.h
|
||||
pngwrite.o: png.h pngconf.h
|
||||
pngwtran.o: png.h pngconf.h
|
||||
pngwutil.o: png.h pngconf.h
|
||||
pngpread.o: png.h pngconf.h
|
||||
png.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
# and license in png.h
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -19,8 +19,8 @@ LIBSO=$(LIBNAME).sl
|
||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||
OLDSO=libpng.sl
|
||||
OLDSOMAJ=libpng.sl.3
|
||||
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.sl.14
|
||||
OLDSOVER=libpng.sl.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
CC=gcc
|
||||
@@ -58,8 +58,8 @@ WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -W -Wall -O3 -funroll-loops -DPNG_NO_MMX_CODE \
|
||||
$(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
|
||||
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng12 -lz -lm
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng12 -lz -lm
|
||||
#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng14 -lz -lm
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng14 -lz -lm
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(exec_prefix)/lib
|
||||
@@ -103,13 +103,13 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
echo prefix=\"$(prefix)\"; \
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -229,20 +229,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h
|
||||
png.o png.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -19,9 +19,9 @@ ZLIBINC=/opt/zlib/include
|
||||
# SHAREDLIB=libz.sl
|
||||
|
||||
# Library name:
|
||||
LIBNAME = libpng12
|
||||
PNGMAJ = 0
|
||||
PNGMIN = 1.2.41beta19
|
||||
LIBNAME = libpng14
|
||||
PNGMAJ = 14
|
||||
PNGMIN = 1.4.0beta97
|
||||
PNGVER = $(PNGMAJ).$(PNGMIN)
|
||||
|
||||
# Shared library names:
|
||||
@@ -29,8 +29,8 @@ LIBSO=$(LIBNAME).sl
|
||||
LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
||||
LIBSOVER=$(LIBNAME).sl.$(PNGVER)
|
||||
OLDSO=libpng.sl
|
||||
OLDSOMAJ=libpng.sl.3
|
||||
OLDSOVER=libpng.sl.3.$(PNGMIN)
|
||||
OLDSOMAJ=libpng.sl.14
|
||||
OLDSOVER=libpng.sl.14.$(PNGMIN)
|
||||
|
||||
# Utilities:
|
||||
AR_RC=ar rc
|
||||
@@ -40,7 +40,7 @@ LN_SF=ln -sf
|
||||
RANLIB=ranlib
|
||||
RM_F=/bin/rm -f
|
||||
|
||||
# where make install puts libpng.a, libpng12.sl, and png.h
|
||||
# where make install puts libpng.a, libpng14.sl, and png.h
|
||||
prefix=/opt/libpng
|
||||
exec_prefix=$(prefix)
|
||||
INCPATH=$(prefix)/include
|
||||
@@ -48,7 +48,7 @@ LIBPATH=$(exec_prefix)/lib
|
||||
MANPATH=$(prefix)/man
|
||||
BINPATH=$(exec_prefix)/bin
|
||||
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0 -DPNG_NO_MMX_CODE
|
||||
CFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
|
||||
# Caution: be sure you have built zlib with the same CFLAGS.
|
||||
CCFLAGS=-DPNG_CONFIGURE_LIBPNG -I$(ZLIBINC) -O -Ae +DA1.1 +DS2.0
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
|
||||
@@ -90,7 +90,7 @@ libpng.pc:
|
||||
-e s!@exec_prefix@!$(exec_prefix)! \
|
||||
-e s!@libdir@!$(LIBPATH)! \
|
||||
-e s!@includedir@!$(INCPATH)! \
|
||||
-e s!-lpng12!-lpng12\ -lz\ -lm! > libpng.pc
|
||||
-e s!-lpng14!-lpng14\ -lz\ -lm! > libpng.pc
|
||||
|
||||
libpng-config:
|
||||
( cat scripts/libpng-config-head.in; \
|
||||
@@ -98,7 +98,7 @@ libpng-config:
|
||||
echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
|
||||
echo ccopts=\"-Ae +DA1.1 +DS2.0\"; \
|
||||
echo L_opts=\"-L$(LIBPATH)\"; \
|
||||
echo libs=\"-lpng12 -lz -lm\"; \
|
||||
echo libs=\"-lpng14 -lz -lm\"; \
|
||||
cat scripts/libpng-config-body.in ) > libpng-config
|
||||
chmod +x libpng-config
|
||||
|
||||
@@ -217,20 +217,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o: png.h pngconf.h
|
||||
pngerror.o: png.h pngconf.h
|
||||
pngrio.o: png.h pngconf.h
|
||||
pngwio.o: png.h pngconf.h
|
||||
pngmem.o: png.h pngconf.h
|
||||
pngset.o: png.h pngconf.h
|
||||
pngget.o: png.h pngconf.h
|
||||
pngread.o: png.h pngconf.h
|
||||
pngrtran.o: png.h pngconf.h
|
||||
pngrutil.o: png.h pngconf.h
|
||||
pngtrans.o: png.h pngconf.h
|
||||
pngwrite.o: png.h pngconf.h
|
||||
pngwtran.o: png.h pngconf.h
|
||||
pngwutil.o: png.h pngconf.h
|
||||
pngpread.o: png.h pngconf.h
|
||||
png.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
@@ -58,20 +58,20 @@ clean:
|
||||
$(RM) pngtest$(E)
|
||||
$(RM) pngout.png
|
||||
|
||||
png$(O): png.h pngconf.h
|
||||
pngerror$(O): png.h pngconf.h
|
||||
pngget$(O): png.h pngconf.h
|
||||
pngmem$(O): png.h pngconf.h
|
||||
pngpread$(O): png.h pngconf.h
|
||||
pngread$(O): png.h pngconf.h
|
||||
pngrio$(O): png.h pngconf.h
|
||||
pngrtran$(O): png.h pngconf.h
|
||||
pngrutil$(O): png.h pngconf.h
|
||||
pngset$(O): png.h pngconf.h
|
||||
pngtrans$(O): png.h pngconf.h
|
||||
pngwio$(O): png.h pngconf.h
|
||||
pngwrite$(O): png.h pngconf.h
|
||||
pngwtran$(O): png.h pngconf.h
|
||||
pngwutil$(O): png.h pngconf.h
|
||||
png$(O): png.h pngconf.h pngpriv.h
|
||||
pngerror$(O): png.h pngconf.h pngpriv.h
|
||||
pngget$(O): png.h pngconf.h pngpriv.h
|
||||
pngmem$(O): png.h pngconf.h pngpriv.h
|
||||
pngpread$(O): png.h pngconf.h pngpriv.h
|
||||
pngread$(O): png.h pngconf.h pngpriv.h
|
||||
pngrio$(O): png.h pngconf.h pngpriv.h
|
||||
pngrtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngrutil$(O): png.h pngconf.h pngpriv.h
|
||||
pngset$(O): png.h pngconf.h pngpriv.h
|
||||
pngtrans$(O): png.h pngconf.h pngpriv.h
|
||||
pngwio$(O): png.h pngconf.h pngpriv.h
|
||||
pngwrite$(O): png.h pngconf.h pngpriv.h
|
||||
pngwtran$(O): png.h pngconf.h pngpriv.h
|
||||
pngwutil$(O): png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest$(O): png.h pngconf.h
|
||||
|
||||
@@ -44,49 +44,49 @@ pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
|
||||
|
||||
all: test
|
||||
|
||||
png$(O): png.h pngconf.h
|
||||
png$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngset$(O): png.h pngconf.h
|
||||
pngset$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngget$(O): png.h pngconf.h
|
||||
pngget$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngread$(O): png.h pngconf.h
|
||||
pngread$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngpread$(O): png.h pngconf.h
|
||||
pngpread$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngrtran$(O): png.h pngconf.h
|
||||
pngrtran$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngrutil$(O): png.h pngconf.h
|
||||
pngrutil$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngerror$(O): png.h pngconf.h
|
||||
pngerror$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngmem$(O): png.h pngconf.h
|
||||
pngmem$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngrio$(O): png.h pngconf.h
|
||||
pngrio$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngwio$(O): png.h pngconf.h
|
||||
pngwio$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngtrans$(O): png.h pngconf.h
|
||||
pngtrans$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngwrite$(O): png.h pngconf.h
|
||||
pngwrite$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngwtran$(O): png.h pngconf.h
|
||||
pngwtran$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
pngwutil$(O): png.h pngconf.h
|
||||
pngwutil$(O): png.h pngconf.h pngpriv.h
|
||||
$(CC) $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libpng.lib: $(OBJS)
|
||||
|
||||
@@ -84,20 +84,20 @@ writelock:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o: png.h pngconf.h
|
||||
pngerror.o: png.h pngconf.h
|
||||
pngrio.o: png.h pngconf.h
|
||||
pngwio.o: png.h pngconf.h
|
||||
pngmem.o: png.h pngconf.h
|
||||
pngset.o: png.h pngconf.h
|
||||
pngget.o: png.h pngconf.h
|
||||
pngread.o: png.h pngconf.h
|
||||
pngpread.o: png.h pngconf.h
|
||||
pngrtran.o: png.h pngconf.h
|
||||
pngrutil.o: png.h pngconf.h
|
||||
pngtrans.o: png.h pngconf.h
|
||||
pngwrite.o: png.h pngconf.h
|
||||
pngwtran.o: png.h pngconf.h
|
||||
pngwutil.o: png.h pngconf.h
|
||||
png.o: png.h pngconf.h pngpriv.h
|
||||
pngerror.o: png.h pngconf.h pngpriv.h
|
||||
pngrio.o: png.h pngconf.h pngpriv.h
|
||||
pngwio.o: png.h pngconf.h pngpriv.h
|
||||
pngmem.o: png.h pngconf.h pngpriv.h
|
||||
pngset.o: png.h pngconf.h pngpriv.h
|
||||
pngget.o: png.h pngconf.h pngpriv.h
|
||||
pngread.o: png.h pngconf.h pngpriv.h
|
||||
pngpread.o: png.h pngconf.h pngpriv.h
|
||||
pngrtran.o: png.h pngconf.h pngpriv.h
|
||||
pngrutil.o: png.h pngconf.h pngpriv.h
|
||||
pngtrans.o: png.h pngconf.h pngpriv.h
|
||||
pngwrite.o: png.h pngconf.h pngpriv.h
|
||||
pngwtran.o: png.h pngconf.h pngpriv.h
|
||||
pngwutil.o: png.h pngconf.h pngpriv.h
|
||||
|
||||
pngtest.o: png.h pngconf.h
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user