mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
24 Commits
libpng-1.6
...
v1.6.9beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41633d33c4 | ||
|
|
88cf760b07 | ||
|
|
4ea97d8bc7 | ||
|
|
bef206b0a8 | ||
|
|
b94db2eb34 | ||
|
|
3f7a169c2d | ||
|
|
bc79c250e9 | ||
|
|
3cc9e8ff96 | ||
|
|
95a197397f | ||
|
|
d0479d24a0 | ||
|
|
1fc0171278 | ||
|
|
a8472470a4 | ||
|
|
88ecac68be | ||
|
|
e51ba2eff4 | ||
|
|
a80e864faa | ||
|
|
1d3c990425 | ||
|
|
79f0ba499f | ||
|
|
74e84d0f7d | ||
|
|
4568762d28 | ||
|
|
0740c62700 | ||
|
|
38f49403bd | ||
|
|
8f1150eb75 | ||
|
|
c10930a4fc | ||
|
|
bff81bdddc |
84
ANNOUNCE
84
ANNOUNCE
@@ -1,57 +1,67 @@
|
|||||||
|
|
||||||
Libpng 1.6.8 - December 19, 2013
|
Libpng 1.6.9beta03 - January 10, 2014
|
||||||
|
|
||||||
This is a public release of libpng, intended for use in production codes.
|
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.
|
||||||
|
|
||||||
Files available for download:
|
Files available for download:
|
||||||
|
|
||||||
Source files with LF line endings (for Unix/Linux) and with a
|
Source files with LF line endings (for Unix/Linux) and with a
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
libpng-1.6.8.tar.xz (LZMA-compressed, recommended)
|
1.6.9beta03.tar.xz (LZMA-compressed, recommended)
|
||||||
libpng-1.6.8.tar.gz
|
1.6.9beta03.tar.gz
|
||||||
|
|
||||||
Source files with CRLF line endings (for Windows), without the
|
Source files with CRLF line endings (for Windows), without the
|
||||||
"configure" script
|
"configure" script
|
||||||
|
|
||||||
lpng168.7z (LZMA-compressed, recommended)
|
lp169b03.7z (LZMA-compressed, recommended)
|
||||||
lpng168.zip
|
lp169b03.zip
|
||||||
|
|
||||||
Other information:
|
Other information:
|
||||||
|
|
||||||
libpng-1.6.8-README.txt
|
1.6.9beta03-README.txt
|
||||||
libpng-1.6.8-LICENSE.txt
|
1.6.9beta03-LICENSE.txt
|
||||||
Gnupg/*.asc (PGP armored detached signatures)
|
Gnupg/*.asc (PGP armored detached signatures)
|
||||||
|
|
||||||
Changes since the last public release (1.6.7):
|
Changes since the last public release (1.6.8):
|
||||||
Changed #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED in pngpread.c to
|
|
||||||
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED to be consistent with
|
Version 1.6.9beta01 [December 26, 2013]
|
||||||
what is in pngpriv.h.
|
Bookkeeping: Moved functions around (no changes). Moved transform
|
||||||
Moved prototype for png_handle_unknown() in pngpriv.h outside of
|
function definitions before the place where they are called so that
|
||||||
the #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED/#endif block.
|
they can be masde static. Move the intrapixel functions and the
|
||||||
Added "-Wall" to CFLAGS in contrib/pngminim/*/makefile
|
grayscale palette builder out of the png?tran.c files. The latter
|
||||||
Conditionally compile some unused functions reported by -Wall in
|
isn't a transform function and is no longer used internally, and the
|
||||||
pngminim.
|
former MNG specific functions are better placed in pngread/pngwrite.c
|
||||||
Fixed 'minimal' builds. Various obviously useful minimal configurations
|
Made transform implementation functions static. This makes the internal
|
||||||
don't build because of missing contrib/libtests test programs and
|
functions called by png_do_{read|write}_transformations static. On an
|
||||||
overly complex dependencies in scripts/pnglibconf.dfa. This change
|
x86-64 DLL build (Gentoo Linux) this reduces the size of the text
|
||||||
adds contrib/conftest/*.dfa files that can be used in automatic build
|
segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
|
||||||
scripts to ensure that these configurations continue to build.
|
maintenance by removing the declarations from pngpriv.h and allowing
|
||||||
Enabled WRITE_INVERT and WRITE_PACK in contrib/pngminim/encoder.
|
easier changes to the internal interfaces.
|
||||||
Fixed pngvalid 'fail' function declaration on the Intel C Compiler.
|
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
|
||||||
This reverts to the previous 'static' implementation and works round
|
in the tar distributions.
|
||||||
the 'unused static function' warning by using PNG_UNUSED().
|
|
||||||
Removed or marked PNG_UNUSED some harmless "dead assignments" reported
|
Version 1.6.9beta02 [January 1, 2014]
|
||||||
by clang scan-build.
|
Added checks for libpng 1.5 to pngvalid.c. This supports the use of
|
||||||
Changed tabs to 3 spaces in png_debug macros and changed '"%s"m'
|
this version of pngvalid in libpng 1.5
|
||||||
to '"%s" m' to improve portability among compilers.
|
Merged with pngvalid.c from libpng-1.7 changes to create a single
|
||||||
Changed png_free_default() to free() in pngtest.c
|
pngvalid.c
|
||||||
Tidied up pngfix inits and fixed pngtest no-write builds.
|
Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner).
|
||||||
Handle zero-length PLTE chunk or NULL palette with png_error()
|
Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c with libpng-1.7.0
|
||||||
instead of png_chunk_report(), which by default issues a warning
|
Merged libpng-1.7.0 changes to make no-interlace configurations work
|
||||||
rather than an error, leading to later reading from a NULL pointer
|
with test programs.
|
||||||
(png_ptr->palette) in png_do_expand_palette(). This is CVE-2013-6954
|
Revised pngvalid.c to support libpng 1.5, which does not support the
|
||||||
and VU#650142.
|
PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in
|
||||||
|
pngvalid.c
|
||||||
|
Allow unversioned links created on install to be disabled in configure.
|
||||||
|
In configure builds 'make install' changes/adds links like png.h
|
||||||
|
and libpng.a to point to the newly installed, versioned, files (e.g.
|
||||||
|
libpng17/png.h and libpng17.a). Three new configure options and some
|
||||||
|
rearrangement of Makefile.am allow creation of these links to be disabled.
|
||||||
|
|
||||||
|
Version 1.6.9beta03 [January 10, 2014]
|
||||||
|
Removed potentially misleading warning from png_check_IHDR().
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
41
CHANGES
41
CHANGES
@@ -4745,9 +4745,48 @@ Version 1.6.8rc02 [December 14, 2013]
|
|||||||
instead of png_chunk_report(), which by default issues a warning
|
instead of png_chunk_report(), which by default issues a warning
|
||||||
rather than an error, leading to later reading from a NULL pointer
|
rather than an error, leading to later reading from a NULL pointer
|
||||||
(png_ptr->palette) in png_do_expand_palette(). This is CVE-2013-6954
|
(png_ptr->palette) in png_do_expand_palette(). This is CVE-2013-6954
|
||||||
and VU#650142.
|
and VU#650142. Libpng-1.6.1 through 1.6.7 are vulnerable.
|
||||||
|
Libpng-1.6.0 and earlier do not have this bug.
|
||||||
|
|
||||||
Version 1.6.8 [December 19, 2013]
|
Version 1.6.8 [December 19, 2013]
|
||||||
|
No changes.
|
||||||
|
|
||||||
|
Version 1.6.9beta01 [December 26, 2013]
|
||||||
|
Bookkeeping: Moved functions around (no changes). Moved transform
|
||||||
|
function definitions before the place where they are called so that
|
||||||
|
they can be masde static. Move the intrapixel functions and the
|
||||||
|
grayscale palette builder out of the png?tran.c files. The latter
|
||||||
|
isn't a transform function and is no longer used internally, and the
|
||||||
|
former MNG specific functions are better placed in pngread/pngwrite.c
|
||||||
|
Made transform implementation functions static. This makes the internal
|
||||||
|
functions called by png_do_{read|write}_transformations static. On an
|
||||||
|
x86-64 DLL build (Gentoo Linux) this reduces the size of the text
|
||||||
|
segment of the DLL by 1208 bytes, about 0.6%. It also simplifies
|
||||||
|
maintenance by removing the declarations from pngpriv.h and allowing
|
||||||
|
easier changes to the internal interfaces.
|
||||||
|
Rebuilt configure scripts with automake-1.14.1 and autoconf-2.69
|
||||||
|
in the tar distributions.
|
||||||
|
|
||||||
|
Version 1.6.9beta02 [January 1, 2014]
|
||||||
|
Added checks for libpng 1.5 to pngvalid.c. This supports the use of
|
||||||
|
this version of pngvalid in libpng 1.5
|
||||||
|
Merged with pngvalid.c from libpng-1.7 changes to create a single
|
||||||
|
pngvalid.c
|
||||||
|
Removed #error macro from contrib/tools/pngfix.c (Thomas Klausner).
|
||||||
|
Merged pngrio.c, pngtrans.c, pngwio.c, and pngerror.c with libpng-1.7.0
|
||||||
|
Merged libpng-1.7.0 changes to make no-interlace configurations work
|
||||||
|
with test programs.
|
||||||
|
Revised pngvalid.c to support libpng 1.5, which does not support the
|
||||||
|
PNG_MAXIMUM_INFLATE_WINDOW option, so #define it out when appropriate in
|
||||||
|
pngvalid.c
|
||||||
|
Allow unversioned links created on install to be disabled in configure.
|
||||||
|
In configure builds 'make install' changes/adds links like png.h
|
||||||
|
and libpng.a to point to the newly installed, versioned, files (e.g.
|
||||||
|
libpng17/png.h and libpng17.a). Three new configure options and some
|
||||||
|
rearrangement of Makefile.am allow creation of these links to be disabled.
|
||||||
|
|
||||||
|
Version 1.6.9beta03 [January 10, 2014]
|
||||||
|
Removed potentially misleading warning from png_check_IHDR().
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ enable_testing()
|
|||||||
|
|
||||||
set(PNGLIB_MAJOR 1)
|
set(PNGLIB_MAJOR 1)
|
||||||
set(PNGLIB_MINOR 6)
|
set(PNGLIB_MINOR 6)
|
||||||
set(PNGLIB_RELEASE 8)
|
set(PNGLIB_RELEASE 9)
|
||||||
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
|
||||||
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
|
||||||
|
|
||||||
@@ -252,7 +252,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
|
|||||||
# SET UP LINKS
|
# SET UP LINKS
|
||||||
if(PNG_SHARED)
|
if(PNG_SHARED)
|
||||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||||
# VERSION 16.${PNGLIB_RELEASE}.1.6.8
|
# VERSION 16.${PNGLIB_RELEASE}.1.6.9beta03
|
||||||
VERSION 16.${PNGLIB_RELEASE}.0
|
VERSION 16.${PNGLIB_RELEASE}.0
|
||||||
SOVERSION 16
|
SOVERSION 16
|
||||||
CLEAN_DIRECT_OUTPUT 1)
|
CLEAN_DIRECT_OUTPUT 1)
|
||||||
|
|||||||
6
LICENSE
6
LICENSE
@@ -10,8 +10,8 @@ this sentence.
|
|||||||
|
|
||||||
This code is released under the libpng license.
|
This code is released under the libpng license.
|
||||||
|
|
||||||
libpng versions 1.2.6, August 15, 2004, through 1.6.8, December 19, 2013, are
|
libpng versions 1.2.6, August 15, 2004, through 1.6.9beta03, January 10, 2014, are
|
||||||
Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
|
||||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
with the following individual added to the list of Contributing Authors
|
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
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
December 19, 2013
|
January 10, 2014
|
||||||
|
|||||||
99
Makefile.am
99
Makefile.am
@@ -81,7 +81,7 @@ libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES = png.c pngerror.c\
|
|||||||
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
|
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h pngusr.dfa
|
||||||
|
|
||||||
if PNG_ARM_NEON
|
if PNG_ARM_NEON
|
||||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_SOURCES += arm/arm_init.c\
|
||||||
arm/filter_neon.S arm/filter_neon_intrinsics.c
|
arm/filter_neon.S arm/filter_neon_intrinsics.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -287,43 +287,74 @@ check: scripts/symbols.chk
|
|||||||
dist-hook:
|
dist-hook:
|
||||||
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
|
cd '$(top_distdir)'; rm -f $(SCRIPT_CLEANFILES)
|
||||||
|
|
||||||
# install the .../include headers as links to the new ones
|
# Make links between installed files with release-specific names and the generic
|
||||||
install-data-hook:
|
# file names. If this install rule is run the generic names will be deleted and
|
||||||
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
|
# recreated - this has obvious issues for systems with multiple installations.
|
||||||
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)/pnglibconf.h \
|
|
||||||
pnglibconf.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 libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ to be used
|
install-header-links:
|
||||||
install-exec-hook:
|
@set -ex; cd '$(DESTDIR)$(includedir)'; for f in $(HEADERS); do \
|
||||||
cd '$(DESTDIR)$(bindir)'; rm -f libpng-config
|
rm -f "$$f"; $(LN_S) "$(PNGLIB_BASENAME)/$$f" "$$f"; done
|
||||||
cd '$(DESTDIR)$(bindir)';\
|
|
||||||
$(LN_S) $(PNGLIB_BASENAME)-config libpng-config
|
uninstall-header-links:
|
||||||
@set -x;\
|
cd '$(DESTDIR)$(includedir)'; rm -f $(HEADERS)
|
||||||
cd '$(DESTDIR)$(libdir)';\
|
|
||||||
for ext in a la so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@\
|
install-libpng-pc:
|
||||||
sl dylib dll.a; do\
|
@set -ex; cd '$(DESTDIR)$(pkgconfigdir)'; rm -f libpng.pc; \
|
||||||
rm -f libpng.$$ext;\
|
$(LN_S) '$(PNGLIB_BASENAME).pc' libpng.pc
|
||||||
if test -f $(PNGLIB_BASENAME).$$ext; then\
|
|
||||||
$(LN_S) $(PNGLIB_BASENAME).$$ext libpng.$$ext;\
|
uninstall-libpng-pc:
|
||||||
fi;\
|
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
|
||||||
|
|
||||||
|
# EXT_LIST is a list of the possibly library directory extensions, this exists
|
||||||
|
# because we can't find a good way of discovering the file extensions that are
|
||||||
|
# actually installed on a given system, so instead we check for every extension
|
||||||
|
# we have seen.
|
||||||
|
|
||||||
|
EXT_LIST = a dll.a so so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@ la sl dylib
|
||||||
|
|
||||||
|
install-library-links:
|
||||||
|
@set -x; cd '$(DESTDIR)$(libdir)';\
|
||||||
|
for ext in $(EXT_LIST); do\
|
||||||
|
rm -f "libpng.$$ext";\
|
||||||
|
if test -f "$(PNGLIB_BASENAME).$$ext"; then\
|
||||||
|
$(LN_S) "$(PNGLIB_BASENAME).$$ext" "libpng.$$ext" || exit 1;\
|
||||||
|
fi;\
|
||||||
done
|
done
|
||||||
|
|
||||||
uninstall-hook:
|
uninstall-library-links:
|
||||||
cd '$(DESTDIR)$(includedir)'; rm -f png.h pngconf.h pnglibconf.h
|
@set -x; cd '$(DESTDIR)$(libdir)'; for ext in $(EXT_LIST); do\
|
||||||
rm -f '$(DESTDIR)$(pkgconfigdir)/libpng.pc'
|
rm -f "libpng.$$ext"; done
|
||||||
|
|
||||||
|
install-libpng-config:
|
||||||
|
@set -ex; cd '$(DESTDIR)$(bindir)'; rm -f libpng-config; \
|
||||||
|
$(LN_S) '$(PNGLIB_BASENAME)-config' libpng-config
|
||||||
|
|
||||||
|
uninstall-libpng-config:
|
||||||
rm -f '$(DESTDIR)$(bindir)/libpng-config'
|
rm -f '$(DESTDIR)$(bindir)/libpng-config'
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.a'
|
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.la'
|
if DO_INSTALL_LINKS
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.so'
|
# If --enable-unversioned-links is specified the header and lib file links
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.so.@PNGLIB_MAJOR@@PNGLIB_MINOR@.@PNGLIB_RELEASE@'
|
# will be automatically made on a 'make install':
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.sl'
|
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.dylib'
|
install-data-hook: install-header-links
|
||||||
rm -f '$(DESTDIR)$(libdir)/libpng.dll.a'
|
uninstall-hook: uninstall-header-links
|
||||||
|
install-exec-hook: install-library-links
|
||||||
|
uninstall-hook: uninstall-library-links
|
||||||
|
endif
|
||||||
|
|
||||||
|
if DO_INSTALL_LIBPNG_PC
|
||||||
|
# Likewise, --install-pc causes libpng.pc to be constructed:
|
||||||
|
|
||||||
|
install-data-hook: install-libpng-pc
|
||||||
|
uninstall-hook: uninstall-libpng-pc
|
||||||
|
endif
|
||||||
|
|
||||||
|
if DO_INSTALL_LIBPNG_CONFIG
|
||||||
|
# And --install-config:
|
||||||
|
|
||||||
|
install-exec-hook: install-libpng-config
|
||||||
|
uninstall-hook: uninstall-libpng-config
|
||||||
|
endif
|
||||||
|
|
||||||
# The following addition ensures that 'make all' always builds the test programs
|
# The following addition ensures that 'make all' always builds the test programs
|
||||||
# too. It used to, but some change either in libpng or configure stopped this
|
# too. It used to, but some change either in libpng or configure stopped this
|
||||||
|
|||||||
4
README
4
README
@@ -1,4 +1,4 @@
|
|||||||
README for libpng version 1.6.8 - December 19, 2013 (shared library 16.0)
|
README for libpng version 1.6.9beta03 - January 10, 2014 (shared library 16.0)
|
||||||
See the note about version numbers near the top of png.h
|
See the note about version numbers near the top of png.h
|
||||||
|
|
||||||
See INSTALL for instructions on how to install libpng.
|
See INSTALL for instructions on how to install libpng.
|
||||||
@@ -121,7 +121,7 @@ and ...". If in doubt, send questions to me. I'll bounce them
|
|||||||
to others, if necessary.
|
to others, if necessary.
|
||||||
|
|
||||||
Please do not send suggestions on how to change PNG. We have
|
Please do not send suggestions on how to change PNG. We have
|
||||||
been discussing PNG for eighteen years now, and it is official and
|
been discussing PNG for nineteen years now, and it is official and
|
||||||
finished. If you have suggestions for libpng, however, I'll
|
finished. If you have suggestions for libpng, however, I'll
|
||||||
gladly listen. Even if your suggestion is not used immediately,
|
gladly listen. Even if your suggestion is not used immediately,
|
||||||
it may be used later.
|
it may be used later.
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ safe_read(png_structp png_ptr, int fd, void *buffer_in, size_t nbytes)
|
|||||||
if (errno != EINTR)
|
if (errno != EINTR)
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "/proc read failed");
|
png_warning(png_ptr, "/proc read failed");
|
||||||
return 0; /* I.e. a permanent failure */
|
return 0; /* I.e., a permanent failure */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
/* libpng row pointers are not necessarily aligned to any particular boundary,
|
/* libpng row pointers are not necessarily aligned to any particular boundary,
|
||||||
* however this code will only work with appropriate alignment. arm/arm_init.c
|
* however this code will only work with appropriate alignment. arm/arm_init.c
|
||||||
* checks for this (and will not compile unless it is done), this code uses
|
* checks for this (and will not compile unless it is done). This code uses
|
||||||
* variants of png_aligncast to avoid compiler warnings.
|
* variants of png_aligncast to avoid compiler warnings.
|
||||||
*/
|
*/
|
||||||
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
|
#define png_ptr(type,pointer) png_aligncast(type *,pointer)
|
||||||
|
|||||||
45
configure.ac
45
configure.ac
@@ -18,7 +18,7 @@ AC_PREREQ([2.68])
|
|||||||
|
|
||||||
dnl Version number stuff here:
|
dnl Version number stuff here:
|
||||||
|
|
||||||
AC_INIT([libpng],[1.6.8],[png-mng-implement@lists.sourceforge.net])
|
AC_INIT([libpng],[1.6.9beta03],[png-mng-implement@lists.sourceforge.net])
|
||||||
AC_CONFIG_MACRO_DIR([scripts])
|
AC_CONFIG_MACRO_DIR([scripts])
|
||||||
|
|
||||||
# libpng does not follow GNU file name conventions (hence 'foreign')
|
# libpng does not follow GNU file name conventions (hence 'foreign')
|
||||||
@@ -39,10 +39,10 @@ dnl automake, so the following is not necessary (and is not defined anyway):
|
|||||||
dnl AM_PREREQ([1.11.2])
|
dnl AM_PREREQ([1.11.2])
|
||||||
dnl stop configure from automagically running automake
|
dnl stop configure from automagically running automake
|
||||||
|
|
||||||
PNGLIB_VERSION=1.6.8
|
PNGLIB_VERSION=1.6.9beta03
|
||||||
PNGLIB_MAJOR=1
|
PNGLIB_MAJOR=1
|
||||||
PNGLIB_MINOR=6
|
PNGLIB_MINOR=6
|
||||||
PNGLIB_RELEASE=8
|
PNGLIB_RELEASE=9
|
||||||
|
|
||||||
dnl End of version number stuff
|
dnl End of version number stuff
|
||||||
|
|
||||||
@@ -226,6 +226,45 @@ AC_ARG_WITH(libpng-prefix,
|
|||||||
fi])
|
fi])
|
||||||
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
AM_CONDITIONAL([DO_PNG_PREFIX], [test "${with_libpng_prefix:-no}" != "no"])
|
||||||
|
|
||||||
|
# Control over what links are made for installed files. Versioned files are
|
||||||
|
# always installed, when the following options are turned on corresponding
|
||||||
|
# unversioned links are also created (normally as symbolic links):
|
||||||
|
AC_ARG_ENABLE([unversioned-links],
|
||||||
|
AS_HELP_STRING([[[--enable-unversioned-links]]],
|
||||||
|
[Installed libpng header files are placed in a versioned subdirectory]
|
||||||
|
[and installed libpng library (including DLL) files are versioned.]
|
||||||
|
[If this option is enabled unversioned links will be created pointing to]
|
||||||
|
[the corresponding installed files. If you use libpng.pc or]
|
||||||
|
[libpng-config for all builds you do not need these links, but if you]
|
||||||
|
[compile programs directly they will typically #include <png.h> and]
|
||||||
|
[link with -lpng; in that case you need the links.]
|
||||||
|
[The links can be installed manually using 'make install-header-links']
|
||||||
|
[and 'make install-library-links' and can be removed using the]
|
||||||
|
[corresponding uninstall- targets. If you do enable this option every]
|
||||||
|
[libpng 'make install' will recreate the links to point to the just]
|
||||||
|
[installed version of libpng. The default is to create the links;]
|
||||||
|
[use --disable-unversioned-links to change this]))
|
||||||
|
|
||||||
|
# The AM_CONDITIONAL test is written so that the default is enabled;
|
||||||
|
# --disable-unversioned-links must be given to turn the option off.
|
||||||
|
AM_CONDITIONAL([DO_INSTALL_LINKS],[test "$enable_unversioned_links" != "no"])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([unversioned-libpng-pc],
|
||||||
|
AS_HELP_STRING([[[--enable-unversioned-libpng-pc]]],
|
||||||
|
[Install the configuration file 'libpng.pc' as a link to the versioned]
|
||||||
|
[version. This is done by default - use --disable-unversioned-libpng-pc]
|
||||||
|
[to change this.]))
|
||||||
|
AM_CONDITIONAL([DO_INSTALL_LIBPNG_PC],
|
||||||
|
[test "$enable_unversioned_libpng_pc" != "no"])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([unversioned-libpng-config],
|
||||||
|
AS_HELP_STRING([[[--enable-unversioned-libpng-config]]],
|
||||||
|
[Install the configuration file 'libpng-config' as a link to the]
|
||||||
|
[versioned version. This is done by default - use]
|
||||||
|
[--disable-unversioned-libpng-config to change this.]))
|
||||||
|
AM_CONDITIONAL([DO_INSTALL_LIBPNG_CONFIG],
|
||||||
|
[test "$enable_unversioned_libpng_config" != "no"])
|
||||||
|
|
||||||
# HOST SPECIFIC OPTIONS
|
# HOST SPECIFIC OPTIONS
|
||||||
# =====================
|
# =====================
|
||||||
#
|
#
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
/* pngfix.c
|
/* pngfix.c
|
||||||
*
|
*
|
||||||
* Copyright (c) 2013 John Cunningham Bowler
|
* Copyright (c) 2014 John Cunningham Bowler
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
@@ -32,7 +32,6 @@
|
|||||||
# define FIX_GCC volatile
|
# define FIX_GCC volatile
|
||||||
#else
|
#else
|
||||||
# define FIX_GCC
|
# define FIX_GCC
|
||||||
# error not tested
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PROGRAM_NAME "pngfix"
|
#define PROGRAM_NAME "pngfix"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
libpng-manual.txt - A description on how to use and modify libpng
|
libpng-manual.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.6.8 - December 19, 2013
|
libpng version 1.6.9beta03 - January 10, 2014
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp at users.sourceforge.net>
|
<glennrp at users.sourceforge.net>
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
@@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||||||
|
|
||||||
Based on:
|
Based on:
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.6.8 - December 19, 2013
|
libpng versions 0.97, January 1998, through 1.6.9beta03 - January 10, 2014
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
|
|
||||||
@@ -4621,6 +4621,7 @@ XI. Changes to Libpng from version 1.4.x to 1.5.x
|
|||||||
|
|
||||||
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||||
function) incorrectly returned a value of type png_uint_32.
|
function) incorrectly returned a value of type png_uint_32.
|
||||||
|
The incorrect macro was removed from libpng-1.4.5.
|
||||||
|
|
||||||
Checking for invalid palette index on write was added at libpng
|
Checking for invalid palette index on write was added at libpng
|
||||||
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
|
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
|
||||||
@@ -4745,11 +4746,6 @@ reset by pngusr.h or by explicit settings on the compiler command line.
|
|||||||
These settings may produce compiler warnings or errors in 1.5.0 because
|
These settings may produce compiler warnings or errors in 1.5.0 because
|
||||||
of macro redefinition.
|
of macro redefinition.
|
||||||
|
|
||||||
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
|
||||||
function) incorrectly returned a value of type png_uint_32. libpng 1.5.0
|
|
||||||
is consistent with the implementation in 1.4.5 and 1.2.x (where the macro
|
|
||||||
did not exist.)
|
|
||||||
|
|
||||||
Applications can now choose whether to use these macros or to call the
|
Applications can now choose whether to use these macros or to call the
|
||||||
corresponding function by defining PNG_USE_READ_MACROS or
|
corresponding function by defining PNG_USE_READ_MACROS or
|
||||||
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
||||||
@@ -4767,7 +4763,10 @@ option was off by default, and slightly inaccurate scaling occurred.
|
|||||||
This option can no longer be turned off, and the choice of accurate
|
This option can no longer be turned off, and the choice of accurate
|
||||||
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
|
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
|
||||||
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
|
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
|
||||||
chopping.
|
chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
|
macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8
|
||||||
|
macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two
|
||||||
|
png_set_*_16_to_8() functions separately.
|
||||||
|
|
||||||
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
|
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
|
||||||
used to reduce the width and height limits from the value of
|
used to reduce the width and height limits from the value of
|
||||||
@@ -5233,13 +5232,13 @@ Other rules can be inferred by inspecting the libpng source.
|
|||||||
|
|
||||||
XVI. Y2K Compliance in libpng
|
XVI. Y2K Compliance in libpng
|
||||||
|
|
||||||
December 19, 2013
|
January 10, 2014
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.6.8 are Y2K compliant. It is my belief that earlier
|
upward through 1.6.9beta03 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has two year fields. One is a 2-byte unsigned integer
|
Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||||
|
|||||||
30
libpng.3
30
libpng.3
@@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNG 3 "December 19, 2013"
|
.TH LIBPNG 3 "January 10, 2014"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.8
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.9beta03
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB
|
\fB
|
||||||
#include <png.h>\fP
|
#include <png.h>\fP
|
||||||
@@ -504,7 +504,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
|||||||
.SH LIBPNG.TXT
|
.SH LIBPNG.TXT
|
||||||
libpng-manual.txt - A description on how to use and modify libpng
|
libpng-manual.txt - A description on how to use and modify libpng
|
||||||
|
|
||||||
libpng version 1.6.8 - December 19, 2013
|
libpng version 1.6.9beta03 - January 10, 2014
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
<glennrp at users.sourceforge.net>
|
<glennrp at users.sourceforge.net>
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
@@ -515,7 +515,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
|||||||
|
|
||||||
Based on:
|
Based on:
|
||||||
|
|
||||||
libpng versions 0.97, January 1998, through 1.6.8 - December 19, 2013
|
libpng versions 0.97, January 1998, through 1.6.9beta03 - January 10, 2014
|
||||||
Updated and distributed by Glenn Randers-Pehrson
|
Updated and distributed by Glenn Randers-Pehrson
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
|
|
||||||
@@ -5126,6 +5126,7 @@ We removed the trailing '.' from the warning and error messages.
|
|||||||
|
|
||||||
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||||
function) incorrectly returned a value of type png_uint_32.
|
function) incorrectly returned a value of type png_uint_32.
|
||||||
|
The incorrect macro was removed from libpng-1.4.5.
|
||||||
|
|
||||||
Checking for invalid palette index on write was added at libpng
|
Checking for invalid palette index on write was added at libpng
|
||||||
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
|
1.5.10. If a pixel contains an invalid (out-of-range) index libpng issues
|
||||||
@@ -5250,11 +5251,6 @@ reset by pngusr.h or by explicit settings on the compiler command line.
|
|||||||
These settings may produce compiler warnings or errors in 1.5.0 because
|
These settings may produce compiler warnings or errors in 1.5.0 because
|
||||||
of macro redefinition.
|
of macro redefinition.
|
||||||
|
|
||||||
From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
|
||||||
function) incorrectly returned a value of type png_uint_32. libpng 1.5.0
|
|
||||||
is consistent with the implementation in 1.4.5 and 1.2.x (where the macro
|
|
||||||
did not exist.)
|
|
||||||
|
|
||||||
Applications can now choose whether to use these macros or to call the
|
Applications can now choose whether to use these macros or to call the
|
||||||
corresponding function by defining PNG_USE_READ_MACROS or
|
corresponding function by defining PNG_USE_READ_MACROS or
|
||||||
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
||||||
@@ -5272,7 +5268,10 @@ option was off by default, and slightly inaccurate scaling occurred.
|
|||||||
This option can no longer be turned off, and the choice of accurate
|
This option can no longer be turned off, and the choice of accurate
|
||||||
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
|
or inaccurate 16-to-8 scaling is by using the new png_set_scale_16_to_8()
|
||||||
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
|
API for accurate scaling or the old png_set_strip_16_to_8() API for simple
|
||||||
chopping.
|
chopping. In libpng-1.5.4, the PNG_READ_16_TO_8_ACCURATE_SCALE_SUPPORTED
|
||||||
|
macro became PNG_READ_SCALE_16_TO_8_SUPPORTED, and the PNG_READ_16_TO_8
|
||||||
|
macro became PNG_READ_STRIP_16_TO_8_SUPPORTED, to enable the two
|
||||||
|
png_set_*_16_to_8() functions separately.
|
||||||
|
|
||||||
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
|
Prior to libpng-1.5.4, the png_set_user_limits() function could only be
|
||||||
used to reduce the width and height limits from the value of
|
used to reduce the width and height limits from the value of
|
||||||
@@ -5738,13 +5737,13 @@ Other rules can be inferred by inspecting the libpng source.
|
|||||||
|
|
||||||
.SH XVI. Y2K Compliance in libpng
|
.SH XVI. Y2K Compliance in libpng
|
||||||
|
|
||||||
December 19, 2013
|
January 10, 2014
|
||||||
|
|
||||||
Since the PNG Development group is an ad-hoc body, we can't make
|
Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
an official declaration.
|
an official declaration.
|
||||||
|
|
||||||
This is your unofficial assurance that libpng from version 0.71 and
|
This is your unofficial assurance that libpng from version 0.71 and
|
||||||
upward through 1.6.8 are Y2K compliant. It is my belief that earlier
|
upward through 1.6.9beta03 are Y2K compliant. It is my belief that earlier
|
||||||
versions were also Y2K compliant.
|
versions were also Y2K compliant.
|
||||||
|
|
||||||
Libpng only has two year fields. One is a 2-byte unsigned integer
|
Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||||
@@ -5972,6 +5971,7 @@ the first widely used release:
|
|||||||
1.6.8beta01-02 16 10608 16.so.16.8[.0]
|
1.6.8beta01-02 16 10608 16.so.16.8[.0]
|
||||||
1.6.8rc01-02 16 10608 16.so.16.8[.0]
|
1.6.8rc01-02 16 10608 16.so.16.8[.0]
|
||||||
1.6.8 16 10608 16.so.16.8[.0]
|
1.6.8 16 10608 16.so.16.8[.0]
|
||||||
|
1.6.8beta01-03 16 10609 16.so.16.9[.0]
|
||||||
|
|
||||||
Henceforth the source version will match the shared-library minor
|
Henceforth the source version will match the shared-library minor
|
||||||
and patch numbers; the shared-library major version number will be
|
and patch numbers; the shared-library major version number will be
|
||||||
@@ -6028,7 +6028,7 @@ possible without all of you.
|
|||||||
|
|
||||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||||
|
|
||||||
Libpng version 1.6.8 - December 19, 2013:
|
Libpng version 1.6.9beta03 - January 10, 2014:
|
||||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||||
|
|
||||||
@@ -6051,7 +6051,7 @@ this sentence.
|
|||||||
|
|
||||||
This code is released under the libpng license.
|
This code is released under the libpng license.
|
||||||
|
|
||||||
libpng versions 1.2.6, August 15, 2004, through 1.6.8, December 19, 2013, are
|
libpng versions 1.2.6, August 15, 2004, through 1.6.9beta03, January 10, 2014, are
|
||||||
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
||||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
with the following individual added to the list of Contributing Authors
|
with the following individual added to the list of Contributing Authors
|
||||||
@@ -6150,7 +6150,7 @@ certification mark of the Open Source Initiative.
|
|||||||
|
|
||||||
Glenn Randers-Pehrson
|
Glenn Randers-Pehrson
|
||||||
glennrp at users.sourceforge.net
|
glennrp at users.sourceforge.net
|
||||||
December 19, 2013
|
January 10, 2014
|
||||||
|
|
||||||
.\" end of man page
|
.\" end of man page
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.TH LIBPNGPF 3 "December 19, 2013"
|
.TH LIBPNGPF 3 "January 10, 2014"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.8
|
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.9beta03
|
||||||
(private functions)
|
(private functions)
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fB#include \fI"pngpriv.h"
|
\fB#include \fI"pngpriv.h"
|
||||||
|
|||||||
2
png.5
2
png.5
@@ -1,4 +1,4 @@
|
|||||||
.TH PNG 5 "December 19, 2013"
|
.TH PNG 5 "January 10, 2014"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
png \- Portable Network Graphics (PNG) format
|
png \- Portable Network Graphics (PNG) format
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
|||||||
79
png.c
79
png.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "pngpriv.h"
|
#include "pngpriv.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef png_libpng_version_1_6_8 Your_png_h_is_not_version_1_6_8;
|
typedef png_libpng_version_1_6_9beta03 Your_png_h_is_not_version_1_6_9beta03;
|
||||||
|
|
||||||
/* Tells libpng that we have already handled the first "num_bytes" bytes
|
/* 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
|
* of the PNG file signature. If the PNG data is embedded into another
|
||||||
@@ -773,14 +773,14 @@ png_get_copyright(png_const_structrp png_ptr)
|
|||||||
#else
|
#else
|
||||||
# ifdef __STDC__
|
# ifdef __STDC__
|
||||||
return PNG_STRING_NEWLINE \
|
return PNG_STRING_NEWLINE \
|
||||||
"libpng version 1.6.8 - December 19, 2013" PNG_STRING_NEWLINE \
|
"libpng version 1.6.9beta03 - January 10, 2014" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
"Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE;
|
PNG_STRING_NEWLINE;
|
||||||
# else
|
# else
|
||||||
return "libpng version 1.6.8 - December 19, 2013\
|
return "libpng version 1.6.9beta03 - January 10, 2014\
|
||||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
|
Copyright (c) 1998-2014 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||||
# endif
|
# endif
|
||||||
@@ -826,6 +826,63 @@ png_get_header_version(png_const_structrp png_ptr)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
|
||||||
|
/* NOTE: this routine is not used internally! */
|
||||||
|
/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
|
||||||
|
* large of png_color. This lets grayscale images be treated as
|
||||||
|
* paletted. Most useful for gamma correction and simplification
|
||||||
|
* of code. This API is not used internally.
|
||||||
|
*/
|
||||||
|
void PNGAPI
|
||||||
|
png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
||||||
|
{
|
||||||
|
int num_palette;
|
||||||
|
int color_inc;
|
||||||
|
int i;
|
||||||
|
int v;
|
||||||
|
|
||||||
|
png_debug(1, "in png_do_build_grayscale_palette");
|
||||||
|
|
||||||
|
if (palette == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (bit_depth)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
num_palette = 2;
|
||||||
|
color_inc = 0xff;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
num_palette = 4;
|
||||||
|
color_inc = 0x55;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
num_palette = 16;
|
||||||
|
color_inc = 0x11;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
num_palette = 256;
|
||||||
|
color_inc = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
num_palette = 0;
|
||||||
|
color_inc = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
|
||||||
|
{
|
||||||
|
palette[i].red = (png_byte)v;
|
||||||
|
palette[i].green = (png_byte)v;
|
||||||
|
palette[i].blue = (png_byte)v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
|
#ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED
|
||||||
int PNGAPI
|
int PNGAPI
|
||||||
png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
|
png_handle_as_unknown(png_const_structrp png_ptr, png_const_bytep chunk_name)
|
||||||
@@ -2416,14 +2473,6 @@ png_check_IHDR(png_const_structrp png_ptr,
|
|||||||
error = 1;
|
error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width > (PNG_UINT_32_MAX
|
|
||||||
>> 3) /* 8-byte RGBA pixels */
|
|
||||||
- 48 /* bigrowbuf hack */
|
|
||||||
- 1 /* filter byte */
|
|
||||||
- 7*8 /* rounding of width to multiple of 8 pixels */
|
|
||||||
- 8) /* extra max_pixel_depth pad */
|
|
||||||
png_warning(png_ptr, "Width is too large for libpng to process pixels");
|
|
||||||
|
|
||||||
/* Check other values */
|
/* Check other values */
|
||||||
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
if (bit_depth != 1 && bit_depth != 2 && bit_depth != 4 &&
|
||||||
bit_depth != 8 && bit_depth != 16)
|
bit_depth != 8 && bit_depth != 16)
|
||||||
|
|||||||
25
png.h
25
png.h
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* libpng version 1.6.8 - December 19, 2013
|
* libpng version 1.6.9beta03 - January 10, 2014
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||||
* libpng versions 0.97, January 1998, through 1.6.8 - December 19, 2013: Glenn
|
* libpng versions 0.97, January 1998, through 1.6.9beta03 - January 10, 2014: Glenn
|
||||||
* See also "Contributing Authors", below.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
@@ -189,6 +189,7 @@
|
|||||||
* 1.6.8beta01-02 16 10608 16.so.16.8[.0]
|
* 1.6.8beta01-02 16 10608 16.so.16.8[.0]
|
||||||
* 1.6.8rc01-02 16 10608 16.so.16.8[.0]
|
* 1.6.8rc01-02 16 10608 16.so.16.8[.0]
|
||||||
* 1.6.8 16 10608 16.so.16.8[.0]
|
* 1.6.8 16 10608 16.so.16.8[.0]
|
||||||
|
* 1.6.9beta01-03 16 10609 16.so.16.9[.0]
|
||||||
*
|
*
|
||||||
* Henceforth the source version will match the shared-library major
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* and minor numbers; the shared-library major version number will be
|
||||||
@@ -220,7 +221,7 @@
|
|||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
*
|
*
|
||||||
* libpng versions 1.2.6, August 15, 2004, through 1.6.8, December 19, 2013, are
|
* libpng versions 1.2.6, August 15, 2004, through 1.6.9beta03, January 10, 2014, are
|
||||||
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individual added to the list of Contributing Authors:
|
* with the following individual added to the list of Contributing Authors:
|
||||||
@@ -332,13 +333,13 @@
|
|||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* December 19, 2013
|
* January 10, 2014
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* This is your unofficial assurance that libpng from version 0.71 and
|
||||||
* upward through 1.6.8 are Y2K compliant. It is my belief that
|
* upward through 1.6.9beta03 are Y2K compliant. It is my belief that
|
||||||
* earlier versions were also Y2K compliant.
|
* earlier versions were also Y2K compliant.
|
||||||
*
|
*
|
||||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||||
@@ -398,9 +399,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Version information for png.h - this should match the version in png.c */
|
/* Version information for png.h - this should match the version in png.c */
|
||||||
#define PNG_LIBPNG_VER_STRING "1.6.8"
|
#define PNG_LIBPNG_VER_STRING "1.6.9beta03"
|
||||||
#define PNG_HEADER_VERSION_STRING \
|
#define PNG_HEADER_VERSION_STRING \
|
||||||
" libpng version 1.6.8 - December 19, 2013\n"
|
" libpng version 1.6.9beta03 - January 10, 2014\n"
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_SONUM 16
|
#define PNG_LIBPNG_VER_SONUM 16
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||||
@@ -408,13 +409,13 @@
|
|||||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||||
#define PNG_LIBPNG_VER_MAJOR 1
|
#define PNG_LIBPNG_VER_MAJOR 1
|
||||||
#define PNG_LIBPNG_VER_MINOR 6
|
#define PNG_LIBPNG_VER_MINOR 6
|
||||||
#define PNG_LIBPNG_VER_RELEASE 8
|
#define PNG_LIBPNG_VER_RELEASE 9
|
||||||
|
|
||||||
/* This should match the numeric part of the final component of
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define PNG_LIBPNG_VER_BUILD 0
|
#define PNG_LIBPNG_VER_BUILD 03
|
||||||
|
|
||||||
/* Release Status */
|
/* Release Status */
|
||||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||||
@@ -431,7 +432,7 @@
|
|||||||
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
||||||
PNG_LIBPNG_BUILD_PRIVATE */
|
PNG_LIBPNG_BUILD_PRIVATE */
|
||||||
|
|
||||||
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE
|
#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA
|
||||||
|
|
||||||
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||||
* We must not include leading zeros.
|
* We must not include leading zeros.
|
||||||
@@ -439,7 +440,7 @@
|
|||||||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
||||||
*/
|
*/
|
||||||
#define PNG_LIBPNG_VER 10608 /* 1.6.8 */
|
#define PNG_LIBPNG_VER 10609 /* 1.6.9 */
|
||||||
|
|
||||||
/* Library configuration: these options cannot be changed after
|
/* Library configuration: these options cannot be changed after
|
||||||
* the library has been built.
|
* the library has been built.
|
||||||
@@ -544,7 +545,7 @@ extern "C" {
|
|||||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||||
* do not agree upon the version number.
|
* do not agree upon the version number.
|
||||||
*/
|
*/
|
||||||
typedef char* png_libpng_version_1_6_8;
|
typedef char* png_libpng_version_1_6_9beta03;
|
||||||
|
|
||||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* pngconf.h - machine configurable file for libpng
|
||||||
*
|
*
|
||||||
* libpng version 1.6.8 - December 19, 2013
|
* libpng version 1.6.9beta03 - January 10, 2014
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
|
|||||||
@@ -761,7 +761,12 @@ png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
|
|||||||
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
|
png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Here if not setjmp support or if png_ptr is null. */
|
/* If control reaches this point, png_longjmp() must not return. The only
|
||||||
|
* choice is to terminate the whole process (or maybe the thread); to do
|
||||||
|
* this the ANSI-C abort() function is used unless a different method is
|
||||||
|
* implemented by overriding the default configuration setting for
|
||||||
|
* PNG_ABORT().
|
||||||
|
*/
|
||||||
PNG_ABORT();
|
PNG_ABORT();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
120
pngpriv.h
120
pngpriv.h
@@ -2,11 +2,11 @@
|
|||||||
/* pngpriv.h - private declarations for use inside libpng
|
/* pngpriv.h - private declarations for use inside libpng
|
||||||
*
|
*
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* For conditions of distribution and use, see copyright notice in png.h
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
*
|
*
|
||||||
* This code is released under the libpng license.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
/* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
|
/* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
|
||||||
* if possible - if __ARM_NEON__ is set and the compiler version is not known
|
* if possible - if __ARM_NEON__ is set and the compiler version is not known
|
||||||
* to be broken. This is control by PNG_ARM_NEON_IMPLEMENTATION which can
|
* to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
|
||||||
* be:
|
* be:
|
||||||
*
|
*
|
||||||
* 1 The intrinsics code (the default with __ARM_NEON__)
|
* 1 The intrinsics code (the default with __ARM_NEON__)
|
||||||
@@ -1235,32 +1235,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr,
|
|||||||
png_inforp info_ptr),PNG_EMPTY);
|
png_inforp info_ptr),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These are the functions that do the transformations */
|
/* Shared transform functions, defined in pngtran.c */
|
||||||
#ifdef PNG_READ_FILLER_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_read_filler,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_uint_32 filler, png_uint_32 flags),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_read_swap_alpha,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_write_swap_alpha,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_read_invert_alpha,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_write_invert_alpha,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
|
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
|
||||||
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info,
|
PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info,
|
||||||
@@ -1280,96 +1255,16 @@ PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info,
|
|||||||
png_bytep row),PNG_EMPTY);
|
png_bytep row),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(int,png_do_rgb_to_gray,(png_structrp png_ptr,
|
|
||||||
png_row_infop row_info, png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_gray_to_rgb,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_PACK_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_unpack,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_unshift,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_const_color_8p sig_bits),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
|
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info,
|
PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info,
|
||||||
png_bytep row),PNG_EMPTY);
|
png_bytep row),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_scale_16_to_8,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_chop,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_quantize,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_const_bytep palette_lookup,
|
|
||||||
png_const_bytep quantize_lookup),PNG_EMPTY);
|
|
||||||
|
|
||||||
# ifdef PNG_CORRECT_PALETTE_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_correct_palette,(png_structrp png_ptr,
|
|
||||||
png_colorp palette, int num_palette),PNG_EMPTY);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
|
#if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED)
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info,
|
PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info,
|
||||||
png_bytep row),PNG_EMPTY);
|
png_bytep row),PNG_EMPTY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_pack,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_uint_32 bit_depth),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_shift,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_const_color_8p bit_depth),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
|
||||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_compose,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_gamma,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_encode_alpha,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_structrp png_ptr),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_expand_palette,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_const_colorp palette, png_const_bytep trans,
|
|
||||||
int num_trans),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_expand,(png_row_infop row_info,
|
|
||||||
png_bytep row, png_const_color_16p trans_color),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_expand_16,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following decodes the appropriate chunks, and does error correction,
|
/* The following decodes the appropriate chunks, and does error correction,
|
||||||
* then calls the appropriate callback for the chunk if it is valid.
|
* then calls the appropriate callback for the chunk if it is valid.
|
||||||
*/
|
*/
|
||||||
@@ -1556,13 +1451,6 @@ PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr,
|
|||||||
|
|
||||||
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_read_intrapixel,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
PNG_INTERNAL_FUNCTION(void,png_do_write_intrapixel,(png_row_infop row_info,
|
|
||||||
png_bytep row),PNG_EMPTY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Added at libpng version 1.6.0 */
|
/* Added at libpng version 1.6.0 */
|
||||||
#ifdef PNG_GAMMA_SUPPORTED
|
#ifdef PNG_GAMMA_SUPPORTED
|
||||||
PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
|
PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr,
|
||||||
|
|||||||
71
pngread.c
71
pngread.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -305,6 +305,72 @@ png_start_read_image(png_structrp png_ptr)
|
|||||||
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
|
#endif /* PNG_SEQUENTIAL_READ_SUPPORTED */
|
||||||
|
|
||||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
|
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
|
||||||
|
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||||
|
/* Undoes intrapixel differencing,
|
||||||
|
* NOTE: this is apparently only supported in the 'sequential' reader.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
||||||
|
{
|
||||||
|
png_debug(1, "in png_do_read_intrapixel");
|
||||||
|
|
||||||
|
if (
|
||||||
|
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||||
|
{
|
||||||
|
int bytes_per_pixel;
|
||||||
|
png_uint_32 row_width = row_info->width;
|
||||||
|
|
||||||
|
if (row_info->bit_depth == 8)
|
||||||
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_uint_32 i;
|
||||||
|
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
|
bytes_per_pixel = 3;
|
||||||
|
|
||||||
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
|
bytes_per_pixel = 4;
|
||||||
|
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||||
|
{
|
||||||
|
*(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff);
|
||||||
|
*(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (row_info->bit_depth == 16)
|
||||||
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_uint_32 i;
|
||||||
|
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
|
bytes_per_pixel = 6;
|
||||||
|
|
||||||
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
|
bytes_per_pixel = 8;
|
||||||
|
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||||
|
{
|
||||||
|
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
||||||
|
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
||||||
|
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
||||||
|
png_uint_32 red = (s0 + s1 + 65536) & 0xffff;
|
||||||
|
png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
|
||||||
|
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
||||||
|
*(rp + 1) = (png_byte)(red & 0xff);
|
||||||
|
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
|
||||||
|
*(rp + 5) = (png_byte)(blue & 0xff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
||||||
|
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
||||||
{
|
{
|
||||||
@@ -489,7 +555,6 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
||||||
if (png_ptr->transformations)
|
if (png_ptr->transformations)
|
||||||
png_do_read_transformations(png_ptr, &row_info);
|
png_do_read_transformations(png_ptr, &row_info);
|
||||||
|
|||||||
6
pngrio.c
6
pngrio.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrio.c - functions for data input
|
/* pngrio.c - functions for data input
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -102,6 +102,7 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
|
|||||||
png_ptr->read_data_fn = read_data_fn;
|
png_ptr->read_data_fn = read_data_fn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
/* It is an error to write to a read device */
|
/* It is an error to write to a read device */
|
||||||
if (png_ptr->write_data_fn != NULL)
|
if (png_ptr->write_data_fn != NULL)
|
||||||
{
|
{
|
||||||
@@ -110,6 +111,7 @@ png_set_read_fn(png_structrp png_ptr, png_voidp io_ptr,
|
|||||||
"Can't set both read_data_fn and write_data_fn in the"
|
"Can't set both read_data_fn and write_data_fn in the"
|
||||||
" same structure");
|
" same structure");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
#ifdef PNG_WRITE_FLUSH_SUPPORTED
|
||||||
png_ptr->output_flush_fn = NULL;
|
png_ptr->output_flush_fn = NULL;
|
||||||
|
|||||||
732
pngrtran.c
732
pngrtran.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -1134,7 +1134,7 @@ png_init_palette_transformations(png_structrp png_ptr)
|
|||||||
if (!input_has_alpha)
|
if (!input_has_alpha)
|
||||||
{
|
{
|
||||||
/* Any alpha means background and associative alpha processing is
|
/* Any alpha means background and associative alpha processing is
|
||||||
* required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
|
* required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
|
||||||
* and ENCODE_ALPHA are irrelevant.
|
* and ENCODE_ALPHA are irrelevant.
|
||||||
*/
|
*/
|
||||||
png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
|
png_ptr->transformations &= ~PNG_ENCODE_ALPHA;
|
||||||
@@ -1199,7 +1199,7 @@ png_init_rgb_transformations(png_structrp png_ptr)
|
|||||||
if (!input_has_alpha)
|
if (!input_has_alpha)
|
||||||
{
|
{
|
||||||
/* Any alpha means background and associative alpha processing is
|
/* Any alpha means background and associative alpha processing is
|
||||||
* required, however if the alpha is 0 or 1 throughout OPTIIMIZE_ALPHA
|
* required, however if the alpha is 0 or 1 throughout OPTIMIZE_ALPHA
|
||||||
* and ENCODE_ALPHA are irrelevant.
|
* and ENCODE_ALPHA are irrelevant.
|
||||||
*/
|
*/
|
||||||
# ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
# ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
||||||
@@ -2123,303 +2123,6 @@ defined(PNG_READ_USER_TRANSFORM_SUPPORTED)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Transform the row. The order of transformations is significant,
|
|
||||||
* and is very touchy. If you add a transformation, take care to
|
|
||||||
* decide how it fits in with the other transformations here.
|
|
||||||
*/
|
|
||||||
void /* PRIVATE */
|
|
||||||
png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
|
||||||
{
|
|
||||||
png_debug(1, "in png_do_read_transformations");
|
|
||||||
|
|
||||||
if (png_ptr->row_buf == NULL)
|
|
||||||
{
|
|
||||||
/* Prior to 1.5.4 this output row/pass where the NULL pointer is, but this
|
|
||||||
* error is incredibly rare and incredibly easy to debug without this
|
|
||||||
* information.
|
|
||||||
*/
|
|
||||||
png_error(png_ptr, "NULL row buffer");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The following is debugging; prior to 1.5.4 the code was never compiled in;
|
|
||||||
* in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro
|
|
||||||
* PNG_WARN_UNINITIALIZED_ROW removed. In 1.6 the new flag is set only for
|
|
||||||
* all transformations, however in practice the ROW_INIT always gets done on
|
|
||||||
* demand, if necessary.
|
|
||||||
*/
|
|
||||||
if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 &&
|
|
||||||
!(png_ptr->flags & PNG_FLAG_ROW_INIT))
|
|
||||||
{
|
|
||||||
/* Application has failed to call either png_read_start_image() or
|
|
||||||
* png_read_update_info() after setting transforms that expand pixels.
|
|
||||||
* This check added to libpng-1.2.19 (but not enabled until 1.5.4).
|
|
||||||
*/
|
|
||||||
png_error(png_ptr, "Uninitialized row");
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PNG_READ_EXPAND_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_EXPAND)
|
|
||||||
{
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
|
|
||||||
{
|
|
||||||
png_do_expand_palette(row_info, png_ptr->row_buf + 1,
|
|
||||||
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(row_info, png_ptr->row_buf + 1,
|
|
||||||
&(png_ptr->trans_color));
|
|
||||||
|
|
||||||
else
|
|
||||||
png_do_expand(row_info, png_ptr->row_buf + 1,
|
|
||||||
NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
|
|
||||||
if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
|
|
||||||
!(png_ptr->transformations & PNG_COMPOSE) &&
|
|
||||||
(row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
|
|
||||||
row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
|
|
||||||
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
|
||||||
0 /* at_start == false, because SWAP_ALPHA happens later */);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_RGB_TO_GRAY)
|
|
||||||
{
|
|
||||||
int rgb_error =
|
|
||||||
png_do_rgb_to_gray(png_ptr, row_info,
|
|
||||||
png_ptr->row_buf + 1);
|
|
||||||
|
|
||||||
if (rgb_error)
|
|
||||||
{
|
|
||||||
png_ptr->rgb_to_gray_status=1;
|
|
||||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
|
||||||
PNG_RGB_TO_GRAY_WARN)
|
|
||||||
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
|
||||||
|
|
||||||
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
|
||||||
PNG_RGB_TO_GRAY_ERR)
|
|
||||||
png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
|
||||||
*
|
|
||||||
* In most cases, the "simple transparency" should be done prior to doing
|
|
||||||
* gray-to-RGB, or you will have to test 3x as many bytes to check if a
|
|
||||||
* pixel is transparent. You would also need to make sure that the
|
|
||||||
* transparency information is upgraded to RGB.
|
|
||||||
*
|
|
||||||
* To summarize, the current flow is:
|
|
||||||
* - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
|
|
||||||
* with background "in place" if transparent,
|
|
||||||
* convert to RGB if necessary
|
|
||||||
* - Gray + alpha -> composite with gray background and remove alpha bytes,
|
|
||||||
* convert to RGB if necessary
|
|
||||||
*
|
|
||||||
* To support RGB backgrounds for gray images we need:
|
|
||||||
* - Gray + simple transparency -> convert to RGB + simple transparency,
|
|
||||||
* compare 3 or 6 bytes and composite with
|
|
||||||
* background "in place" if transparent
|
|
||||||
* (3x compare/pixel compared to doing
|
|
||||||
* composite with gray bkgrnd)
|
|
||||||
* - Gray + alpha -> convert to RGB + alpha, composite with background and
|
|
||||||
* remove alpha bytes (3x float
|
|
||||||
* operations/pixel compared with composite
|
|
||||||
* on gray background)
|
|
||||||
*
|
|
||||||
* Greg's change will do this. The reason it wasn't done before is for
|
|
||||||
* performance, as this increases the per-pixel operations. If we would check
|
|
||||||
* in advance if the background was gray or RGB, and position the gray-to-RGB
|
|
||||||
* transform appropriately, then it would save a lot of work/time.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
|
||||||
/* If gray -> RGB, do so now only if background is non-gray; else do later
|
|
||||||
* for performance reasons
|
|
||||||
*/
|
|
||||||
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
|
|
||||||
!(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
|
||||||
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
|
||||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
|
||||||
if (png_ptr->transformations & PNG_COMPOSE)
|
|
||||||
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
|
||||||
if ((png_ptr->transformations & PNG_GAMMA) &&
|
|
||||||
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
|
||||||
/* Because RGB_TO_GRAY does the gamma transform. */
|
|
||||||
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
|
|
||||||
#endif
|
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
|
||||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
|
||||||
/* Because PNG_COMPOSE does the gamma transform if there is something to
|
|
||||||
* do (if there is an alpha channel or transparency.)
|
|
||||||
*/
|
|
||||||
!((png_ptr->transformations & PNG_COMPOSE) &&
|
|
||||||
((png_ptr->num_trans != 0) ||
|
|
||||||
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) &&
|
|
||||||
#endif
|
|
||||||
/* Because png_init_read_transformations transforms the palette, unless
|
|
||||||
* RGB_TO_GRAY will do the transform.
|
|
||||||
*/
|
|
||||||
(png_ptr->color_type != PNG_COLOR_TYPE_PALETTE))
|
|
||||||
png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
|
|
||||||
if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
|
|
||||||
(png_ptr->transformations & PNG_COMPOSE) &&
|
|
||||||
(row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
|
|
||||||
row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
|
|
||||||
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
|
||||||
0 /* at_start == false, because SWAP_ALPHA happens later */);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
|
||||||
if ((png_ptr->transformations & PNG_ENCODE_ALPHA) &&
|
|
||||||
(row_info->color_type & PNG_COLOR_MASK_ALPHA))
|
|
||||||
png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SCALE_16_TO_8)
|
|
||||||
png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
|
||||||
/* There is no harm in doing both of these because only one has any effect,
|
|
||||||
* by putting the 'scale' option first if the app asks for scale (either by
|
|
||||||
* calling the API or in a TRANSFORM flag) this is what happens.
|
|
||||||
*/
|
|
||||||
if (png_ptr->transformations & PNG_16_TO_8)
|
|
||||||
png_do_chop(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_QUANTIZE)
|
|
||||||
{
|
|
||||||
png_do_quantize(row_info, png_ptr->row_buf + 1,
|
|
||||||
png_ptr->palette_lookup, png_ptr->quantize_index);
|
|
||||||
|
|
||||||
if (row_info->rowbytes == 0)
|
|
||||||
png_error(png_ptr, "png_do_quantize returned rowbytes=0");
|
|
||||||
}
|
|
||||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
|
|
||||||
|
|
||||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
|
||||||
/* Do the expansion now, after all the arithmetic has been done. Notice
|
|
||||||
* that previous transformations can handle the PNG_EXPAND_16 flag if this
|
|
||||||
* is efficient (particularly true in the case of gamma correction, where
|
|
||||||
* better accuracy results faster!)
|
|
||||||
*/
|
|
||||||
if (png_ptr->transformations & PNG_EXPAND_16)
|
|
||||||
png_do_expand_16(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
|
||||||
/* NOTE: moved here in 1.5.4 (from much later in this list.) */
|
|
||||||
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
|
|
||||||
(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
|
||||||
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_INVERT_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
|
||||||
png_do_invert(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SHIFT)
|
|
||||||
png_do_unshift(row_info, png_ptr->row_buf + 1,
|
|
||||||
&(png_ptr->shift));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_PACK_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_PACK)
|
|
||||||
png_do_unpack(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
|
|
||||||
/* Added at libpng-1.5.10 */
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
|
|
||||||
png_ptr->num_palette_max >= 0)
|
|
||||||
png_do_check_palette_indexes(png_ptr, row_info);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_BGR_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_BGR)
|
|
||||||
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_PACKSWAP_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
|
||||||
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_FILLER_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_FILLER)
|
|
||||||
png_do_read_filler(row_info, png_ptr->row_buf + 1,
|
|
||||||
(png_uint_32)png_ptr->filler, png_ptr->flags);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
|
||||||
png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SWAP_ALPHA)
|
|
||||||
png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_16BIT_SUPPORTED
|
|
||||||
#ifdef PNG_READ_SWAP_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
|
||||||
png_do_swap(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
|
||||||
{
|
|
||||||
if (png_ptr->read_user_transform_fn != NULL)
|
|
||||||
(*(png_ptr->read_user_transform_fn)) /* User read transform function */
|
|
||||||
(png_ptr, /* png_ptr */
|
|
||||||
row_info, /* row_info: */
|
|
||||||
/* png_uint_32 width; width of row */
|
|
||||||
/* png_size_t rowbytes; number of bytes in row */
|
|
||||||
/* png_byte color_type; color type of pixels */
|
|
||||||
/* png_byte bit_depth; bit depth of samples */
|
|
||||||
/* png_byte channels; number of channels (1-4) */
|
|
||||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
|
||||||
png_ptr->row_buf + 1); /* start of pixel data for row */
|
|
||||||
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
|
|
||||||
if (png_ptr->user_transform_depth)
|
|
||||||
row_info->bit_depth = png_ptr->user_transform_depth;
|
|
||||||
|
|
||||||
if (png_ptr->user_transform_channels)
|
|
||||||
row_info->channels = png_ptr->user_transform_channels;
|
|
||||||
#endif
|
|
||||||
row_info->pixel_depth = (png_byte)(row_info->bit_depth *
|
|
||||||
row_info->channels);
|
|
||||||
|
|
||||||
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PNG_READ_PACK_SUPPORTED
|
#ifdef PNG_READ_PACK_SUPPORTED
|
||||||
/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel,
|
/* Unpack pixels of 1, 2, or 4 bits per pixel into 1 byte per pixel,
|
||||||
* without changing the actual values. Thus, if you had a row with
|
* without changing the actual values. Thus, if you had a row with
|
||||||
@@ -2427,7 +2130,7 @@ png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
|||||||
* the numbers 0 or 1. If you would rather they contain 0 and 255, use
|
* the numbers 0 or 1. If you would rather they contain 0 and 255, use
|
||||||
* png_do_shift() after this.
|
* png_do_shift() after this.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_unpack(png_row_infop row_info, png_bytep row)
|
png_do_unpack(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_unpack");
|
png_debug(1, "in png_do_unpack");
|
||||||
@@ -2525,7 +2228,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
|
|||||||
* a row of bit depth 8, but only 5 are significant, this will shift
|
* a row of bit depth 8, but only 5 are significant, this will shift
|
||||||
* the values back to 0 through 31.
|
* the values back to 0 through 31.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_unshift(png_row_infop row_info, png_bytep row,
|
png_do_unshift(png_row_infop row_info, png_bytep row,
|
||||||
png_const_color_8p sig_bits)
|
png_const_color_8p sig_bits)
|
||||||
{
|
{
|
||||||
@@ -2664,7 +2367,7 @@ png_do_unshift(png_row_infop row_info, png_bytep row,
|
|||||||
|
|
||||||
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
||||||
/* Scale rows of bit depth 16 down to 8 accurately */
|
/* Scale rows of bit depth 16 down to 8 accurately */
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
|
png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_scale_16_to_8");
|
png_debug(1, "in png_do_scale_16_to_8");
|
||||||
@@ -2722,7 +2425,7 @@ png_do_scale_16_to_8(png_row_infop row_info, png_bytep row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
/* Simply discard the low byte. This was the default behavior prior
|
/* Simply discard the low byte. This was the default behavior prior
|
||||||
* to libpng-1.5.4.
|
* to libpng-1.5.4.
|
||||||
*/
|
*/
|
||||||
@@ -2750,7 +2453,7 @@ png_do_chop(png_row_infop row_info, png_bytep row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
|
png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_read_swap_alpha");
|
png_debug(1, "in png_do_read_swap_alpha");
|
||||||
@@ -2847,7 +2550,7 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_uint_32 row_width;
|
png_uint_32 row_width;
|
||||||
@@ -2949,7 +2652,7 @@ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
|
|
||||||
#ifdef PNG_READ_FILLER_SUPPORTED
|
#ifdef PNG_READ_FILLER_SUPPORTED
|
||||||
/* Add filler channel if we have RGB color */
|
/* Add filler channel if we have RGB color */
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_read_filler(png_row_infop row_info, png_bytep row,
|
png_do_read_filler(png_row_infop row_info, png_bytep row,
|
||||||
png_uint_32 filler, png_uint_32 flags)
|
png_uint_32 filler, png_uint_32 flags)
|
||||||
{
|
{
|
||||||
@@ -3136,7 +2839,7 @@ png_do_read_filler(png_row_infop row_info, png_bytep row,
|
|||||||
|
|
||||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||||
/* Expand grayscale files to RGB, with or without alpha */
|
/* Expand grayscale files to RGB, with or without alpha */
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_uint_32 i;
|
png_uint_32 i;
|
||||||
@@ -3275,7 +2978,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row)
|
|||||||
* calculated to make the sum 32768. This will result in different rounding
|
* calculated to make the sum 32768. This will result in different rounding
|
||||||
* to that used above.
|
* to that used above.
|
||||||
*/
|
*/
|
||||||
int /* PRIVATE */
|
static int
|
||||||
png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -3469,73 +3172,14 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row)
|
|||||||
return rgb_error;
|
return rgb_error;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
|
|
||||||
|
|
||||||
#ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
|
|
||||||
/* Build a grayscale palette. Palette is assumed to be 1 << bit_depth
|
|
||||||
* large of png_color. This lets grayscale images be treated as
|
|
||||||
* paletted. Most useful for gamma correction and simplification
|
|
||||||
* of code. This API is not used internally.
|
|
||||||
*/
|
|
||||||
void PNGAPI
|
|
||||||
png_build_grayscale_palette(int bit_depth, png_colorp palette)
|
|
||||||
{
|
|
||||||
int num_palette;
|
|
||||||
int color_inc;
|
|
||||||
int i;
|
|
||||||
int v;
|
|
||||||
|
|
||||||
png_debug(1, "in png_do_build_grayscale_palette");
|
|
||||||
|
|
||||||
if (palette == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (bit_depth)
|
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
num_palette = 2;
|
|
||||||
color_inc = 0xff;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
num_palette = 4;
|
|
||||||
color_inc = 0x55;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
num_palette = 16;
|
|
||||||
color_inc = 0x11;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 8:
|
|
||||||
num_palette = 256;
|
|
||||||
color_inc = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
num_palette = 0;
|
|
||||||
color_inc = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0, v = 0; i < num_palette; i++, v += color_inc)
|
|
||||||
{
|
|
||||||
palette[i].red = (png_byte)v;
|
|
||||||
palette[i].green = (png_byte)v;
|
|
||||||
palette[i].blue = (png_byte)v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
|
|
||||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
/* Replace any alpha or transparency with the supplied background color.
|
/* Replace any alpha or transparency with the supplied background color.
|
||||||
* "background" is already in the screen gamma, while "background_1" is
|
* "background" is already in the screen gamma, while "background_1" is
|
||||||
* at a gamma of 1.0. Paletted files have already been taken care of.
|
* at a gamma of 1.0. Paletted files have already been taken care of.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
||||||
{
|
{
|
||||||
#ifdef PNG_READ_GAMMA_SUPPORTED
|
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||||
@@ -4275,7 +3919,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
* is 16, use gamma_16_table and gamma_shift. Build these with
|
* is 16, use gamma_16_table and gamma_shift. Build these with
|
||||||
* build_gamma_table().
|
* build_gamma_table().
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
||||||
{
|
{
|
||||||
png_const_bytep gamma_table = png_ptr->gamma_table;
|
png_const_bytep gamma_table = png_ptr->gamma_table;
|
||||||
@@ -4476,7 +4120,7 @@ png_do_gamma(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
* linear.) Called only with color types that have an alpha channel. Needs the
|
* linear.) Called only with color types that have an alpha channel. Needs the
|
||||||
* from_1 tables.
|
* from_1 tables.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
||||||
{
|
{
|
||||||
png_uint_32 row_width = row_info->width;
|
png_uint_32 row_width = row_info->width;
|
||||||
@@ -4542,7 +4186,7 @@ png_do_encode_alpha(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
|
|||||||
/* Expands a palette row to an RGB or RGBA row depending
|
/* Expands a palette row to an RGB or RGBA row depending
|
||||||
* upon whether you supply trans and num_trans.
|
* upon whether you supply trans and num_trans.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
||||||
png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
|
png_const_colorp palette, png_const_bytep trans_alpha, int num_trans)
|
||||||
{
|
{
|
||||||
@@ -4695,7 +4339,7 @@ png_do_expand_palette(png_row_infop row_info, png_bytep row,
|
|||||||
/* If the bit depth < 8, it is expanded to 8. Also, if the already
|
/* If the bit depth < 8, it is expanded to 8. Also, if the already
|
||||||
* expanded transparency value is supplied, an alpha channel is built.
|
* expanded transparency value is supplied, an alpha channel is built.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_expand(png_row_infop row_info, png_bytep row,
|
png_do_expand(png_row_infop row_info, png_bytep row,
|
||||||
png_const_color_16p trans_color)
|
png_const_color_16p trans_color)
|
||||||
{
|
{
|
||||||
@@ -4925,7 +4569,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
|
|||||||
/* If the bit depth is 8 and the color type is not a palette type expand the
|
/* If the bit depth is 8 and the color type is not a palette type expand the
|
||||||
* whole row to 16 bits. Has no effect otherwise.
|
* whole row to 16 bits. Has no effect otherwise.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_expand_16(png_row_infop row_info, png_bytep row)
|
png_do_expand_16(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
if (row_info->bit_depth == 8 &&
|
if (row_info->bit_depth == 8 &&
|
||||||
@@ -4953,7 +4597,7 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_quantize(png_row_infop row_info, png_bytep row,
|
png_do_quantize(png_row_infop row_info, png_bytep row,
|
||||||
png_const_bytep palette_lookup, png_const_bytep quantize_lookup)
|
png_const_bytep palette_lookup, png_const_bytep quantize_lookup)
|
||||||
{
|
{
|
||||||
@@ -5045,69 +4689,303 @@ png_do_quantize(png_row_infop row_info, png_bytep row,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
|
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
|
||||||
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
|
|
||||||
|
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
/* Transform the row. The order of transformations is significant,
|
||||||
/* Undoes intrapixel differencing */
|
* and is very touchy. If you add a transformation, take care to
|
||||||
|
* decide how it fits in with the other transformations here.
|
||||||
|
*/
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
|
png_do_read_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_read_intrapixel");
|
png_debug(1, "in png_do_read_transformations");
|
||||||
|
|
||||||
if (
|
if (png_ptr->row_buf == NULL)
|
||||||
(row_info->color_type & PNG_COLOR_MASK_COLOR))
|
|
||||||
{
|
{
|
||||||
int bytes_per_pixel;
|
/* Prior to 1.5.4 this output row/pass where the NULL pointer is, but this
|
||||||
png_uint_32 row_width = row_info->width;
|
* error is incredibly rare and incredibly easy to debug without this
|
||||||
|
* information.
|
||||||
|
*/
|
||||||
|
png_error(png_ptr, "NULL row buffer");
|
||||||
|
}
|
||||||
|
|
||||||
if (row_info->bit_depth == 8)
|
/* The following is debugging; prior to 1.5.4 the code was never compiled in;
|
||||||
|
* in 1.5.4 PNG_FLAG_DETECT_UNINITIALIZED was added and the macro
|
||||||
|
* PNG_WARN_UNINITIALIZED_ROW removed. In 1.6 the new flag is set only for
|
||||||
|
* all transformations, however in practice the ROW_INIT always gets done on
|
||||||
|
* demand, if necessary.
|
||||||
|
*/
|
||||||
|
if ((png_ptr->flags & PNG_FLAG_DETECT_UNINITIALIZED) != 0 &&
|
||||||
|
!(png_ptr->flags & PNG_FLAG_ROW_INIT))
|
||||||
|
{
|
||||||
|
/* Application has failed to call either png_read_start_image() or
|
||||||
|
* png_read_update_info() after setting transforms that expand pixels.
|
||||||
|
* This check added to libpng-1.2.19 (but not enabled until 1.5.4).
|
||||||
|
*/
|
||||||
|
png_error(png_ptr, "Uninitialized row");
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_READ_EXPAND_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_EXPAND)
|
||||||
|
{
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE)
|
||||||
{
|
{
|
||||||
png_bytep rp;
|
png_do_expand_palette(row_info, png_ptr->row_buf + 1,
|
||||||
png_uint_32 i;
|
png_ptr->palette, png_ptr->trans_alpha, png_ptr->num_trans);
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
|
||||||
bytes_per_pixel = 3;
|
|
||||||
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 4;
|
|
||||||
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
*(rp) = (png_byte)((256 + *rp + *(rp + 1)) & 0xff);
|
|
||||||
*(rp+2) = (png_byte)((256 + *(rp + 2) + *(rp + 1)) & 0xff);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (row_info->bit_depth == 16)
|
|
||||||
|
else
|
||||||
{
|
{
|
||||||
png_bytep rp;
|
if (png_ptr->num_trans &&
|
||||||
png_uint_32 i;
|
(png_ptr->transformations & PNG_EXPAND_tRNS))
|
||||||
|
png_do_expand(row_info, png_ptr->row_buf + 1,
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
&(png_ptr->trans_color));
|
||||||
bytes_per_pixel = 6;
|
|
||||||
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
|
||||||
bytes_per_pixel = 8;
|
|
||||||
|
|
||||||
else
|
else
|
||||||
return;
|
png_do_expand(row_info, png_ptr->row_buf + 1,
|
||||||
|
NULL);
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
|
||||||
{
|
|
||||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
|
||||||
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
|
||||||
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
|
||||||
png_uint_32 red = (s0 + s1 + 65536) & 0xffff;
|
|
||||||
png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
|
|
||||||
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
|
||||||
*(rp + 1) = (png_byte)(red & 0xff);
|
|
||||||
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
|
|
||||||
*(rp + 5) = (png_byte)(blue & 0xff);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
|
||||||
|
if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
|
||||||
|
!(png_ptr->transformations & PNG_COMPOSE) &&
|
||||||
|
(row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
|
||||||
|
row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
|
||||||
|
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
||||||
|
0 /* at_start == false, because SWAP_ALPHA happens later */);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_RGB_TO_GRAY)
|
||||||
|
{
|
||||||
|
int rgb_error =
|
||||||
|
png_do_rgb_to_gray(png_ptr, row_info,
|
||||||
|
png_ptr->row_buf + 1);
|
||||||
|
|
||||||
|
if (rgb_error)
|
||||||
|
{
|
||||||
|
png_ptr->rgb_to_gray_status=1;
|
||||||
|
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||||
|
PNG_RGB_TO_GRAY_WARN)
|
||||||
|
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||||
|
|
||||||
|
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
|
||||||
|
PNG_RGB_TO_GRAY_ERR)
|
||||||
|
png_error(png_ptr, "png_do_rgb_to_gray found nongray pixel");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* From Andreas Dilger e-mail to png-implement, 26 March 1998:
|
||||||
|
*
|
||||||
|
* In most cases, the "simple transparency" should be done prior to doing
|
||||||
|
* gray-to-RGB, or you will have to test 3x as many bytes to check if a
|
||||||
|
* pixel is transparent. You would also need to make sure that the
|
||||||
|
* transparency information is upgraded to RGB.
|
||||||
|
*
|
||||||
|
* To summarize, the current flow is:
|
||||||
|
* - Gray + simple transparency -> compare 1 or 2 gray bytes and composite
|
||||||
|
* with background "in place" if transparent,
|
||||||
|
* convert to RGB if necessary
|
||||||
|
* - Gray + alpha -> composite with gray background and remove alpha bytes,
|
||||||
|
* convert to RGB if necessary
|
||||||
|
*
|
||||||
|
* To support RGB backgrounds for gray images we need:
|
||||||
|
* - Gray + simple transparency -> convert to RGB + simple transparency,
|
||||||
|
* compare 3 or 6 bytes and composite with
|
||||||
|
* background "in place" if transparent
|
||||||
|
* (3x compare/pixel compared to doing
|
||||||
|
* composite with gray bkgrnd)
|
||||||
|
* - Gray + alpha -> convert to RGB + alpha, composite with background and
|
||||||
|
* remove alpha bytes (3x float
|
||||||
|
* operations/pixel compared with composite
|
||||||
|
* on gray background)
|
||||||
|
*
|
||||||
|
* Greg's change will do this. The reason it wasn't done before is for
|
||||||
|
* performance, as this increases the per-pixel operations. If we would check
|
||||||
|
* in advance if the background was gray or RGB, and position the gray-to-RGB
|
||||||
|
* transform appropriately, then it would save a lot of work/time.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||||
|
/* If gray -> RGB, do so now only if background is non-gray; else do later
|
||||||
|
* for performance reasons
|
||||||
|
*/
|
||||||
|
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
|
||||||
|
!(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
||||||
|
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
|
if (png_ptr->transformations & PNG_COMPOSE)
|
||||||
|
png_do_compose(row_info, png_ptr->row_buf + 1, png_ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_GAMMA_SUPPORTED
|
||||||
|
if ((png_ptr->transformations & PNG_GAMMA) &&
|
||||||
|
#ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED
|
||||||
|
/* Because RGB_TO_GRAY does the gamma transform. */
|
||||||
|
!(png_ptr->transformations & PNG_RGB_TO_GRAY) &&
|
||||||
|
#endif
|
||||||
|
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||||
|
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||||
|
/* Because PNG_COMPOSE does the gamma transform if there is something to
|
||||||
|
* do (if there is an alpha channel or transparency.)
|
||||||
|
*/
|
||||||
|
!((png_ptr->transformations & PNG_COMPOSE) &&
|
||||||
|
((png_ptr->num_trans != 0) ||
|
||||||
|
(png_ptr->color_type & PNG_COLOR_MASK_ALPHA))) &&
|
||||||
|
#endif
|
||||||
|
/* Because png_init_read_transformations transforms the palette, unless
|
||||||
|
* RGB_TO_GRAY will do the transform.
|
||||||
|
*/
|
||||||
|
(png_ptr->color_type != PNG_COLOR_TYPE_PALETTE))
|
||||||
|
png_do_gamma(row_info, png_ptr->row_buf + 1, png_ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
|
||||||
|
if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
|
||||||
|
(png_ptr->transformations & PNG_COMPOSE) &&
|
||||||
|
(row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA ||
|
||||||
|
row_info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA))
|
||||||
|
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
||||||
|
0 /* at_start == false, because SWAP_ALPHA happens later */);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_ALPHA_MODE_SUPPORTED
|
||||||
|
if ((png_ptr->transformations & PNG_ENCODE_ALPHA) &&
|
||||||
|
(row_info->color_type & PNG_COLOR_MASK_ALPHA))
|
||||||
|
png_do_encode_alpha(row_info, png_ptr->row_buf + 1, png_ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_SCALE_16_TO_8)
|
||||||
|
png_do_scale_16_to_8(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED
|
||||||
|
/* There is no harm in doing both of these because only one has any effect,
|
||||||
|
* by putting the 'scale' option first if the app asks for scale (either by
|
||||||
|
* calling the API or in a TRANSFORM flag) this is what happens.
|
||||||
|
*/
|
||||||
|
if (png_ptr->transformations & PNG_16_TO_8)
|
||||||
|
png_do_chop(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_QUANTIZE)
|
||||||
|
{
|
||||||
|
png_do_quantize(row_info, png_ptr->row_buf + 1,
|
||||||
|
png_ptr->palette_lookup, png_ptr->quantize_index);
|
||||||
|
|
||||||
|
if (row_info->rowbytes == 0)
|
||||||
|
png_error(png_ptr, "png_do_quantize returned rowbytes=0");
|
||||||
|
}
|
||||||
|
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||||
|
/* Do the expansion now, after all the arithmetic has been done. Notice
|
||||||
|
* that previous transformations can handle the PNG_EXPAND_16 flag if this
|
||||||
|
* is efficient (particularly true in the case of gamma correction, where
|
||||||
|
* better accuracy results faster!)
|
||||||
|
*/
|
||||||
|
if (png_ptr->transformations & PNG_EXPAND_16)
|
||||||
|
png_do_expand_16(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||||
|
/* NOTE: moved here in 1.5.4 (from much later in this list.) */
|
||||||
|
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
|
||||||
|
(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
||||||
|
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_INVERT_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||||
|
png_do_invert(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_SHIFT_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_SHIFT)
|
||||||
|
png_do_unshift(row_info, png_ptr->row_buf + 1,
|
||||||
|
&(png_ptr->shift));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_PACK_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_PACK)
|
||||||
|
png_do_unpack(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
|
||||||
|
/* Added at libpng-1.5.10 */
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_PALETTE &&
|
||||||
|
png_ptr->num_palette_max >= 0)
|
||||||
|
png_do_check_palette_indexes(png_ptr, row_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_BGR_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_BGR)
|
||||||
|
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_PACKSWAP_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||||
|
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_FILLER_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_FILLER)
|
||||||
|
png_do_read_filler(row_info, png_ptr->row_buf + 1,
|
||||||
|
(png_uint_32)png_ptr->filler, png_ptr->flags);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_INVERT_ALPHA_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
||||||
|
png_do_read_invert_alpha(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_SWAP_ALPHA_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_SWAP_ALPHA)
|
||||||
|
png_do_read_swap_alpha(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_16BIT_SUPPORTED
|
||||||
|
#ifdef PNG_READ_SWAP_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
||||||
|
png_do_swap(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||||
|
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||||
|
{
|
||||||
|
if (png_ptr->read_user_transform_fn != NULL)
|
||||||
|
(*(png_ptr->read_user_transform_fn)) /* User read transform function */
|
||||||
|
(png_ptr, /* png_ptr */
|
||||||
|
row_info, /* row_info: */
|
||||||
|
/* png_uint_32 width; width of row */
|
||||||
|
/* png_size_t rowbytes; number of bytes in row */
|
||||||
|
/* png_byte color_type; color type of pixels */
|
||||||
|
/* png_byte bit_depth; bit depth of samples */
|
||||||
|
/* png_byte channels; number of channels (1-4) */
|
||||||
|
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
||||||
|
png_ptr->row_buf + 1); /* start of pixel data for row */
|
||||||
|
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
|
||||||
|
if (png_ptr->user_transform_depth)
|
||||||
|
row_info->bit_depth = png_ptr->user_transform_depth;
|
||||||
|
|
||||||
|
if (png_ptr->user_transform_channels)
|
||||||
|
row_info->channels = png_ptr->user_transform_channels;
|
||||||
|
#endif
|
||||||
|
row_info->pixel_depth = (png_byte)(row_info->bit_depth *
|
||||||
|
row_info->channels);
|
||||||
|
|
||||||
|
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, row_info->width);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
|
||||||
|
#endif /* PNG_READ_TRANSFORMS_SUPPORTED */
|
||||||
#endif /* PNG_READ_SUPPORTED */
|
#endif /* PNG_READ_SUPPORTED */
|
||||||
|
|||||||
71
pngtest.c
71
pngtest.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngtest.c - a simple test program to test libpng
|
/* pngtest.c - a simple test program to test libpng
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -45,6 +45,11 @@
|
|||||||
|
|
||||||
/* Known chunks that exist in pngtest.png must be supported or pngtest will fail
|
/* Known chunks that exist in pngtest.png must be supported or pngtest will fail
|
||||||
* simply as a result of re-ordering them. This may be fixed in 1.7
|
* simply as a result of re-ordering them. This may be fixed in 1.7
|
||||||
|
*
|
||||||
|
* pngtest allocates a single row buffer for each row and overwrites it,
|
||||||
|
* therefore if the write side doesn't support the writing of interlaced images
|
||||||
|
* nothing can be done for an interlaced image (and the code below will fail
|
||||||
|
* horribly trying to write extra data after writing garbage).
|
||||||
*/
|
*/
|
||||||
#if defined PNG_READ_SUPPORTED && /* else nothing can be done */\
|
#if defined PNG_READ_SUPPORTED && /* else nothing can be done */\
|
||||||
defined PNG_READ_bKGD_SUPPORTED &&\
|
defined PNG_READ_bKGD_SUPPORTED &&\
|
||||||
@@ -58,9 +63,15 @@
|
|||||||
defined PNG_READ_sRGB_SUPPORTED &&\
|
defined PNG_READ_sRGB_SUPPORTED &&\
|
||||||
defined PNG_READ_tEXt_SUPPORTED &&\
|
defined PNG_READ_tEXt_SUPPORTED &&\
|
||||||
defined PNG_READ_tIME_SUPPORTED &&\
|
defined PNG_READ_tIME_SUPPORTED &&\
|
||||||
defined PNG_READ_zTXt_SUPPORTED
|
defined PNG_READ_zTXt_SUPPORTED &&\
|
||||||
|
defined PNG_WRITE_INTERLACING_SUPPORTED
|
||||||
|
|
||||||
|
#ifdef PNG_ZLIB_HEADER
|
||||||
|
# include PNG_ZLIB_HEADER /* defined by pnglibconf.h from 1.7 */
|
||||||
|
#else
|
||||||
|
# include "zlib.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "zlib.h"
|
|
||||||
/* Copied from pngpriv.h but only used in error messages below. */
|
/* Copied from pngpriv.h but only used in error messages below. */
|
||||||
#ifndef PNG_ZBUF_SIZE
|
#ifndef PNG_ZBUF_SIZE
|
||||||
# define PNG_ZBUF_SIZE 8192
|
# define PNG_ZBUF_SIZE 8192
|
||||||
@@ -116,10 +127,6 @@ static int unsupported_chunks = 0; /* chunk unsupported by libpng in input */
|
|||||||
static int error_count = 0; /* count calls to png_error */
|
static int error_count = 0; /* count calls to png_error */
|
||||||
static int warning_count = 0; /* count calls to png_warning */
|
static int warning_count = 0; /* count calls to png_warning */
|
||||||
|
|
||||||
#ifdef __TURBOC__
|
|
||||||
#include <mem.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
|
/* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
|
||||||
#ifndef png_jmpbuf
|
#ifndef png_jmpbuf
|
||||||
# define png_jmpbuf(png_ptr) png_ptr->jmpbuf
|
# define png_jmpbuf(png_ptr) png_ptr->jmpbuf
|
||||||
@@ -725,18 +732,18 @@ static int PNGCBAPI read_user_chunk_callback(png_struct *png_ptr,
|
|||||||
static void
|
static void
|
||||||
write_sTER_chunk(png_structp write_ptr)
|
write_sTER_chunk(png_structp write_ptr)
|
||||||
{
|
{
|
||||||
png_byte png_sTER[5] = {115, 84, 69, 82, '\0'};
|
png_byte sTER[5] = {115, 84, 69, 82, '\0'};
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
fprintf(STDERR, "\n stereo mode = %d\n", user_chunk_data.sTER_mode);
|
fprintf(STDERR, "\n stereo mode = %d\n", user_chunk_data.sTER_mode);
|
||||||
|
|
||||||
png_write_chunk(write_ptr, png_sTER, &user_chunk_data.sTER_mode, 1);
|
png_write_chunk(write_ptr, sTER, &user_chunk_data.sTER_mode, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_vpAg_chunk(png_structp write_ptr)
|
write_vpAg_chunk(png_structp write_ptr)
|
||||||
{
|
{
|
||||||
png_byte png_vpAg[5] = {118, 112, 65, 103, '\0'};
|
png_byte vpAg[5] = {118, 112, 65, 103, '\0'};
|
||||||
|
|
||||||
png_byte vpag_chunk_data[9];
|
png_byte vpag_chunk_data[9];
|
||||||
|
|
||||||
@@ -749,7 +756,7 @@ write_vpAg_chunk(png_structp write_ptr)
|
|||||||
png_save_uint_32(vpag_chunk_data, user_chunk_data.vpAg_width);
|
png_save_uint_32(vpag_chunk_data, user_chunk_data.vpAg_width);
|
||||||
png_save_uint_32(vpag_chunk_data + 4, user_chunk_data.vpAg_height);
|
png_save_uint_32(vpag_chunk_data + 4, user_chunk_data.vpAg_height);
|
||||||
vpag_chunk_data[8] = user_chunk_data.vpAg_units;
|
vpag_chunk_data[8] = user_chunk_data.vpAg_units;
|
||||||
png_write_chunk(write_ptr, png_vpAg, vpag_chunk_data, 9);
|
png_write_chunk(write_ptr, vpAg, vpag_chunk_data, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -830,6 +837,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
png_structp write_ptr;
|
png_structp write_ptr;
|
||||||
png_infop write_info_ptr;
|
png_infop write_info_ptr;
|
||||||
png_infop write_end_info_ptr;
|
png_infop write_end_info_ptr;
|
||||||
|
int interlace_preserved = 1;
|
||||||
#else
|
#else
|
||||||
png_structp write_ptr = NULL;
|
png_structp write_ptr = NULL;
|
||||||
png_infop write_info_ptr = NULL;
|
png_infop write_info_ptr = NULL;
|
||||||
@@ -838,7 +846,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
png_bytep row_buf;
|
png_bytep row_buf;
|
||||||
png_uint_32 y;
|
png_uint_32 y;
|
||||||
png_uint_32 width, height;
|
png_uint_32 width, height;
|
||||||
int num_pass, pass;
|
int num_pass = 1, pass;
|
||||||
int bit_depth, color_type;
|
int bit_depth, color_type;
|
||||||
|
|
||||||
row_buf = NULL;
|
row_buf = NULL;
|
||||||
@@ -1044,10 +1052,26 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
&color_type, &interlace_type, &compression_type, &filter_type))
|
&color_type, &interlace_type, &compression_type, &filter_type))
|
||||||
{
|
{
|
||||||
png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth,
|
png_set_IHDR(write_ptr, write_info_ptr, width, height, bit_depth,
|
||||||
#ifdef PNG_WRITE_INTERLACING_SUPPORTED
|
|
||||||
color_type, interlace_type, compression_type, filter_type);
|
color_type, interlace_type, compression_type, filter_type);
|
||||||
#else
|
#ifndef PNG_READ_INTERLACING_SUPPORTED
|
||||||
color_type, PNG_INTERLACE_NONE, compression_type, filter_type);
|
/* num_pass will not be set below, set it here if the image is
|
||||||
|
* interlaced: what happens is that write interlacing is *not* turned
|
||||||
|
* on an the partial interlaced rows are written directly.
|
||||||
|
*/
|
||||||
|
switch (interlace_type)
|
||||||
|
{
|
||||||
|
case PNG_INTERLACE_NONE:
|
||||||
|
num_pass = 1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PNG_INTERLACE_ADAM7:
|
||||||
|
num_pass = 7;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
png_error(read_ptr, "invalid interlace type");
|
||||||
|
/*NOT REACHED*/
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1340,14 +1364,10 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
#endif /* SINGLE_ROWBUF_ALLOC */
|
#endif /* SINGLE_ROWBUF_ALLOC */
|
||||||
pngtest_debug("Writing row data");
|
pngtest_debug("Writing row data");
|
||||||
|
|
||||||
#if defined(PNG_READ_INTERLACING_SUPPORTED) || \
|
#ifdef PNG_READ_INTERLACING_SUPPORTED
|
||||||
defined(PNG_WRITE_INTERLACING_SUPPORTED)
|
|
||||||
num_pass = png_set_interlace_handling(read_ptr);
|
num_pass = png_set_interlace_handling(read_ptr);
|
||||||
# ifdef PNG_WRITE_SUPPORTED
|
if (png_set_interlace_handling(write_ptr) != num_pass)
|
||||||
png_set_interlace_handling(write_ptr);
|
png_error(write_ptr, "png_set_interlace_handling: inconsistent num_pass");
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
num_pass = 1;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNGTEST_TIMING
|
#ifdef PNGTEST_TIMING
|
||||||
@@ -1579,6 +1599,7 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SUPPORTED /* else nothing was written */
|
#ifdef PNG_WRITE_SUPPORTED /* else nothing was written */
|
||||||
|
if (interlace_preserved) /* else the files will be changed */
|
||||||
{
|
{
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@@ -1965,9 +1986,9 @@ main(void)
|
|||||||
fprintf(STDERR,
|
fprintf(STDERR,
|
||||||
" test ignored because libpng was not built with read support\n");
|
" test ignored because libpng was not built with read support\n");
|
||||||
/* And skip this test */
|
/* And skip this test */
|
||||||
return 77;
|
return PNG_LIBPNG_VER < 10600 ? 0 : 77;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||||
typedef png_libpng_version_1_6_8 Your_png_h_is_not_version_1_6_8;
|
typedef png_libpng_version_1_6_9beta03 Your_png_h_is_not_version_1_6_9beta03;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -57,7 +57,9 @@ png_set_packing(png_structrp png_ptr)
|
|||||||
if (png_ptr->bit_depth < 8)
|
if (png_ptr->bit_depth < 8)
|
||||||
{
|
{
|
||||||
png_ptr->transformations |= PNG_PACK;
|
png_ptr->transformations |= PNG_PACK;
|
||||||
png_ptr->usr_bit_depth = 8;
|
# ifdef PNG_WRITE_SUPPORTED
|
||||||
|
png_ptr->usr_bit_depth = 8;
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
6
pngwio.c
6
pngwio.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwio.c - functions for data output
|
/* pngwio.c - functions for data output
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -153,6 +153,7 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
|
|||||||
PNG_UNUSED(output_flush_fn)
|
PNG_UNUSED(output_flush_fn)
|
||||||
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
|
#endif /* PNG_WRITE_FLUSH_SUPPORTED */
|
||||||
|
|
||||||
|
#ifdef PNG_READ_SUPPORTED
|
||||||
/* It is an error to read while writing a png file */
|
/* It is an error to read while writing a png file */
|
||||||
if (png_ptr->read_data_fn != NULL)
|
if (png_ptr->read_data_fn != NULL)
|
||||||
{
|
{
|
||||||
@@ -162,5 +163,6 @@ png_set_write_fn(png_structrp png_ptr, png_voidp io_ptr,
|
|||||||
"Can't set both read_data_fn and write_data_fn in the"
|
"Can't set both read_data_fn and write_data_fn in the"
|
||||||
" same structure");
|
" same structure");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* PNG_WRITE_SUPPORTED */
|
#endif /* PNG_WRITE_SUPPORTED */
|
||||||
|
|||||||
69
pngwrite.c
69
pngwrite.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwrite.c - general routines to write a PNG file
|
/* pngwrite.c - general routines to write a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.8 [December 19, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -607,6 +607,71 @@ png_write_image(png_structrp png_ptr, png_bytepp image)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
||||||
|
/* Performs intrapixel differencing */
|
||||||
|
static void
|
||||||
|
png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
||||||
|
{
|
||||||
|
png_debug(1, "in png_do_write_intrapixel");
|
||||||
|
|
||||||
|
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
|
||||||
|
{
|
||||||
|
int bytes_per_pixel;
|
||||||
|
png_uint_32 row_width = row_info->width;
|
||||||
|
if (row_info->bit_depth == 8)
|
||||||
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_uint_32 i;
|
||||||
|
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
|
bytes_per_pixel = 3;
|
||||||
|
|
||||||
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
|
bytes_per_pixel = 4;
|
||||||
|
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||||
|
{
|
||||||
|
*(rp) = (png_byte)((*rp - *(rp + 1)) & 0xff);
|
||||||
|
*(rp + 2) = (png_byte)((*(rp + 2) - *(rp + 1)) & 0xff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_16BIT_SUPPORTED
|
||||||
|
else if (row_info->bit_depth == 16)
|
||||||
|
{
|
||||||
|
png_bytep rp;
|
||||||
|
png_uint_32 i;
|
||||||
|
|
||||||
|
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
||||||
|
bytes_per_pixel = 6;
|
||||||
|
|
||||||
|
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
||||||
|
bytes_per_pixel = 8;
|
||||||
|
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
||||||
|
{
|
||||||
|
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
||||||
|
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
||||||
|
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
||||||
|
png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL);
|
||||||
|
png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL);
|
||||||
|
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
||||||
|
*(rp + 1) = (png_byte)(red & 0xff);
|
||||||
|
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
|
||||||
|
*(rp + 5) = (png_byte)(blue & 0xff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
||||||
|
|
||||||
/* Called by user to write a row of image data */
|
/* Called by user to write a row of image data */
|
||||||
void PNGAPI
|
void PNGAPI
|
||||||
png_write_row(png_structrp png_ptr, png_const_bytep row)
|
png_write_row(png_structrp png_ptr, png_const_bytep row)
|
||||||
|
|||||||
203
pngwtran.c
203
pngwtran.c
@@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
/* pngwtran.c - transforms the data in a row for PNG writers
|
/* pngwtran.c - transforms the data in a row for PNG writers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
* Last changed in libpng 1.6.9 [(PENDING RELEASE)]
|
||||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2014 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
@@ -14,90 +14,14 @@
|
|||||||
#include "pngpriv.h"
|
#include "pngpriv.h"
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SUPPORTED
|
#ifdef PNG_WRITE_SUPPORTED
|
||||||
|
|
||||||
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
|
#ifdef PNG_WRITE_TRANSFORMS_SUPPORTED
|
||||||
/* Transform the data according to the user's wishes. The order of
|
|
||||||
* transformations is significant.
|
|
||||||
*/
|
|
||||||
void /* PRIVATE */
|
|
||||||
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
|
|
||||||
{
|
|
||||||
png_debug(1, "in png_do_write_transformations");
|
|
||||||
|
|
||||||
if (png_ptr == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
|
||||||
if (png_ptr->write_user_transform_fn != NULL)
|
|
||||||
(*(png_ptr->write_user_transform_fn)) /* User write transform
|
|
||||||
function */
|
|
||||||
(png_ptr, /* png_ptr */
|
|
||||||
row_info, /* row_info: */
|
|
||||||
/* png_uint_32 width; width of row */
|
|
||||||
/* png_size_t rowbytes; number of bytes in row */
|
|
||||||
/* png_byte color_type; color type of pixels */
|
|
||||||
/* png_byte bit_depth; bit depth of samples */
|
|
||||||
/* png_byte channels; number of channels (1-4) */
|
|
||||||
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
|
||||||
png_ptr->row_buf + 1); /* start of pixel data for row */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_FILLER_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_FILLER)
|
|
||||||
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
|
||||||
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_PACKSWAP)
|
|
||||||
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_PACK)
|
|
||||||
png_do_pack(row_info, png_ptr->row_buf + 1,
|
|
||||||
(png_uint_32)png_ptr->bit_depth);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SWAP_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
|
||||||
png_do_swap(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SHIFT)
|
|
||||||
png_do_shift(row_info, png_ptr->row_buf + 1,
|
|
||||||
&(png_ptr->shift));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_SWAP_ALPHA)
|
|
||||||
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
|
||||||
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_BGR_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_BGR)
|
|
||||||
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_INVERT_SUPPORTED
|
|
||||||
if (png_ptr->transformations & PNG_INVERT_MONO)
|
|
||||||
png_do_invert(row_info, png_ptr->row_buf + 1);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_PACK_SUPPORTED
|
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||||
/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The
|
/* Pack pixels into bytes. Pass the true bit depth in bit_depth. The
|
||||||
* row_info bit depth should be 8 (one pixel per byte). The channels
|
* row_info bit depth should be 8 (one pixel per byte). The channels
|
||||||
* should be 1 (this only happens on grayscale and paletted images).
|
* should be 1 (this only happens on grayscale and paletted images).
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_pack");
|
png_debug(1, "in png_do_pack");
|
||||||
@@ -242,7 +166,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth)
|
|||||||
* would pass 3 as bit_depth, and this routine would translate the
|
* would pass 3 as bit_depth, and this routine would translate the
|
||||||
* data to 0 to 15.
|
* data to 0 to 15.
|
||||||
*/
|
*/
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_shift(png_row_infop row_info, png_bytep row,
|
png_do_shift(png_row_infop row_info, png_bytep row,
|
||||||
png_const_color_8p bit_depth)
|
png_const_color_8p bit_depth)
|
||||||
{
|
{
|
||||||
@@ -381,7 +305,7 @@ png_do_shift(png_row_infop row_info, png_bytep row,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_write_swap_alpha");
|
png_debug(1, "in png_do_write_swap_alpha");
|
||||||
@@ -475,7 +399,7 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||||
void /* PRIVATE */
|
static void
|
||||||
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_write_invert_alpha");
|
png_debug(1, "in png_do_write_invert_alpha");
|
||||||
@@ -568,70 +492,81 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
|
|
||||||
|
|
||||||
#ifdef PNG_MNG_FEATURES_SUPPORTED
|
/* Transform the data according to the user's wishes. The order of
|
||||||
/* Undoes intrapixel differencing */
|
* transformations is significant.
|
||||||
|
*/
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_do_write_intrapixel(png_row_infop row_info, png_bytep row)
|
png_do_write_transformations(png_structrp png_ptr, png_row_infop row_info)
|
||||||
{
|
{
|
||||||
png_debug(1, "in png_do_write_intrapixel");
|
png_debug(1, "in png_do_write_transformations");
|
||||||
|
|
||||||
if ((row_info->color_type & PNG_COLOR_MASK_COLOR))
|
if (png_ptr == NULL)
|
||||||
{
|
return;
|
||||||
int bytes_per_pixel;
|
|
||||||
png_uint_32 row_width = row_info->width;
|
|
||||||
if (row_info->bit_depth == 8)
|
|
||||||
{
|
|
||||||
png_bytep rp;
|
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
||||||
bytes_per_pixel = 3;
|
if (png_ptr->transformations & PNG_USER_TRANSFORM)
|
||||||
|
if (png_ptr->write_user_transform_fn != NULL)
|
||||||
|
(*(png_ptr->write_user_transform_fn)) /* User write transform
|
||||||
|
function */
|
||||||
|
(png_ptr, /* png_ptr */
|
||||||
|
row_info, /* row_info: */
|
||||||
|
/* png_uint_32 width; width of row */
|
||||||
|
/* png_size_t rowbytes; number of bytes in row */
|
||||||
|
/* png_byte color_type; color type of pixels */
|
||||||
|
/* png_byte bit_depth; bit depth of samples */
|
||||||
|
/* png_byte channels; number of channels (1-4) */
|
||||||
|
/* png_byte pixel_depth; bits per pixel (depth*channels) */
|
||||||
|
png_ptr->row_buf + 1); /* start of pixel data for row */
|
||||||
|
#endif
|
||||||
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
#ifdef PNG_WRITE_FILLER_SUPPORTED
|
||||||
bytes_per_pixel = 4;
|
if (png_ptr->transformations & PNG_FILLER)
|
||||||
|
png_do_strip_channel(row_info, png_ptr->row_buf + 1,
|
||||||
|
!(png_ptr->flags & PNG_FLAG_FILLER_AFTER));
|
||||||
|
#endif
|
||||||
|
|
||||||
else
|
#ifdef PNG_WRITE_PACKSWAP_SUPPORTED
|
||||||
return;
|
if (png_ptr->transformations & PNG_PACKSWAP)
|
||||||
|
png_do_packswap(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
#ifdef PNG_WRITE_PACK_SUPPORTED
|
||||||
{
|
if (png_ptr->transformations & PNG_PACK)
|
||||||
*(rp) = (png_byte)((*rp - *(rp + 1)) & 0xff);
|
png_do_pack(row_info, png_ptr->row_buf + 1,
|
||||||
*(rp + 2) = (png_byte)((*(rp + 2) - *(rp + 1)) & 0xff);
|
(png_uint_32)png_ptr->bit_depth);
|
||||||
}
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PNG_WRITE_16BIT_SUPPORTED
|
#ifdef PNG_WRITE_SWAP_SUPPORTED
|
||||||
else if (row_info->bit_depth == 16)
|
if (png_ptr->transformations & PNG_SWAP_BYTES)
|
||||||
{
|
png_do_swap(row_info, png_ptr->row_buf + 1);
|
||||||
png_bytep rp;
|
#endif
|
||||||
png_uint_32 i;
|
|
||||||
|
|
||||||
if (row_info->color_type == PNG_COLOR_TYPE_RGB)
|
#ifdef PNG_WRITE_SHIFT_SUPPORTED
|
||||||
bytes_per_pixel = 6;
|
if (png_ptr->transformations & PNG_SHIFT)
|
||||||
|
png_do_shift(row_info, png_ptr->row_buf + 1,
|
||||||
|
&(png_ptr->shift));
|
||||||
|
#endif
|
||||||
|
|
||||||
else if (row_info->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
|
#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
||||||
bytes_per_pixel = 8;
|
if (png_ptr->transformations & PNG_SWAP_ALPHA)
|
||||||
|
png_do_write_swap_alpha(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
else
|
#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
||||||
return;
|
if (png_ptr->transformations & PNG_INVERT_ALPHA)
|
||||||
|
png_do_write_invert_alpha(row_info, png_ptr->row_buf + 1);
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
|
#ifdef PNG_WRITE_BGR_SUPPORTED
|
||||||
{
|
if (png_ptr->transformations & PNG_BGR)
|
||||||
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1);
|
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
||||||
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3);
|
#endif
|
||||||
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5);
|
|
||||||
png_uint_32 red = (png_uint_32)((s0 - s1) & 0xffffL);
|
#ifdef PNG_WRITE_INVERT_SUPPORTED
|
||||||
png_uint_32 blue = (png_uint_32)((s2 - s1) & 0xffffL);
|
if (png_ptr->transformations & PNG_INVERT_MONO)
|
||||||
*(rp ) = (png_byte)((red >> 8) & 0xff);
|
png_do_invert(row_info, png_ptr->row_buf + 1);
|
||||||
*(rp + 1) = (png_byte)(red & 0xff);
|
#endif
|
||||||
*(rp + 4) = (png_byte)((blue >> 8) & 0xff);
|
|
||||||
*(rp + 5) = (png_byte)(blue & 0xff);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* PNG_WRITE_16BIT_SUPPORTED */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* PNG_MNG_FEATURES_SUPPORTED */
|
#endif /* PNG_WRITE_TRANSFORMS_SUPPORTED */
|
||||||
#endif /* PNG_WRITE_SUPPORTED */
|
#endif /* PNG_WRITE_SUPPORTED */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
VisualStudio instructions
|
VisualStudio instructions
|
||||||
|
|
||||||
libpng version 1.6.8 - December 19, 2013
|
libpng version 1.6.9beta03 - January 10, 2014
|
||||||
|
|
||||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* zlib.props - location of zlib source
|
* zlib.props - location of zlib source
|
||||||
*
|
*
|
||||||
* libpng version 1.6.8 - December 19, 2013
|
* libpng version 1.6.9beta03 - January 10, 2014
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
Makefiles for libpng version 1.6.8 - December 19, 2013
|
Makefiles for libpng version 1.6.9beta03 - January 10, 2014
|
||||||
|
|
||||||
pnglibconf.h.prebuilt => Stores configuration settings
|
pnglibconf.h.prebuilt => Stores configuration settings
|
||||||
makefile.linux => Linux/ELF makefile
|
makefile.linux => Linux/ELF makefile
|
||||||
(gcc, creates libpng16.so.16.1.6.8)
|
(gcc, creates libpng16.so.16.1.6.9beta03)
|
||||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||||
ansi2knr (Requires ansi2knr.c from
|
ansi2knr (Requires ansi2knr.c from
|
||||||
@@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings
|
|||||||
makefile.dec => DEC Alpha UNIX makefile
|
makefile.dec => DEC Alpha UNIX makefile
|
||||||
makefile.dj2 => DJGPP 2 makefile
|
makefile.dj2 => DJGPP 2 makefile
|
||||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||||
(gcc, creates libpng16.so.16.1.6.8)
|
(gcc, creates libpng16.so.16.1.6.9beta03)
|
||||||
makefile.freebsd => FreeBSD makefile
|
makefile.freebsd => FreeBSD makefile
|
||||||
makefile.gcc => Generic gcc makefile
|
makefile.gcc => Generic gcc makefile
|
||||||
makefile.hpgcc => HPUX makefile using gcc
|
makefile.hpgcc => HPUX makefile using gcc
|
||||||
@@ -35,12 +35,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
|
|||||||
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
|
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
|
||||||
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||||
makefile.sggcc => Silicon Graphics (gcc,
|
makefile.sggcc => Silicon Graphics (gcc,
|
||||||
creates libpng16.so.16.1.6.8)
|
creates libpng16.so.16.1.6.9beta03)
|
||||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||||
creates libpng16.so.16.1.6.8)
|
creates libpng16.so.16.1.6.9beta03)
|
||||||
makefile.so9 => Solaris 9 makefile (gcc,
|
makefile.so9 => Solaris 9 makefile (gcc,
|
||||||
creates libpng16.so.16.1.6.8)
|
creates libpng16.so.16.1.6.9beta03)
|
||||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||||
makefile.sunos => Sun makefile
|
makefile.sunos => Sun makefile
|
||||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
|
|||||||
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
|
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
|
||||||
PNG_DFN ""
|
PNG_DFN ""
|
||||||
PNG_DFN "EXPORTS"
|
PNG_DFN "EXPORTS"
|
||||||
PNG_DFN ";Version 1.6.8"
|
PNG_DFN ";Version 1.6.9beta03"
|
||||||
|
|
||||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||||
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"
|
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
# Modeled after libxml-config.
|
# Modeled after libxml-config.
|
||||||
|
|
||||||
version=1.6.8
|
version=1.6.9beta03
|
||||||
prefix=""
|
prefix=""
|
||||||
libdir=""
|
libdir=""
|
||||||
libs=""
|
libs=""
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng16
|
|||||||
|
|
||||||
Name: libpng
|
Name: libpng
|
||||||
Description: Loads and saves PNG files
|
Description: Loads and saves PNG files
|
||||||
Version: 1.6.8
|
Version: 1.6.9beta03
|
||||||
Libs: -L${libdir} -lpng16
|
Libs: -L${libdir} -lpng16
|
||||||
Cflags: -I${includedir}
|
Cflags: -I${includedir}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
VERMAJ = 1
|
VERMAJ = 1
|
||||||
VERMIN = 6
|
VERMIN = 6
|
||||||
VERMIC = 8
|
VERMIC = 9
|
||||||
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
|
VER = $(VERMAJ).$(VERMIN).$(VERMIC)
|
||||||
NAME = libpng
|
NAME = libpng
|
||||||
PACKAGE = $(NAME)-$(VER)
|
PACKAGE = $(NAME)-$(VER)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng16
|
LIBNAME = libpng16
|
||||||
PNGMAJ = 16
|
PNGMAJ = 16
|
||||||
RELEASE = 8
|
RELEASE = 9
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
LIBSO=$(LIBNAME).so
|
LIBSO=$(LIBNAME).so
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ exec_prefix=$(prefix)
|
|||||||
# Library name:
|
# Library name:
|
||||||
LIBNAME = libpng16
|
LIBNAME = libpng16
|
||||||
PNGMAJ = 16
|
PNGMAJ = 16
|
||||||
RELEASE = 8
|
RELEASE = 9
|
||||||
|
|
||||||
# Shared library names:
|
# Shared library names:
|
||||||
LIBSO=$(LIBNAME).dll
|
LIBSO=$(LIBNAME).dll
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng16
|
|||||||
|
|
||||||
LIB= png16
|
LIB= png16
|
||||||
SHLIB_MAJOR= 0
|
SHLIB_MAJOR= 0
|
||||||
SHLIB_MINOR= 1.6.8
|
SHLIB_MINOR= 1.6.9beta03
|
||||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
|
|||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SHLIB_MAJOR= 16
|
SHLIB_MAJOR= 16
|
||||||
SHLIB_MINOR= 1.6.8
|
SHLIB_MINOR= 1.6.9beta03
|
||||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
|
|||||||
MANDIR= ${PREFIX}/man/cat
|
MANDIR= ${PREFIX}/man/cat
|
||||||
|
|
||||||
SHLIB_MAJOR= 16
|
SHLIB_MAJOR= 16
|
||||||
SHLIB_MINOR= 1.6.8
|
SHLIB_MINOR= 1.6.9beta03
|
||||||
|
|
||||||
LIB= png
|
LIB= png
|
||||||
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||||
|
|||||||
@@ -480,6 +480,7 @@ option INCH_CONVERSIONS
|
|||||||
= INCH_CONVERSIONS INCH_CONVERSIONS
|
= INCH_CONVERSIONS INCH_CONVERSIONS
|
||||||
|
|
||||||
# API to build a grayscale palette
|
# API to build a grayscale palette
|
||||||
|
# NOTE: this is not used internally by libpng at present.
|
||||||
|
|
||||||
option BUILD_GRAYSCALE_PALETTE
|
option BUILD_GRAYSCALE_PALETTE
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/* libpng 1.6.8 STANDARD API DEFINITION */
|
/* libpng 1.6.9beta03 STANDARD API DEFINITION */
|
||||||
|
|
||||||
/* pnglibconf.h - library build configuration */
|
/* pnglibconf.h - library build configuration */
|
||||||
|
|
||||||
/* Libpng version 1.6.8 - December 19, 2013 */
|
/* Libpng version 1.6.9beta03 - January 10, 2014 */
|
||||||
|
|
||||||
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
|
/* Copyright (c) 1998-2013 Glenn Randers-Pehrson */
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
;Version 1.6.8
|
;Version 1.6.9beta03
|
||||||
;--------------------------------------------------------------
|
;--------------------------------------------------------------
|
||||||
; LIBPNG symbol list as a Win32 DEF file
|
; LIBPNG symbol list as a Win32 DEF file
|
||||||
; Contains all the symbols that can be exported from libpng
|
; Contains all the symbols that can be exported from libpng
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
exec ./pngvalid --standard --interlace
|
exec ./pngvalid --standard --progressive-read
|
||||||
|
|||||||
Reference in New Issue
Block a user