mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
49 Commits
v1.5.0beta
...
v1.5.0rc06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7d604e681 | ||
|
|
977f6eba3d | ||
|
|
8f8061adba | ||
|
|
8409b8f6db | ||
|
|
f2e2833f28 | ||
|
|
332594dd06 | ||
|
|
7de3260017 | ||
|
|
e06092a24e | ||
|
|
57731529dc | ||
|
|
9830f98ff9 | ||
|
|
5aff745c15 | ||
|
|
3af77feaa3 | ||
|
|
fd20a5ae9b | ||
|
|
d3b76572c7 | ||
|
|
6e97410f66 | ||
|
|
b2888db940 | ||
|
|
56a739bf4e | ||
|
|
8f6628ed9f | ||
|
|
660c6e4d70 | ||
|
|
4c93a7cb6f | ||
|
|
9a462393e4 | ||
|
|
138142583e | ||
|
|
571db950d1 | ||
|
|
15c9be10b3 | ||
|
|
d5e3590df7 | ||
|
|
b54498edea | ||
|
|
ba851ccd9f | ||
|
|
6f1af78401 | ||
|
|
798b1613ab | ||
|
|
9fa9ebebc0 | ||
|
|
6735058024 | ||
|
|
9f044c17fa | ||
|
|
d02f246887 | ||
|
|
f1cf90238b | ||
|
|
845b74e6d4 | ||
|
|
e24196eeeb | ||
|
|
234e543afb | ||
|
|
49a56e7688 | ||
|
|
5f59c87604 | ||
|
|
23d3970929 | ||
|
|
27df3a44eb | ||
|
|
a451725242 | ||
|
|
d546f4399f | ||
|
|
38ef3a592c | ||
|
|
caed8f30ee | ||
|
|
2fe7f06a55 | ||
|
|
5b40b01319 | ||
|
|
b93e0326d2 | ||
|
|
2776d5e9e6 |
64
ANNOUNCE
64
ANNOUNCE
@@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.5.0beta55 - November 21, 2010
|
||||
Libpng 1.5.0rc06 - January 4, 2011
|
||||
|
||||
This is not intended to be a public release. It will be replaced
|
||||
within a few weeks by a public version or by another test version.
|
||||
@@ -9,20 +9,20 @@ Files available for download:
|
||||
Source files with LF line endings (for Unix/Linux) and with a
|
||||
"configure" script
|
||||
|
||||
1.5.0beta55.tar.xz (LZMA-compressed, recommended)
|
||||
1.5.0beta55.tar.gz
|
||||
1.5.0beta55.tar.bz2
|
||||
1.5.0rc06.tar.xz (LZMA-compressed, recommended)
|
||||
1.5.0rc06.tar.gz
|
||||
1.5.0rc06.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lp150b55.zip
|
||||
lp150b55.7z
|
||||
lp150r06.7z (LZMA-compressed, recommended)
|
||||
lp150r06.zip
|
||||
|
||||
Other information:
|
||||
|
||||
1.5.0beta55-README.txt
|
||||
1.5.0beta55-LICENSE.txt
|
||||
1.5.0rc06-README.txt
|
||||
1.5.0rc06-LICENSE.txt
|
||||
|
||||
Changes since the last public release (1.4.1):
|
||||
|
||||
@@ -226,7 +226,7 @@ version 1.5.0beta24 [May 7, 2010]
|
||||
offset of the png_ptr->rowbuf pointer into png_ptr->big_row_buf.
|
||||
Added more blank lines for readability.
|
||||
|
||||
version 1.5.0beta25 [November 21, 2010]
|
||||
version 1.5.0beta25 [January 4, 2011]
|
||||
In pngpread.c: png_push_have_row() add check for new_row > height
|
||||
Removed the now-redundant check for out-of-bounds new_row from example.c
|
||||
|
||||
@@ -451,6 +451,52 @@ Version 1.5.0beta55 [November 21, 2010]
|
||||
with pngwio.c and pngwutil.c because the 'write' callback and zlib
|
||||
compression both fail to declare their input buffers with 'const'.
|
||||
|
||||
Version 1.5.0beta56 [December 7, 2010]
|
||||
Added the private PNG_UNUSED() macro definition in pngpriv.h.
|
||||
Added some commentary about PNG_EXPORT in png.h and pngconf.h
|
||||
Revised PNG_EXPORT() macro and added PNG_EXPORTA() macro, with the
|
||||
objective of simplifying and improving the cosmetic appearance of png.h.
|
||||
Fixed some incorrect "=" macro names in pnglibconf.dfa
|
||||
Included documentation of changes in 1.5.0 from 1.4.x in libpng-manual.txt
|
||||
|
||||
Version 1.5.0beta57 [December 9, 2010]
|
||||
Documented the pngvalid gamma error summary with additional comments and
|
||||
print statements.
|
||||
Improved missing symbol handling in checksym.awk; symbols missing in both
|
||||
the old and new files can now be optionally ignored, treated as errors
|
||||
or warnings.
|
||||
Removed references to pngvcrd.c and pnggccrd.c from the vstudio project.
|
||||
Updated "libpng14" to "libpng15" in the visualc71 project.
|
||||
Enabled the strip16 tests in pngvalid.`
|
||||
Don't display test results (except PASS/FAIL) when running "make test".
|
||||
Instead put them in pngtest-log.txt
|
||||
Added "--with-zprefix=<string>" to configure.ac
|
||||
Updated the prebuilt configuration files to autoconf version 2.68
|
||||
|
||||
Version 1.5.0beta58 [December 19, 2010]
|
||||
Fixed interlace image handling and add test cases (John Bowler)
|
||||
Fixed the clean rule in Makefile.am to remove pngtest-log.txt
|
||||
Made minor changes to work around warnings in gcc 3.4
|
||||
|
||||
Version 1.5.0rc01 [January 4, 2011]
|
||||
No changes.
|
||||
|
||||
Version 1.5.0rc02 [December 27, 2010]
|
||||
Eliminated references to the scripts/*.def files in project/visualc71.
|
||||
|
||||
Version 1.5.0rc03 [December 28, 2010]
|
||||
Eliminated scripts/*.def and revised Makefile.am accordingly
|
||||
|
||||
Version 1.5.0rc04 [December 29, 2010]
|
||||
Fixed bug in background transformation handling in pngrtran.c (it was
|
||||
looking for the flag in png_ptr->transformations instead of in
|
||||
png_ptr->flags) (David Raymond).
|
||||
|
||||
version 1.5.0rc05 [December 31, 2010]
|
||||
Fixed typo in a comment in CMakeLists.txt (libpng14 => libpng15) (Cosmin)
|
||||
|
||||
version 1.5.0rc06 [January 4, 2011]
|
||||
Changed the new configure option "zprefix=string" to "zlib-prefix=string"
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
||||
(subscription required; visit
|
||||
|
||||
46
CHANGES
46
CHANGES
@@ -3089,6 +3089,52 @@ Version 1.5.0beta55 [November 21, 2010]
|
||||
with pngwio.c and pngwutil.c because the 'write' callback and zlib
|
||||
compression both fail to declare their input buffers with 'const'.
|
||||
|
||||
Version 1.5.0beta56 [December 7, 2010]
|
||||
Added the private PNG_UNUSED() macro definition in pngpriv.h.
|
||||
Added some commentary about PNG_EXPORT in png.h and pngconf.h
|
||||
Revised PNG_EXPORT() macro and added PNG_EXPORTA() macro, with the
|
||||
objective of simplifying and improving the cosmetic appearance of png.h.
|
||||
Fixed some incorrect "=" macro names in pnglibconf.dfa
|
||||
Included documentation of changes in 1.5.0 from 1.4.x in libpng-manual.txt
|
||||
|
||||
Version 1.5.0beta57 [December 9, 2010]
|
||||
Documented the pngvalid gamma error summary with additional comments and
|
||||
print statements.
|
||||
Improved missing symbol handling in checksym.awk; symbols missing in both
|
||||
the old and new files can now be optionally ignored, treated as errors
|
||||
or warnings.
|
||||
Removed references to pngvcrd.c and pnggccrd.c from the vstudio project.
|
||||
Updated "libpng14" to "libpng15" in the visualc71 project.
|
||||
Enabled the strip16 tests in pngvalid.`
|
||||
Don't display test results (except PASS/FAIL) when running "make test".
|
||||
Instead put them in pngtest-log.txt
|
||||
Added "--with-zprefix=<string>" to configure.ac
|
||||
Updated the prebuilt configuration files to autoconf version 2.68
|
||||
|
||||
Version 1.5.0beta58 [December 19, 2010]
|
||||
Fixed interlace image handling and add test cases (John Bowler)
|
||||
Fixed the clean rule in Makefile.am to remove pngtest-log.txt
|
||||
Made minor changes to work around warnings in gcc 3.4
|
||||
|
||||
Version 1.5.0rc01 [December 27, 2010]
|
||||
No changes.
|
||||
|
||||
Version 1.5.0rc02 [December 27, 2010]
|
||||
Eliminated references to the scripts/*.def files in project/visualc71.
|
||||
|
||||
Version 1.5.0rc03 [December 28, 2010]
|
||||
Eliminated scripts/*.def and revised Makefile.am accordingly
|
||||
|
||||
Version 1.5.0rc04 [December 29, 2010]
|
||||
Fixed bug in background transformation handling in pngrtran.c (it was
|
||||
looking for the flag in png_ptr->transformations instead of in
|
||||
png_ptr->flags) (David Raymond).
|
||||
|
||||
version 1.5.0rc05 [December 31, 2010]
|
||||
Fixed typo in a comment in CMakeLists.txt (libpng14 => libpng15) (Cosmin)
|
||||
|
||||
version 1.5.0rc06 [January 4, 2011]
|
||||
Changed the new configure option "zprefix=string" to "zlib-prefix=string"
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
||||
@@ -261,7 +261,7 @@ install(CODE ${PNG_CONFIG_INSTALL_CODE})
|
||||
# SET UP LINKS
|
||||
if(PNG_SHARED)
|
||||
set_target_properties(${PNG_LIB_NAME} PROPERTIES
|
||||
# VERSION 15.${PNGLIB_RELEASE}.1.5.0beta55
|
||||
# VERSION 15.${PNGLIB_RELEASE}.1.5.0rc06
|
||||
VERSION 15.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 15
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
@@ -295,7 +295,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
# Create a symlink for libpng.dll.a => libpng14.dll.a on Cygwin
|
||||
# Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin
|
||||
if(CYGWIN)
|
||||
_png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE
|
||||
${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}
|
||||
|
||||
4
LICENSE
4
LICENSE
@@ -10,7 +10,7 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.0beta55, November 21, 2010, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.0rc06, January 4, 2011, are
|
||||
Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
|
||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
with the following individual added to the list of Contributing Authors
|
||||
@@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
November 21, 2010
|
||||
January 4, 2011
|
||||
|
||||
12
Makefile.am
12
Makefile.am
@@ -17,7 +17,7 @@ pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
pngvalid_SOURCES = pngvalid.c
|
||||
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
TESTS = test-pngtest.sh pngvalid
|
||||
TESTS = test-pngtest.sh test-pngvalid-simple.sh test-pngvalid-full.sh
|
||||
TESTS_ENVIRONMENT= srcdir=$(srcdir)
|
||||
|
||||
# man pages
|
||||
@@ -75,7 +75,7 @@ SCRIPT_CLEANFILES=scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
|
||||
|
||||
CLEANFILES= dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
|
||||
pngwin.def check.new pnglibconf.* symbols.new \
|
||||
check.new pnglibconf.* symbols.new pngtest-log.txt \
|
||||
$(SCRIPT_CLEANFILES)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
@@ -90,7 +90,7 @@ $(PNGLIB_BASENAME)-config: libpng-config
|
||||
cp libpng-config $@
|
||||
|
||||
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
|
||||
scripts/symbols.out scripts/pngwin.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt
|
||||
scripts/symbols.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt
|
||||
|
||||
libpng.sym: scripts/sym.out
|
||||
rm -f $@
|
||||
@@ -98,9 +98,6 @@ libpng.sym: scripts/sym.out
|
||||
libpng.vers: scripts/vers.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
pngwin.def: scripts/pngwin.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
pnglibconf.h: pnglibconf.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
@@ -140,7 +137,6 @@ pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk
|
||||
mv dfn2.out $@
|
||||
|
||||
# Symbol checks (.def and .out files should match)
|
||||
scripts/pngwin.chk: scripts/checksym.awk scripts/pngwin.def scripts/pngwin.out
|
||||
scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
|
||||
.out.chk:
|
||||
rm -f $@ symbols.new
|
||||
@@ -166,7 +162,7 @@ $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
|
||||
test: check-am
|
||||
|
||||
# Extra checks
|
||||
check: scripts/symbols.chk scripts/pngwin.chk
|
||||
check: scripts/symbols.chk
|
||||
|
||||
# Don't distribute the generated script files
|
||||
dist-hook:
|
||||
|
||||
36
Makefile.in
36
Makefile.in
@@ -41,7 +41,6 @@ POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
check_PROGRAMS = pngtest$(EXEEXT) pngvalid$(EXEEXT)
|
||||
TESTS = test-pngtest.sh pngvalid$(EXEEXT)
|
||||
@HAVE_LD_VERSION_SCRIPT_TRUE@am__append_1 = -Wl,--version-script=libpng.vers
|
||||
@HAVE_LD_VERSION_SCRIPT_FALSE@am__append_2 = -export-symbols libpng.sym
|
||||
subdir = .
|
||||
@@ -146,21 +145,8 @@ DATA = $(pkgconfig_DATA)
|
||||
HEADERS = $(nodist_pkginclude_HEADERS) $(pkginclude_HEADERS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
# If stdout is a non-dumb tty, use colors. If test -t is not supported,
|
||||
# then this fails; a conservative approach. Of course do not redirect
|
||||
# stdout here, just stderr.
|
||||
am__tty_colors = \
|
||||
red=; grn=; lgn=; blu=; std=; \
|
||||
test "X$(AM_COLOR_TESTS)" != Xno \
|
||||
&& test "X$$TERM" != Xdumb \
|
||||
&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
|
||||
&& { \
|
||||
red='[0;31m'; \
|
||||
grn='[0;32m'; \
|
||||
lgn='[1;32m'; \
|
||||
blu='[1;34m'; \
|
||||
std='[m'; \
|
||||
}
|
||||
red=; grn=; lgn=; blu=; std=
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
@@ -217,6 +203,7 @@ LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
@@ -248,6 +235,7 @@ abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
@@ -283,7 +271,6 @@ libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
lt_ECHO = @lt_ECHO@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
@@ -306,11 +293,16 @@ top_srcdir = @top_srcdir@
|
||||
PNGLIB_BASENAME = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@
|
||||
|
||||
# libpng does not follow GNU file name conventions
|
||||
AUTOMAKE_OPTIONS = foreign color-tests
|
||||
|
||||
# "color-tests" requires automake 1.11.1 or later. Enable it if you like,
|
||||
# to get red "FAIL" and green "PASS" notations during tests.
|
||||
# AUTOMAKE_OPTIONS = foreign color-tests
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
pngtest_SOURCES = pngtest.c
|
||||
pngtest_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
pngvalid_SOURCES = pngvalid.c
|
||||
pngvalid_LDADD = libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.la
|
||||
TESTS = test-pngtest.sh test-pngvalid-simple.sh test-pngvalid-full.sh
|
||||
TESTS_ENVIRONMENT = srcdir=$(srcdir)
|
||||
|
||||
# man pages
|
||||
@@ -349,7 +341,7 @@ EXTRA_DIST = \
|
||||
SCRIPT_CLEANFILES = scripts/*.out scripts/*.chk scripts/pnglibconf.dfn
|
||||
CLEANFILES = dfn.c dfn?.out pngout.png libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@.pc \
|
||||
libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@-config libpng.vers libpng.sym \
|
||||
pngwin.def check.new pnglibconf.* symbols.new \
|
||||
check.new pnglibconf.* symbols.new pngtest-log.txt \
|
||||
$(SCRIPT_CLEANFILES)
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.h.in \
|
||||
@@ -1261,7 +1253,7 @@ $(PNGLIB_BASENAME)-config: libpng-config
|
||||
cp libpng-config $@
|
||||
|
||||
scripts/sym.out scripts/vers.out: png.h pngconf.h pnglibconf.h
|
||||
scripts/symbols.out scripts/pngwin.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt
|
||||
scripts/symbols.out: png.h pngconf.h scripts/pnglibconf.h.prebuilt
|
||||
|
||||
libpng.sym: scripts/sym.out
|
||||
rm -f $@
|
||||
@@ -1269,9 +1261,6 @@ libpng.sym: scripts/sym.out
|
||||
libpng.vers: scripts/vers.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
pngwin.def: scripts/pngwin.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
pnglibconf.h: pnglibconf.out
|
||||
rm -f $@
|
||||
cp $? $@
|
||||
@@ -1307,7 +1296,6 @@ pnglibconf.dfn: scripts/pnglibconf.dfa scripts/options.awk
|
||||
mv dfn2.out $@
|
||||
|
||||
# Symbol checks (.def and .out files should match)
|
||||
scripts/pngwin.chk: scripts/checksym.awk scripts/pngwin.def scripts/pngwin.out
|
||||
scripts/symbols.chk: scripts/checksym.awk scripts/symbols.def scripts/symbols.out
|
||||
.out.chk:
|
||||
rm -f $@ symbols.new
|
||||
@@ -1333,7 +1321,7 @@ $(libpng@PNGLIB_MAJOR@@PNGLIB_MINOR@_la_OBJECTS): png.h pngconf.h \
|
||||
test: check-am
|
||||
|
||||
# Extra checks
|
||||
check: scripts/symbols.chk scripts/pngwin.chk
|
||||
check: scripts/symbols.chk
|
||||
|
||||
# Don't distribute the generated script files
|
||||
dist-hook:
|
||||
|
||||
2
README
2
README
@@ -1,4 +1,4 @@
|
||||
README for libpng version 1.5.0beta55 - November 21, 2010 (shared library 15.0)
|
||||
README for libpng version 1.5.0rc06 - January 4, 2011 (shared library 15.0)
|
||||
See the note about version numbers near the top of png.h
|
||||
|
||||
See INSTALL for instructions on how to install libpng.
|
||||
|
||||
2081
aclocal.m4
vendored
2081
aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
196
config.guess
vendored
196
config.guess
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-04-27'
|
||||
timestamp='2009-11-20'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
@@ -27,16 +27,16 @@ timestamp='2009-04-27'
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner <per@bothner.com>.
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit build system type.
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
|
||||
eval $set_cc_for_build
|
||||
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep __ELF__ >/dev/null
|
||||
| grep -q __ELF__
|
||||
then
|
||||
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
|
||||
# Return netbsd for either. FIX?
|
||||
@@ -333,6 +333,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
|
||||
echo i386-pc-auroraux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
@@ -656,7 +659,7 @@ EOF
|
||||
# => hppa64-hp-hpux11.23
|
||||
|
||||
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
|
||||
grep __LP64__ >/dev/null
|
||||
grep -q __LP64__
|
||||
then
|
||||
HP_ARCH="hppa2.0w"
|
||||
else
|
||||
@@ -807,12 +810,12 @@ EOF
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd | genuineintel)
|
||||
authenticamd | genuineintel | EM64T)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
@@ -822,6 +825,9 @@ EOF
|
||||
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
|
||||
echo i${UNAME_MACHINE}-pc-mks
|
||||
exit ;;
|
||||
8664:Windows_NT:*)
|
||||
echo x86_64-pc-mks
|
||||
exit ;;
|
||||
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
|
||||
@@ -851,6 +857,20 @@ EOF
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
@@ -873,6 +893,17 @@ EOF
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
LIBC=gnu
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
@@ -882,78 +913,34 @@ EOF
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
mips:Linux:*:*)
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips
|
||||
#undef mipsel
|
||||
#undef ${UNAME_MACHINE}
|
||||
#undef ${UNAME_MACHINE}el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mipsel
|
||||
CPU=${UNAME_MACHINE}el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips
|
||||
CPU=${UNAME_MACHINE}
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#undef CPU
|
||||
#undef mips64
|
||||
#undef mips64el
|
||||
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
|
||||
CPU=mips64el
|
||||
#else
|
||||
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
|
||||
CPU=mips64
|
||||
#else
|
||||
CPU=
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
@@ -962,8 +949,11 @@ EOF
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
@@ -986,66 +976,6 @@ EOF
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
a.out-i386-linux)
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
|
||||
exit ;;
|
||||
"")
|
||||
# Either a pre-BFD a.out linker (linux-gnuoldld) or
|
||||
# one that does not give us useful --help.
|
||||
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
|
||||
exit ;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
}
|
||||
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
# earlier versions are messed up and put the nodename in both
|
||||
@@ -1074,7 +1004,7 @@ EOF
|
||||
i*86:syllable:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-syllable
|
||||
exit ;;
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
|
||||
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
|
||||
echo i386-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i*86:*DOS:*:*)
|
||||
@@ -1182,7 +1112,7 @@ EOF
|
||||
rs6000:LynxOS:2.*:*)
|
||||
echo rs6000-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
|
||||
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
|
||||
echo powerpc-unknown-lynxos${UNAME_RELEASE}
|
||||
exit ;;
|
||||
SM[BE]S:UNIX_SV:*:*)
|
||||
@@ -1275,6 +1205,16 @@ EOF
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386)
|
||||
eval $set_cc_for_build
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
UNAME_PROCESSOR="x86_64"
|
||||
fi
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
|
||||
43
config.sub
vendored
43
config.sub
vendored
@@ -1,10 +1,10 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-04-17'
|
||||
timestamp='2009-11-20'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
@@ -32,13 +32,16 @@ timestamp='2009-04-17'
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted ChangeLog entry.
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
# If it is invalid, we print an error message on stderr and exit with code 1.
|
||||
# Otherwise, we print the canonical config type on stdout and succeed.
|
||||
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
|
||||
|
||||
# This file is supposed to be the same for all GNU packages
|
||||
# and recognize all the CPU types, system types and aliases
|
||||
# that are meaningful with *any* GNU software.
|
||||
@@ -149,10 +152,13 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray)
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
basic_machine=$1
|
||||
@@ -281,6 +287,7 @@ case $basic_machine in
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| pyramid \
|
||||
| rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
@@ -288,13 +295,14 @@ case $basic_machine in
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | picochip)
|
||||
# Motorola 68HC11/12.
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
@@ -337,7 +345,7 @@ case $basic_machine in
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@@ -365,7 +373,7 @@ case $basic_machine in
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
@@ -374,6 +382,7 @@ case $basic_machine in
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| tron-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
@@ -467,6 +476,10 @@ case $basic_machine in
|
||||
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
os=-linux
|
||||
;;
|
||||
bluegene*)
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
@@ -719,6 +732,9 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
os=-mingw32
|
||||
@@ -1240,6 +1256,9 @@ case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
@@ -1260,9 +1279,9 @@ case $os in
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -kopensolaris* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
@@ -1283,7 +1302,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@@ -1613,7 +1632,7 @@ case $basic_machine in
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-aix*)
|
||||
-cnk*|-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
-beos*)
|
||||
|
||||
14
configure.ac
14
configure.ac
@@ -18,12 +18,12 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.5.0beta55], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.5.0rc06], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.5.0beta55
|
||||
PNGLIB_VERSION=1.5.0rc06
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=5
|
||||
PNGLIB_RELEASE=0
|
||||
@@ -57,7 +57,15 @@ AC_STRUCT_TM
|
||||
AC_FUNC_STRTOD
|
||||
AC_CHECK_FUNCS([memset], , AC_ERROR([memset not found in libc]))
|
||||
AC_CHECK_FUNCS([pow], , AC_CHECK_LIB(m, pow, , AC_ERROR([cannot find pow])) )
|
||||
AC_CHECK_LIB(z, zlibVersion, , AC_ERROR([zlib not installed]))
|
||||
AC_ARG_WITH(zlib-prefix,
|
||||
AC_HELP_STRING([--with-zlib-prefix],
|
||||
[prefix that may have been used in installed zlib]),
|
||||
[ZPREFIX=${withval}],
|
||||
[ZPREFIX='z_'])
|
||||
AC_CHECK_LIB(z, zlibVersion, ,
|
||||
AC_CHECK_LIB(z, ${ZPREFIX}zlibVersion, ,
|
||||
AC_ERROR([zlib not installed])))
|
||||
|
||||
|
||||
LIBPNG_DEFINES=-DPNG_CONFIGURE_LIBPNG
|
||||
LIBPNG_DEFINES=$LIBPNG_DEFINES
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.5.0beta55 - November 21, 2010
|
||||
libpng version 1.5.0rc06 - January 4, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
@@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.5.0beta55 - November 21, 2010
|
||||
libpng versions 0.97, January 1998, through 1.5.0rc06 - January 4, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
@@ -145,6 +145,10 @@ the full range of (png_fixed_point) (-21474 to +21474). When APIs require
|
||||
a non-negative argument the type is recorded as png_uint_32 above. Consult
|
||||
the header file and the text below for more information.
|
||||
|
||||
Special care must be take with sCAL chunk handling because the chunk itself
|
||||
uses non-integral values encoded as strings containing decimal floating point
|
||||
numbers. See the comments in the header file.
|
||||
|
||||
Configuration
|
||||
|
||||
The main header file function declarations are frequently protected by C
|
||||
@@ -161,6 +165,115 @@ portability. From libpng 1.5.0 the feature macros set during the build
|
||||
of libpng are recorded in the header file "pnglibconf.h" and this file
|
||||
is always included by png.h.
|
||||
|
||||
If you don't need to change the library configuration from the default skip to
|
||||
the next section ("Reading").
|
||||
|
||||
Notice that some of the makefiles in the 'scripts' directory and (in 1.5.0) all
|
||||
of the build project files in the 'projects' directory simply copy
|
||||
scripts/pnglibconf.h.prebuilt to pnglibconf.h. This means that these build
|
||||
systems do not permit easy auto-configuration of the library - they only
|
||||
support the default configuration.
|
||||
|
||||
The easiest way to make minor changes to the libpng configuration when
|
||||
auto-configuration is supported is to add definitions to the command line
|
||||
using (typically) CPPFLAGS. For example:
|
||||
|
||||
CPPFLAGS=-DPNG_NO_FLOATING_ARITHMETIC
|
||||
|
||||
will change the internal libpng math implementation for gamma correction and
|
||||
other arithmetic calculations to fixed point, avoiding the need for fast
|
||||
floating point support. The result can be seen in the generated pnglibconf.h -
|
||||
make sure it contains the changed feature macro setting.
|
||||
|
||||
If you need to make more extensive configuration changes - more than one or two
|
||||
feature macro settings - you can either add -DPNG_USER_CONFIG to the build
|
||||
command line and put a list of feature macro settings in pngusr.h or you can set
|
||||
DFA_XTRA (a makefile variable) to a file containing the same information in the
|
||||
form of 'option' settings.
|
||||
|
||||
A. Changing pnglibconf.h
|
||||
|
||||
A variety of methods exist to build libpng. Not all of these support
|
||||
reconfiguration of pnglibconf.h. To reconfigure pnglibconf.h it must either be
|
||||
rebuilt from scripts/pnglibconf.dfa using awk or it must be edited by hand.
|
||||
|
||||
Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt and changing
|
||||
the lines defining the supported features, paying very close attention to the
|
||||
'option' information in scripts/pnglibconf.dfa that describes those features and
|
||||
their requirements. This is easy to get wrong.
|
||||
|
||||
B. Configuration using DFA_XTRA
|
||||
|
||||
Rebuilding from pnglibconf.dfa is easy if a functioning 'awk', or a later
|
||||
variant such as 'nawk' or 'gawk', is available. The configure build will
|
||||
automatically find an appropriate awk and build pnglibconf.h.
|
||||
scripts/pnglibconf.mak contains a set of make rules for doing the same thing if
|
||||
configure is not used, and many of the makefiles in the scripts directory use
|
||||
this approach.
|
||||
|
||||
When rebuilding simply write new file containing changed options and set
|
||||
DFA_XTRA to the name of this file. This causes the build to append the new file
|
||||
to the end of scripts/pnglibconf.dfa. pngusr.dfa should contain lines of the
|
||||
following forms:
|
||||
|
||||
everything = off
|
||||
|
||||
This turns all optional features off. Include it at the start of pngusr.dfa to
|
||||
make it easier to build a minimal configuration. You will need to turn at least
|
||||
some features on afterward to enable either reading or writing code, or both.
|
||||
|
||||
option feature on
|
||||
option feature off
|
||||
|
||||
Enable or disable a single feature. This will automatically enable other
|
||||
features required by a feature that is turned on or disable other features that
|
||||
require a feature which is turned off. Conflicting settings will cause an error
|
||||
message to be emitted by awk.
|
||||
|
||||
setting feature default value
|
||||
|
||||
Changes the default value of setting 'feature' to 'value'. There are a small
|
||||
number of settings listed at the top of pnglibconf.h, they are documented in the
|
||||
source code. Most of these values have performance implications for the library
|
||||
but most of them have no visible effect on the API. Some can also be overridden
|
||||
from the API.
|
||||
|
||||
C. Configuration using PNG_USR_CONFIG
|
||||
|
||||
If -DPNG_USR_CONFIG is added to the CFLAGS when pnglibconf.h is built the file
|
||||
pngusr.h will automatically be included before the options in
|
||||
scripts/pnglibconf.dfa are processed. pngusr.h should contain only macro
|
||||
definitions turning features on or off or setting settings.
|
||||
|
||||
Apart from the global setting "everything = off" all the options listed above
|
||||
can be set using macros in pngusr.h:
|
||||
|
||||
#define PNG_feature_SUPPORTED
|
||||
|
||||
is equivalent to:
|
||||
|
||||
option feature on
|
||||
|
||||
#define PNG_NO_feature
|
||||
|
||||
is equivalent to:
|
||||
|
||||
option feature off
|
||||
|
||||
#define PNG_feature value
|
||||
|
||||
is equivalent to:
|
||||
|
||||
setting feature default value
|
||||
|
||||
Notice that in both cases, pngusr.dfa and pngusr.h, the contents of the
|
||||
pngusr file you supply override the contents of scripts/pnglibconf.dfa
|
||||
|
||||
If confusing or incomprehensible behavior results it is possible to
|
||||
examine the intermediate file pnglibconf.dfn to find the full set of
|
||||
dependency information for each setting and option. Simply locate the
|
||||
feature in the file and read the C comments that precede it.
|
||||
|
||||
III. Reading
|
||||
|
||||
We'll now walk you through the possible functions to call when reading
|
||||
@@ -905,7 +1018,6 @@ For example, 4 bit/pixel paletted or grayscale data will be returned
|
||||
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
||||
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
||||
in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha()
|
||||
%10%in RGB RGB RGB format unless png_set_filler()
|
||||
is called to insert filler bytes, either before or after each RGB triplet.
|
||||
16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant
|
||||
byte of the color value first, unless png_set_strip_16() is called to
|
||||
@@ -914,7 +1026,6 @@ png_set_add alpha() is called to insert filler bytes, either before or
|
||||
after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can
|
||||
be modified with
|
||||
png_set_filler(), png_set_add_alpha(), or png_set_strip_16().
|
||||
%10%png_set_filler() or png_set_strip_16().
|
||||
|
||||
The following code transforms grayscale images of less than 8 to 8 bits,
|
||||
changes paletted images to RGB, and adds a full alpha channel if there is
|
||||
@@ -927,7 +1038,6 @@ viewing application that wishes to treat all images in the same way.
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY &&
|
||||
bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||
%10% bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
||||
|
||||
if (png_get_valid(png_ptr, info_ptr,
|
||||
PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
||||
@@ -940,7 +1050,7 @@ things.
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
|
||||
As of libpng version 1.5.0beta55, not all possible expansions are supported.
|
||||
As of libpng version 1.5.0rc06, not all possible expansions are supported.
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
indexed with depth<8, other numerals represent the color type, "T" means
|
||||
@@ -1317,6 +1427,15 @@ are allocating one large chunk, you will need to build an
|
||||
array of pointers to each row, as it will be needed for some
|
||||
of the functions below.
|
||||
|
||||
Remember: Before you call png_read_update_info the png_get_
|
||||
functions return the values corresponding to the original PNG image.
|
||||
After you call png_read_update_info the values refer to the image
|
||||
that libpng will output. Consequently you must call all the png_set_
|
||||
functions before you call png_read_update_info. This is particularly
|
||||
important for png_set_interlace_handling - if you are going to call
|
||||
png_read_update_info you must call png_set_interlace_handling before
|
||||
it unless you want to receive interlaced output.
|
||||
|
||||
Reading image data
|
||||
|
||||
After you've allocated memory, you can read the image data.
|
||||
@@ -1326,9 +1445,10 @@ call png_read_image() and libpng will read in all the image data
|
||||
and put it in the memory area supplied. You will need to pass in
|
||||
an array of pointers to each row.
|
||||
|
||||
This function automatically handles interlacing, so you don't need
|
||||
to call png_set_interlace_handling() or call this function multiple
|
||||
times, or any of that other stuff necessary with png_read_rows().
|
||||
This function automatically handles interlacing, so you don't
|
||||
need to call png_set_interlace_handling() (unless you call
|
||||
png_read_update_info()) or call this function multiple times, or any
|
||||
of that other stuff necessary with png_read_rows().
|
||||
|
||||
png_read_image(png_ptr, row_pointers);
|
||||
|
||||
@@ -1355,13 +1475,15 @@ a single row_pointer instead of an array of row_pointers:
|
||||
|
||||
If the file is interlaced (interlace_type != 0 in the IHDR chunk), things
|
||||
get somewhat harder. The only current (PNG Specification version 1.2)
|
||||
interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
is a somewhat complicated 2D interlace scheme, known as Adam7, that
|
||||
interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7);
|
||||
a somewhat complicated 2D interlace scheme, known as Adam7, that
|
||||
breaks down an image into seven smaller images of varying size, based
|
||||
on an 8x8 grid.
|
||||
on an 8x8 grid. This number is defined (from libpng 1.5) as
|
||||
PNG_INTERLACE_ADAM7_PASSES in png.h
|
||||
|
||||
libpng can fill out those images or it can give them to you "as is".
|
||||
If you want them filled out, there are two ways to do that. The one
|
||||
It is almost always better to have libpng handle the interlacing for you.
|
||||
If you want the images filled out, there are two ways to do that. The one
|
||||
mentioned in the PNG specification is to expand each pixel to cover
|
||||
those pixels that have not been read yet (the "rectangle" method).
|
||||
This results in a blocky image for the first pass, which gradually
|
||||
@@ -1371,65 +1493,20 @@ rest of the image remaining whatever colors they were initialized to
|
||||
before the start of the read. The first method usually looks better,
|
||||
but tends to be slower, as there are more pixels to put in the rows.
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just call
|
||||
png_read_rows() seven times to read in all seven images. Each of the
|
||||
images is a valid image by itself, or they can all be combined on an
|
||||
8x8 grid to form a single image (although if you intend to combine them
|
||||
you would be far better off using the libpng interlace handling).
|
||||
|
||||
The first pass will return an image 1/8 as wide as the entire image
|
||||
(every 8th column starting in column 0) and 1/8 as high as the original
|
||||
(every 8th row starting in row 0), the second will be 1/8 as wide
|
||||
(starting in column 4) and 1/8 as high (also starting in row 0). The
|
||||
third pass will be 1/4 as wide (every 4th pixel starting in column 0) and
|
||||
1/8 as high (every 8th row starting in row 4), and the fourth pass will
|
||||
be 1/4 as wide and 1/4 as high (every 4th column starting in column 2,
|
||||
and every 4th row starting in row 0). The fifth pass will return an
|
||||
image 1/2 as wide, and 1/4 as high (starting at column 0 and row 2),
|
||||
while the sixth pass will be 1/2 as wide and 1/2 as high as the original
|
||||
(starting in column 1 and row 0). The seventh and final pass will be as
|
||||
wide as the original, and 1/2 as high, containing all of the odd
|
||||
numbered scanlines. Phew!
|
||||
|
||||
If you want to retrieve the separate images you must pass the correct
|
||||
number of rows to each successive call of png_read_rows().
|
||||
Calculating the number isn't quite as straightforward as the previous
|
||||
paragraph might suggest; think about what happens with an image with a odd
|
||||
number of rows, which passes get the extra row? To help you libpng 1.5.0
|
||||
implements a function to return the number of rows and columns in the current
|
||||
pass:
|
||||
|
||||
int number_of_rows = png_get_num_rows(png_ptr);
|
||||
int number_of_cols = png_get_num_cols(png_ptr);
|
||||
|
||||
Simply call that before each call to png_read_rows(). You must call
|
||||
png_start_read_image() (or png_read_update_info) before the first call to
|
||||
ensure that the number libpng holds internally has been updated.
|
||||
|
||||
For very small interlaced images the number of rows or columns in a pass
|
||||
can be zero.
|
||||
You don't need to call png_read_rows() in this case, libpng will simply
|
||||
skip to the next pass.
|
||||
|
||||
If you want libpng to expand the images, call this before calling
|
||||
png_start_read_image() or png_read_update_info():
|
||||
If, as is likely, you want libpng to expand the images, call this before
|
||||
calling png_start_read_image() or png_read_update_info():
|
||||
|
||||
if (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
number_of_passes
|
||||
= png_set_interlace_handling(png_ptr);
|
||||
|
||||
This will return the number of passes needed. Currently, this
|
||||
is seven, but may change if another interlace type is added.
|
||||
This function can be called even if the file is not interlaced,
|
||||
where it will return one pass.
|
||||
|
||||
If you need to get the number of passes later (for example after the call
|
||||
to png_start_read_image()) just call:
|
||||
|
||||
number_of_passes = png_get_num_passes(png_ptr);
|
||||
|
||||
This function just returns the number - it doesn't make any changes to the
|
||||
libpng state.
|
||||
This will return the number of passes needed. Currently, this is seven,
|
||||
but may change if another interlace type is added. This function can be
|
||||
called even if the file is not interlaced, where it will return one pass.
|
||||
You then need to read the whole image 'number_of_passes' times. Each time
|
||||
will distribute the pixels from the current pass to the correct place in
|
||||
the output image, so you need to supply the same rows to png_read_rows in
|
||||
each pass.
|
||||
|
||||
If you are not going to display the image after each pass, but are
|
||||
going to wait until the entire image is read in, use the sparkle
|
||||
@@ -1455,6 +1532,94 @@ the second parameter NULL.
|
||||
png_read_rows(png_ptr, NULL, row_pointers,
|
||||
number_of_rows);
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just call
|
||||
png_read_rows() PNG_INTERLACE_ADAM7_PASSES times to read in all the images.
|
||||
Each of the images is a valid image by itself, however you will almost
|
||||
certainly need to distribute the pixels from each sub-image to the
|
||||
correct place. This is where everything gets very tricky.
|
||||
|
||||
If you want to retrieve the separate images you must pass the correct
|
||||
number of rows to each successive call of png_read_rows(). The calculation
|
||||
gets pretty complicated for small images, where some sub-images may
|
||||
not even exist because either their width or height ends up zero.
|
||||
libpng provides two macros to help you in 1.5 and later versions:
|
||||
|
||||
png_uint_32 width = PNG_PASS_COLS(image_width, pass_number);
|
||||
png_uint_32 height = PNG_PASS_ROWS(image_height, pass_number);
|
||||
|
||||
Respectively these tell you the width and height of the sub-image
|
||||
corresponding to the numbered pass. 'pass' is in in the range 0 to 6 -
|
||||
this can be confusing because the specification refers to the same passes
|
||||
as 1 to 7! Be careful, you must check both the width and height before
|
||||
calling png_read_rows() and not call it for that pass if either is zero.
|
||||
|
||||
You can, of course, read each sub-image row by row. If you want to
|
||||
produce optimal code to make a pixel-by-pixel transformation of an
|
||||
interlaced image this is the best approach; read each row of each pass,
|
||||
transform it, and write it out to a new interlaced image.
|
||||
|
||||
If you want to de-interlace the image yourself libpng provides further
|
||||
macros to help that tell you where to place the pixels in the output image.
|
||||
Because the interlacing scheme is rectangular - sub-image pixels are always
|
||||
arranged on a rectangular grid - all you need to know for each pass is the
|
||||
starting column and row in the output image of the first pixel plus the
|
||||
spacing between each pixel. As of libpng 1.5 there are four macros to
|
||||
retrieve this information:
|
||||
|
||||
png_uint_32 x = PNG_PASS_START_COL(pass);
|
||||
png_uint_32 y = PNG_PASS_START_ROW(pass);
|
||||
png_uint_32 xStep = 1U << PNG_PASS_COL_SHIFT(pass);
|
||||
png_uint_32 yStep = 1U << PNG_PASS_ROW_SHIFT(pass);
|
||||
|
||||
These allow you to write the obvious loop:
|
||||
|
||||
png_uint_32 input_y = 0;
|
||||
png_uint_32 output_y = PNG_PASS_START_ROW(pass);
|
||||
|
||||
while (output_y < output_image_height)
|
||||
{
|
||||
png_uint_32 input_x = 0;
|
||||
png_uint_32 output_x = PNG_PASS_START_COL(pass);
|
||||
|
||||
while (output_x < output_image_width)
|
||||
{
|
||||
image[output_y][output_x] = subimage[pass][input_y][input_x++];
|
||||
output_x += xStep;
|
||||
}
|
||||
|
||||
++input_y;
|
||||
ouput_y += yStep;
|
||||
}
|
||||
|
||||
Notice that the steps between successive output rows and columns are
|
||||
returned as shifts. This is possible because the pixels in the subimages
|
||||
are always a power of 2 apart - 1, 2, 4 or 8 pixels - in the original
|
||||
image. In practice you may need to directly calculate the output coordinate
|
||||
given an input coordinate. libpng provides two further macros for this
|
||||
purpose:
|
||||
|
||||
png_uint_32 output_x = PNG_COL_FROM_PASS_COL(input_x, pass);
|
||||
png_uint_32 output_y = PNG_ROW_FROM_PASS_ROW(input_y, pass);
|
||||
|
||||
Finally a pair of macros are provided to tell you if a particular image
|
||||
row or column appears in a given pass:
|
||||
|
||||
int col_in_pass = PNG_COL_IN_INTERLACE_PASS(output_x, pass);
|
||||
int row_in_pass = PNG_ROW_IN_INTERLACE_PASS(output_y, pass);
|
||||
|
||||
Bear in mind that you will probably also need to check the width and height
|
||||
of the pass in addition to the above to be sure the pass even exists!
|
||||
|
||||
With any luck you are convinced by now that you don't want to do your own
|
||||
interlace handling. In reality normally the only good reason for doing this
|
||||
is if you are processing PNG files on a pixel-by-pixel basis and don't want
|
||||
to load the whole file into memory when it is interlaced.
|
||||
|
||||
libpng includes a test program, pngvalid, that illustrates reading and
|
||||
writing of interlaced images. If you can't get interlacing to work in your
|
||||
code and don't want to leave it to libpng (the recommended approach) see
|
||||
how pngvalid.c does it.
|
||||
|
||||
Finishing a sequential read
|
||||
|
||||
After you are finished reading the image through the
|
||||
@@ -1660,6 +1825,9 @@ png_infop info_ptr;
|
||||
any). You may start getting rows before
|
||||
png_process_data() returns, so this is your
|
||||
last chance to prepare for that.
|
||||
|
||||
This is where you turn on interlace handling,
|
||||
assuming you don't want to do it yourself.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1680,14 +1848,22 @@ png_infop info_ptr;
|
||||
supplying them because it may make your life
|
||||
easier.
|
||||
|
||||
For the non-NULL rows of interlaced images,
|
||||
If you did not turn on interlace handling then
|
||||
the callback is called for each row of each
|
||||
sub-image when the image is interlaced. In this
|
||||
case 'row_num' is the row in the sub-image, not
|
||||
the row in the output image as it is in all other
|
||||
cases.
|
||||
|
||||
For the non-NULL rows of interlaced images when
|
||||
you have switched on libpng interlace handling,
|
||||
you must call png_progressive_combine_row()
|
||||
passing in the row and the old row. You can
|
||||
call this function for NULL rows (it will just
|
||||
return) and for non-interlaced images (it just
|
||||
does the memcpy for you) if it will make the
|
||||
code easier. Thus, you can just do this for
|
||||
all cases:
|
||||
all cases if you switch on interlace handling;
|
||||
*/
|
||||
|
||||
png_progressive_combine_row(png_ptr, old_row,
|
||||
@@ -1863,11 +2039,10 @@ filter types.
|
||||
PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
|
||||
PNG_ALL_FILTERS);
|
||||
|
||||
If an application
|
||||
wants to start and stop using particular filters during compression,
|
||||
it should start out with all of the filters (to ensure that the previous
|
||||
row of pixels will be stored in case it's needed later), and then add
|
||||
and remove them after the start of compression.
|
||||
If an application wants to start and stop using particular filters during
|
||||
compression, it should start out with all of the filters (to ensure that
|
||||
the previous row of pixels will be stored in case it's needed later),
|
||||
and then add and remove them after the start of compression.
|
||||
|
||||
If you are writing a PNG datastream that is to be embedded in a MNG
|
||||
datastream, the second parameter can be either 0 or 64.
|
||||
@@ -2466,25 +2641,39 @@ for details of which pixels to write when.
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just
|
||||
use png_set_interlace_handling() and call png_write_rows() the
|
||||
correct number of times to write all seven sub-images.
|
||||
correct number of times to write all the sub-images
|
||||
(png_set_interlace_handling() returns the number of sub-images.)
|
||||
|
||||
If you want libpng to build the sub-images, call this before you start
|
||||
writing any rows:
|
||||
|
||||
number_of_passes =
|
||||
png_set_interlace_handling(png_ptr);
|
||||
number_of_passes = png_set_interlace_handling(png_ptr);
|
||||
|
||||
This will return the number of passes needed. Currently, this is seven,
|
||||
but may change if another interlace type is added.
|
||||
|
||||
Then write the complete image number_of_passes times.
|
||||
|
||||
png_write_rows(png_ptr, row_pointers,
|
||||
number_of_rows);
|
||||
png_write_rows(png_ptr, row_pointers, number_of_rows);
|
||||
|
||||
As some of these rows are not used, and thus return immediately, you may
|
||||
want to read about interlacing in the PNG specification, and only update
|
||||
the rows that are actually used.
|
||||
Think carefully before you write an interlaced image. Typically code that
|
||||
reads such images reads all the image data into memory, uncompressed, before
|
||||
doing any processing. Only code that can display an image on the fly can
|
||||
take advantage of the interlacing and even then the image has to be exactly
|
||||
the correct size for the output device, because scaling an image requires
|
||||
adjacent pixels and these are not available until all the passes have been
|
||||
read.
|
||||
|
||||
If you do write an interlaced image you will hardly ever need to handle
|
||||
the interlacing yourself. Call png_set_interlace_handling() and use the
|
||||
approach described above.
|
||||
|
||||
The only time it is conceivable that you will really need to write an
|
||||
interlaced image pass-by-pass is when you have read one pass by pass and
|
||||
made some pixel-by-pixel transformation to it, as described in the read
|
||||
code above. In this case use the PNG_PASS_ROWS and PNG_PASS_COLS macros
|
||||
to determine the size of each sub-image in turn and simply write the rows
|
||||
you obtained from the read code.
|
||||
|
||||
Finishing a sequential write
|
||||
|
||||
@@ -3030,7 +3219,6 @@ application:
|
||||
|
||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||
|
||||
%10%.SH VIII. (Omitted).
|
||||
VIII. Changes to Libpng from version 1.0.x to 1.2.x
|
||||
|
||||
Support for user memory management was enabled by default. To
|
||||
@@ -3191,6 +3379,12 @@ deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8() because the former function also
|
||||
expanded palette images.
|
||||
|
||||
Macros for png_get_uint_16, png_get_uint_32, and png_get_int_32
|
||||
were added and are used by default instead of the corresponding
|
||||
functions. Unfortunately,
|
||||
from libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
@@ -3228,7 +3422,257 @@ PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS.
|
||||
|
||||
We removed the trailing '.' from the warning and error messages.
|
||||
|
||||
X. Detecting libpng
|
||||
X. 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
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
A. Changes that affect users of libpng
|
||||
|
||||
There are no substantial API changes between the non-deprecated parts of
|
||||
the 1.4.5 API and the 1.5.0 API, however the ability to directly access
|
||||
the main libpng control structures, png_struct and png_info, deprecated
|
||||
in earlier versions of libpng, has been completely removed from
|
||||
libpng 1.5.
|
||||
|
||||
There are changes of form in png.h, including new and changed macros to
|
||||
declare
|
||||
parts of the API. Some API functions with arguments that are points to
|
||||
data not modified within the function have been corrected to declare
|
||||
these arguments with PNG_CONST.
|
||||
|
||||
Much of the internal use of C macros to control the library build has also
|
||||
changed and some of this is visible in the exported header files, in
|
||||
particular the use of macros to control data and API elements visible
|
||||
during application compilation may require significant revision to
|
||||
application code. (It is extremely rare for an application to do this.)
|
||||
|
||||
Any program that compiled against libpng 1.4 and did not use deprecated
|
||||
features or access internal library structures should compile and work
|
||||
against libpng 1.5.
|
||||
|
||||
libpng 1.5.0 adds PNG_ PASS macros to help in the reading and writing of
|
||||
interlaced images. The macros return the number of rows and columns in
|
||||
each pass and information that can be used to de-interlace and (if
|
||||
absolutely necessary) interlace an image.
|
||||
|
||||
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
||||
the application provided png_longjmp_ptr on the internal, but application
|
||||
initialized, jmpbuf. It is provided as a convenience to avoid the need
|
||||
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
||||
resetting the internal png_longjmp_ptr value.
|
||||
|
||||
libpng 1.5.0 includes a complete fixed point API. By default this is
|
||||
present along with the corresponding floating point API. In general the
|
||||
fixed point API is faster and smaller than the floating point one because
|
||||
the PNG file format used fixed point, not floating point. This applies
|
||||
even if the library uses floating point in internal calculations. A new
|
||||
macro, PNG_FLOATING_ARITHMETIC_SUPPORTED, reveals whether the library
|
||||
uses floating point arithmetic (the default) or fixed point arithmetic
|
||||
internally for performance critical calculations such as gamma correction.
|
||||
|
||||
Fixed point support for the sCAL chunk comes with an important caveat;
|
||||
the sCAL specification uses a decimal encoding of floating point values
|
||||
and the accuracy of PNG fixed point values is insufficient for
|
||||
representation of these values. Consequently a "string" API
|
||||
(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading
|
||||
arbitrary sCAL chunks in the absence of either the floating point API or
|
||||
internal floating point calculations.
|
||||
|
||||
Applications no longer need to include the optional distribution header
|
||||
file pngusr.h or define the corresponding macros during application
|
||||
build in order to see the correct variant of the libpng API. From 1.5.0
|
||||
application code can check for the corresponding _SUPPORTED macro:
|
||||
|
||||
#ifdef PNG_INCH_CONVERSIONS_SUPPORTED
|
||||
/* code that uses the inch conversion APIs. */
|
||||
#endif
|
||||
|
||||
This macro will only be defined if the inch conversion functions have been
|
||||
compiled into libpng. The full set of macros, and whether or not support
|
||||
has been compiled in, are available in the header file pnglibconf.h.
|
||||
This header file is specific to the libpng build. Notice that prior to
|
||||
1.5.0 the _SUPPORTED macros would always have the default definition unless
|
||||
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
|
||||
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
|
||||
corresponding function by defining PNG_USE_READ_MACROS or
|
||||
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
||||
only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0
|
||||
will lead to a link failure.
|
||||
%15%
|
||||
B. Changes to the build and configuration of libpng
|
||||
|
||||
Details of internal changes to the library code can be found in the CHANGES
|
||||
file. These will be of no concern to the vast majority of library users or
|
||||
builders, however the few who configure libpng to a non-default feature
|
||||
set may need to change how this is done.
|
||||
|
||||
There should be no need for library builders to alter build scripts if
|
||||
these use the distributed build support - configure or the makefiles -
|
||||
however users of the makefiles may care to update their build scripts
|
||||
to build pnglibconf.h where the corresponding makefile does not do so.
|
||||
|
||||
Building libpng with a non-default configuration has changed completely.
|
||||
The old method using pngusr.h should still work correctly even though the
|
||||
way pngusr.h is used in the build has been changed, however library
|
||||
builders will probably want to examine the changes to take advantage of
|
||||
new capabilities and to simplify their build system.
|
||||
|
||||
B.1 Specific changes to library configuration capabilities
|
||||
|
||||
The library now supports a complete fixed point implementation and can
|
||||
thus be used on systems which have no floating point support or very
|
||||
limited or slow support. Previously gamma correction, an essential part
|
||||
of complete PNG support, required reasonably fast floating point.
|
||||
|
||||
As part of this the choice of internal implementation has been made
|
||||
independent of the choice of fixed versus floating point APIs and all the
|
||||
missing fixed point APIs have been implemented.
|
||||
|
||||
The exact mechanism used to control attributes of API functions has
|
||||
changed. A single set of operating system independent macro definitions
|
||||
is used and operating system specific directives are defined in
|
||||
pnglibconf.h
|
||||
|
||||
As part of this the mechanism used to chose procedure call standards on those
|
||||
systems that allow a choice has been changed. At present this only
|
||||
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
|
||||
running on Intel processors. As before PNGAPI is defined where required
|
||||
to control the exported API functions; however, two new macros, PNGCBAPI
|
||||
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
|
||||
(PNGCAPI) for functions that must match a C library prototype (currently
|
||||
only png_longjmp_ptr, which must match the C longjmp function.) The new
|
||||
approach is documented in pngconf.h
|
||||
|
||||
Despite these changes libpng 1.5.0 only supports the native C function
|
||||
calling standard on those platforms tested so far (__cdecl on Microsoft
|
||||
Windows). This is because the support requirements for alternative
|
||||
calling conventions seem to no longer exist. Developers who find it
|
||||
necessary to set PNG_API_RULE to 1 should advise the mailing list
|
||||
(png-mng-implement) of this and library builders who use Openwatcom and
|
||||
therefore set PNG_API_RULE to 2 should also contact the mailing list.
|
||||
|
||||
A new test program, pngvalid, is provided in addition to pngtest.
|
||||
pngvalid validates the arithmetic accuracy of the gamma correction
|
||||
calculations and includes a number of validations of the file format.
|
||||
A subset of the full range of tests is run when "make check" is done
|
||||
(in the 'configure' build.) pngvalid also allows total allocated memory
|
||||
usage to be evaluated and performs additional memory overwrite validation.
|
||||
|
||||
Many changes to individual feature macros have been made. The following
|
||||
are the changes most likely to be noticed by library builders who
|
||||
configure libpng:
|
||||
|
||||
1) All feature macros now have consistent naming:
|
||||
|
||||
#define PNG_NO_feature turns the feature off
|
||||
#define PNG_feature_SUPPORTED turns the feature on
|
||||
|
||||
pnglibconf.h contains one line for each feature macro which is either:
|
||||
|
||||
#define PNG_feature_SUPPORTED
|
||||
|
||||
if the feature is supported or:
|
||||
|
||||
/*#undef PNG_feature_SUPPORTED*/
|
||||
|
||||
if it is not. Library code consistently checks for the 'SUPPORTED' macro.
|
||||
It does not, and should not, check for the 'NO' macro which will not
|
||||
normally be defined even if the feature is not supported.
|
||||
|
||||
Compatibility with the old names is provided as follows:
|
||||
|
||||
PNG_INCH_CONVERSIONS turns on PNG_INCH_CONVERSIONS_SUPPORTED
|
||||
|
||||
And the following definitions disable the corresponding feature:
|
||||
|
||||
PNG_SETJMP_NOT_SUPPORTED disables SETJMP
|
||||
PNG_READ_TRANSFORMS_NOT_SUPPORTED disables READ_TRANSFORMS
|
||||
PNG_NO_READ_COMPOSITED_NODIV disables READ_COMPOSITE_NODIV
|
||||
PNG_WRITE_TRANSFORMS_NOT_SUPPORTED disables WRITE_TRANSFORMS
|
||||
PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED disables READ_ANCILLARY_CHUNKS
|
||||
PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED disables WRITE_ANCILLARY_CHUNKS
|
||||
|
||||
Library builders should remove use of the above, inconsistent, names.
|
||||
|
||||
2) Warning and error message formatting was previously conditional on
|
||||
the STDIO feature. The library has been changed to use the
|
||||
CONSOLE_IO feature instead. This means that if CONSOLE_IO is disabled
|
||||
the library no longer uses the printf(3) functions, even though the
|
||||
default read/write implementations use (FILE) style stdio.h functions.
|
||||
|
||||
3) Three feature macros now control the fixed/floating point decisions:
|
||||
|
||||
PNG_FLOATING_POINT_SUPPORTED enables the floating point APIs
|
||||
|
||||
PNG_FIXED_POINT_SUPPORTED enables the fixed point APIs; however, in
|
||||
practice these are normally required internally anyway (because the PNG
|
||||
file format is fixed point), therefore in most cases PNG_NO_FIXED_POINT
|
||||
merely stops the function from being exported.
|
||||
|
||||
PNG_FLOATING_ARITHMETIC_SUPPORTED chooses between the internal floating
|
||||
point implementation or the fixed point one. Typically the fixed point
|
||||
implementation is larger and slower than the floating point implementation
|
||||
on a system that supports floating point, however it may be faster on a
|
||||
system which lacks floating point hardware and therefore uses a software
|
||||
emulation.
|
||||
|
||||
4) Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED. This allows the
|
||||
functions to read and write ints to be disabled independently of
|
||||
PNG_USE_READ_MACROS, which allows libpng to be built with the functions
|
||||
even though the default is to use the macros - this allows applications
|
||||
to choose at app buildtime whether or not to use macros (previously
|
||||
impossible because the functions weren't in the default build.)
|
||||
|
||||
B.2 Changes to the configuration mechanism
|
||||
|
||||
Prior to libpng-1.5.0 library builders who needed to configure libpng
|
||||
had either to modify the exported pngconf.h header file to add system
|
||||
specific configuration or had to write feature selection macros into
|
||||
pngusr.h and cause this to be included into pngconf.h by defining
|
||||
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
|
||||
application built without PNG_USER_CONFIG defined would see the
|
||||
unmodified, default, libpng API and thus would probably fail to link.
|
||||
|
||||
These mechanisms still work in the configure build and in any makefile
|
||||
build that builds pnglibconf.h although the feature selection macros
|
||||
have changed somewhat as described above. In 1.5.0, however, pngusr.h
|
||||
is processed once when the exported header file pnglibconf.h is built.
|
||||
pngconf.h no longer includes pngusr.h, therefore it is ignored after the
|
||||
build of pnglibconf.h and it is never included in an application build.
|
||||
|
||||
The rarely used alternative of adding a list of feature macros to the
|
||||
CFLAGS setting in the build also still works, however the macros will be
|
||||
copied to pnglibconf.h and this may produce macro redefinition warnings
|
||||
when the individual C files are compiled.
|
||||
|
||||
All configuration now only works if pnglibconf.h is built from
|
||||
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
|
||||
(the original author of awk) maintains C source code of that awk and this
|
||||
and all known later implementations (often called by subtly different
|
||||
names - nawk and gawk for example) are adequate to build pnglibconf.h.
|
||||
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
|
||||
and does not work, this may also apply to other systems that have a
|
||||
functioning awk called 'nawk'.
|
||||
|
||||
Configuration options are now documented in scripts/pnglibconf.dfa. This
|
||||
file also includes dependency information that ensures a configuration is
|
||||
consistent; that is, if a feature is switched off dependent features are
|
||||
also removed. As a recommended alternative to using feature macros in
|
||||
pngusr.h a system builder may also define equivalent options in pngusr.dfa
|
||||
(or, indeed, any file) and add that to the configuration by setting
|
||||
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
|
||||
how to do this, and a case where pngusr.h is still required.
|
||||
|
||||
XI. Detecting libpng
|
||||
|
||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||
changed, and is unaffected by conditional compilation macros. It is the
|
||||
@@ -3237,7 +3681,7 @@ libpng version since 0.88. In an autoconf "configure.in" you could use
|
||||
|
||||
AC_CHECK_LIB(png, png_get_io_ptr, ...
|
||||
|
||||
XI. Source code repository
|
||||
XII. Source code repository
|
||||
|
||||
Since about February 2009, version 1.2.34, libpng has been under "git" source
|
||||
control. The git repository was built from old libpng-x.y.z.tar.gz files
|
||||
@@ -3256,7 +3700,7 @@ the libpng bug tracker at
|
||||
|
||||
http://libpng.sourceforge.net
|
||||
|
||||
XII. Coding style
|
||||
XIII. Coding style
|
||||
|
||||
Our coding style is similar to the "Allman" style, with curly
|
||||
braces on separate lines:
|
||||
@@ -3313,7 +3757,7 @@ Functions and their curly braces are not indented, and
|
||||
exported functions are marked with PNGAPI:
|
||||
|
||||
/* This is a public function that is visible to
|
||||
* application programers. It does thus-and-so.
|
||||
* application programmers. It does thus-and-so.
|
||||
*/
|
||||
void PNGAPI
|
||||
png_exported_function(png_ptr, png_info, foo)
|
||||
@@ -3346,7 +3790,7 @@ with "png_", and all publicly visible C preprocessor
|
||||
macros begin with "PNG_".
|
||||
|
||||
We put a space after each comma and after each semicolon
|
||||
in "for" statments, and we put spaces before and after each
|
||||
in "for" statements, and we put spaces before and after each
|
||||
C binary operator and after "for" or "while", and before
|
||||
"?". We don't put a space between a typecast and the expression
|
||||
being cast, nor do we put one between a function name and the
|
||||
@@ -3364,15 +3808,15 @@ Lines do not exceed 80 characters.
|
||||
|
||||
Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
XIII. Y2K Compliance in libpng
|
||||
XIV. Y2K Compliance in libpng
|
||||
|
||||
November 21, 2010
|
||||
January 4, 2011
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.5.0beta55 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.0rc06 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
|
||||
640
libpng.3
640
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "November 21, 2010"
|
||||
.TH LIBPNG 3 "January 4, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.0beta55
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.0rc06
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@@ -851,7 +851,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
|
||||
.SH LIBPNG.TXT
|
||||
libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.5.0beta55 - November 21, 2010
|
||||
libpng version 1.5.0rc06 - January 4, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
@@ -862,7 +862,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.5.0beta55 - November 21, 2010
|
||||
libpng versions 0.97, January 1998, through 1.5.0rc06 - January 4, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
@@ -996,6 +996,10 @@ the full range of (png_fixed_point) (-21474 to +21474). When APIs require
|
||||
a non-negative argument the type is recorded as png_uint_32 above. Consult
|
||||
the header file and the text below for more information.
|
||||
|
||||
Special care must be take with sCAL chunk handling because the chunk itself
|
||||
uses non-integral values encoded as strings containing decimal floating point
|
||||
numbers. See the comments in the header file.
|
||||
|
||||
.SS Configuration
|
||||
|
||||
The main header file function declarations are frequently protected by C
|
||||
@@ -1012,6 +1016,115 @@ portability. From libpng 1.5.0 the feature macros set during the build
|
||||
of libpng are recorded in the header file "pnglibconf.h" and this file
|
||||
is always included by png.h.
|
||||
|
||||
If you don't need to change the library configuration from the default skip to
|
||||
the next section ("Reading").
|
||||
|
||||
Notice that some of the makefiles in the 'scripts' directory and (in 1.5.0) all
|
||||
of the build project files in the 'projects' directory simply copy
|
||||
scripts/pnglibconf.h.prebuilt to pnglibconf.h. This means that these build
|
||||
systems do not permit easy auto-configuration of the library - they only
|
||||
support the default configuration.
|
||||
|
||||
The easiest way to make minor changes to the libpng configuration when
|
||||
auto-configuration is supported is to add definitions to the command line
|
||||
using (typically) CPPFLAGS. For example:
|
||||
|
||||
CPPFLAGS=-DPNG_NO_FLOATING_ARITHMETIC
|
||||
|
||||
will change the internal libpng math implementation for gamma correction and
|
||||
other arithmetic calculations to fixed point, avoiding the need for fast
|
||||
floating point support. The result can be seen in the generated pnglibconf.h -
|
||||
make sure it contains the changed feature macro setting.
|
||||
|
||||
If you need to make more extensive configuration changes - more than one or two
|
||||
feature macro settings - you can either add -DPNG_USER_CONFIG to the build
|
||||
command line and put a list of feature macro settings in pngusr.h or you can set
|
||||
DFA_XTRA (a makefile variable) to a file containing the same information in the
|
||||
form of 'option' settings.
|
||||
|
||||
A. Changing pnglibconf.h
|
||||
|
||||
A variety of methods exist to build libpng. Not all of these support
|
||||
reconfiguration of pnglibconf.h. To reconfigure pnglibconf.h it must either be
|
||||
rebuilt from scripts/pnglibconf.dfa using awk or it must be edited by hand.
|
||||
|
||||
Hand editing is achieved by copying scripts/pnglibconf.h.prebuilt and changing
|
||||
the lines defining the supported features, paying very close attention to the
|
||||
'option' information in scripts/pnglibconf.dfa that describes those features and
|
||||
their requirements. This is easy to get wrong.
|
||||
|
||||
B. Configuration using DFA_XTRA
|
||||
|
||||
Rebuilding from pnglibconf.dfa is easy if a functioning 'awk', or a later
|
||||
variant such as 'nawk' or 'gawk', is available. The configure build will
|
||||
automatically find an appropriate awk and build pnglibconf.h.
|
||||
scripts/pnglibconf.mak contains a set of make rules for doing the same thing if
|
||||
configure is not used, and many of the makefiles in the scripts directory use
|
||||
this approach.
|
||||
|
||||
When rebuilding simply write new file containing changed options and set
|
||||
DFA_XTRA to the name of this file. This causes the build to append the new file
|
||||
to the end of scripts/pnglibconf.dfa. pngusr.dfa should contain lines of the
|
||||
following forms:
|
||||
|
||||
everything = off
|
||||
|
||||
This turns all optional features off. Include it at the start of pngusr.dfa to
|
||||
make it easier to build a minimal configuration. You will need to turn at least
|
||||
some features on afterward to enable either reading or writing code, or both.
|
||||
|
||||
option feature on
|
||||
option feature off
|
||||
|
||||
Enable or disable a single feature. This will automatically enable other
|
||||
features required by a feature that is turned on or disable other features that
|
||||
require a feature which is turned off. Conflicting settings will cause an error
|
||||
message to be emitted by awk.
|
||||
|
||||
setting feature default value
|
||||
|
||||
Changes the default value of setting 'feature' to 'value'. There are a small
|
||||
number of settings listed at the top of pnglibconf.h, they are documented in the
|
||||
source code. Most of these values have performance implications for the library
|
||||
but most of them have no visible effect on the API. Some can also be overridden
|
||||
from the API.
|
||||
|
||||
C. Configuration using PNG_USR_CONFIG
|
||||
|
||||
If -DPNG_USR_CONFIG is added to the CFLAGS when pnglibconf.h is built the file
|
||||
pngusr.h will automatically be included before the options in
|
||||
scripts/pnglibconf.dfa are processed. pngusr.h should contain only macro
|
||||
definitions turning features on or off or setting settings.
|
||||
|
||||
Apart from the global setting "everything = off" all the options listed above
|
||||
can be set using macros in pngusr.h:
|
||||
|
||||
#define PNG_feature_SUPPORTED
|
||||
|
||||
is equivalent to:
|
||||
|
||||
option feature on
|
||||
|
||||
#define PNG_NO_feature
|
||||
|
||||
is equivalent to:
|
||||
|
||||
option feature off
|
||||
|
||||
#define PNG_feature value
|
||||
|
||||
is equivalent to:
|
||||
|
||||
setting feature default value
|
||||
|
||||
Notice that in both cases, pngusr.dfa and pngusr.h, the contents of the
|
||||
pngusr file you supply override the contents of scripts/pnglibconf.dfa
|
||||
|
||||
If confusing or incomprehensible behavior results it is possible to
|
||||
examine the intermediate file pnglibconf.dfn to find the full set of
|
||||
dependency information for each setting and option. Simply locate the
|
||||
feature in the file and read the C comments that precede it.
|
||||
|
||||
.SH III. Reading
|
||||
|
||||
We'll now walk you through the possible functions to call when reading
|
||||
@@ -1756,7 +1869,6 @@ For example, 4 bit/pixel paletted or grayscale data will be returned
|
||||
2 pixels/byte with the leftmost pixel in the high-order bits of the
|
||||
byte, unless png_set_packing() is called. 8-bit RGB data will be stored
|
||||
in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha()
|
||||
%10%in RGB RGB RGB format unless png_set_filler()
|
||||
is called to insert filler bytes, either before or after each RGB triplet.
|
||||
16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant
|
||||
byte of the color value first, unless png_set_strip_16() is called to
|
||||
@@ -1765,7 +1877,6 @@ png_set_add alpha() is called to insert filler bytes, either before or
|
||||
after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can
|
||||
be modified with
|
||||
png_set_filler(), png_set_add_alpha(), or png_set_strip_16().
|
||||
%10%png_set_filler() or png_set_strip_16().
|
||||
|
||||
The following code transforms grayscale images of less than 8 to 8 bits,
|
||||
changes paletted images to RGB, and adds a full alpha channel if there is
|
||||
@@ -1778,7 +1889,6 @@ viewing application that wishes to treat all images in the same way.
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY &&
|
||||
bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr);
|
||||
%10% bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr);
|
||||
|
||||
if (png_get_valid(png_ptr, info_ptr,
|
||||
PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);
|
||||
@@ -1791,7 +1901,7 @@ things.
|
||||
As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was
|
||||
added. It expands the sample depth without changing tRNS to alpha.
|
||||
|
||||
As of libpng version 1.5.0beta55, not all possible expansions are supported.
|
||||
As of libpng version 1.5.0rc06, not all possible expansions are supported.
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
indexed with depth<8, other numerals represent the color type, "T" means
|
||||
@@ -2168,6 +2278,15 @@ are allocating one large chunk, you will need to build an
|
||||
array of pointers to each row, as it will be needed for some
|
||||
of the functions below.
|
||||
|
||||
Remember: Before you call png_read_update_info the png_get_
|
||||
functions return the values corresponding to the original PNG image.
|
||||
After you call png_read_update_info the values refer to the image
|
||||
that libpng will output. Consequently you must call all the png_set_
|
||||
functions before you call png_read_update_info. This is particularly
|
||||
important for png_set_interlace_handling - if you are going to call
|
||||
png_read_update_info you must call png_set_interlace_handling before
|
||||
it unless you want to receive interlaced output.
|
||||
|
||||
.SS Reading image data
|
||||
|
||||
After you've allocated memory, you can read the image data.
|
||||
@@ -2177,9 +2296,10 @@ call png_read_image() and libpng will read in all the image data
|
||||
and put it in the memory area supplied. You will need to pass in
|
||||
an array of pointers to each row.
|
||||
|
||||
This function automatically handles interlacing, so you don't need
|
||||
to call png_set_interlace_handling() or call this function multiple
|
||||
times, or any of that other stuff necessary with png_read_rows().
|
||||
This function automatically handles interlacing, so you don't
|
||||
need to call png_set_interlace_handling() (unless you call
|
||||
png_read_update_info()) or call this function multiple times, or any
|
||||
of that other stuff necessary with png_read_rows().
|
||||
|
||||
png_read_image(png_ptr, row_pointers);
|
||||
|
||||
@@ -2206,13 +2326,15 @@ a single row_pointer instead of an array of row_pointers:
|
||||
|
||||
If the file is interlaced (interlace_type != 0 in the IHDR chunk), things
|
||||
get somewhat harder. The only current (PNG Specification version 1.2)
|
||||
interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
is a somewhat complicated 2D interlace scheme, known as Adam7, that
|
||||
interlacing type for PNG is (interlace_type == PNG_INTERLACE_ADAM7);
|
||||
a somewhat complicated 2D interlace scheme, known as Adam7, that
|
||||
breaks down an image into seven smaller images of varying size, based
|
||||
on an 8x8 grid.
|
||||
on an 8x8 grid. This number is defined (from libpng 1.5) as
|
||||
PNG_INTERLACE_ADAM7_PASSES in png.h
|
||||
|
||||
libpng can fill out those images or it can give them to you "as is".
|
||||
If you want them filled out, there are two ways to do that. The one
|
||||
It is almost always better to have libpng handle the interlacing for you.
|
||||
If you want the images filled out, there are two ways to do that. The one
|
||||
mentioned in the PNG specification is to expand each pixel to cover
|
||||
those pixels that have not been read yet (the "rectangle" method).
|
||||
This results in a blocky image for the first pass, which gradually
|
||||
@@ -2222,65 +2344,20 @@ rest of the image remaining whatever colors they were initialized to
|
||||
before the start of the read. The first method usually looks better,
|
||||
but tends to be slower, as there are more pixels to put in the rows.
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just call
|
||||
png_read_rows() seven times to read in all seven images. Each of the
|
||||
images is a valid image by itself, or they can all be combined on an
|
||||
8x8 grid to form a single image (although if you intend to combine them
|
||||
you would be far better off using the libpng interlace handling).
|
||||
|
||||
The first pass will return an image 1/8 as wide as the entire image
|
||||
(every 8th column starting in column 0) and 1/8 as high as the original
|
||||
(every 8th row starting in row 0), the second will be 1/8 as wide
|
||||
(starting in column 4) and 1/8 as high (also starting in row 0). The
|
||||
third pass will be 1/4 as wide (every 4th pixel starting in column 0) and
|
||||
1/8 as high (every 8th row starting in row 4), and the fourth pass will
|
||||
be 1/4 as wide and 1/4 as high (every 4th column starting in column 2,
|
||||
and every 4th row starting in row 0). The fifth pass will return an
|
||||
image 1/2 as wide, and 1/4 as high (starting at column 0 and row 2),
|
||||
while the sixth pass will be 1/2 as wide and 1/2 as high as the original
|
||||
(starting in column 1 and row 0). The seventh and final pass will be as
|
||||
wide as the original, and 1/2 as high, containing all of the odd
|
||||
numbered scanlines. Phew!
|
||||
|
||||
If you want to retrieve the separate images you must pass the correct
|
||||
number of rows to each successive call of png_read_rows().
|
||||
Calculating the number isn't quite as straightforward as the previous
|
||||
paragraph might suggest; think about what happens with an image with a odd
|
||||
number of rows, which passes get the extra row? To help you libpng 1.5.0
|
||||
implements a function to return the number of rows and columns in the current
|
||||
pass:
|
||||
|
||||
int number_of_rows = png_get_num_rows(png_ptr);
|
||||
int number_of_cols = png_get_num_cols(png_ptr);
|
||||
|
||||
Simply call that before each call to png_read_rows(). You must call
|
||||
png_start_read_image() (or png_read_update_info) before the first call to
|
||||
ensure that the number libpng holds internally has been updated.
|
||||
|
||||
For very small interlaced images the number of rows or columns in a pass
|
||||
can be zero.
|
||||
You don't need to call png_read_rows() in this case, libpng will simply
|
||||
skip to the next pass.
|
||||
|
||||
If you want libpng to expand the images, call this before calling
|
||||
png_start_read_image() or png_read_update_info():
|
||||
If, as is likely, you want libpng to expand the images, call this before
|
||||
calling png_start_read_image() or png_read_update_info():
|
||||
|
||||
if (interlace_type == PNG_INTERLACE_ADAM7)
|
||||
number_of_passes
|
||||
= png_set_interlace_handling(png_ptr);
|
||||
|
||||
This will return the number of passes needed. Currently, this
|
||||
is seven, but may change if another interlace type is added.
|
||||
This function can be called even if the file is not interlaced,
|
||||
where it will return one pass.
|
||||
|
||||
If you need to get the number of passes later (for example after the call
|
||||
to png_start_read_image()) just call:
|
||||
|
||||
number_of_passes = png_get_num_passes(png_ptr);
|
||||
|
||||
This function just returns the number - it doesn't make any changes to the
|
||||
libpng state.
|
||||
This will return the number of passes needed. Currently, this is seven,
|
||||
but may change if another interlace type is added. This function can be
|
||||
called even if the file is not interlaced, where it will return one pass.
|
||||
You then need to read the whole image 'number_of_passes' times. Each time
|
||||
will distribute the pixels from the current pass to the correct place in
|
||||
the output image, so you need to supply the same rows to png_read_rows in
|
||||
each pass.
|
||||
|
||||
If you are not going to display the image after each pass, but are
|
||||
going to wait until the entire image is read in, use the sparkle
|
||||
@@ -2306,6 +2383,94 @@ the second parameter NULL.
|
||||
png_read_rows(png_ptr, NULL, row_pointers,
|
||||
number_of_rows);
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just call
|
||||
png_read_rows() PNG_INTERLACE_ADAM7_PASSES times to read in all the images.
|
||||
Each of the images is a valid image by itself, however you will almost
|
||||
certainly need to distribute the pixels from each sub-image to the
|
||||
correct place. This is where everything gets very tricky.
|
||||
|
||||
If you want to retrieve the separate images you must pass the correct
|
||||
number of rows to each successive call of png_read_rows(). The calculation
|
||||
gets pretty complicated for small images, where some sub-images may
|
||||
not even exist because either their width or height ends up zero.
|
||||
libpng provides two macros to help you in 1.5 and later versions:
|
||||
|
||||
png_uint_32 width = PNG_PASS_COLS(image_width, pass_number);
|
||||
png_uint_32 height = PNG_PASS_ROWS(image_height, pass_number);
|
||||
|
||||
Respectively these tell you the width and height of the sub-image
|
||||
corresponding to the numbered pass. 'pass' is in in the range 0 to 6 -
|
||||
this can be confusing because the specification refers to the same passes
|
||||
as 1 to 7! Be careful, you must check both the width and height before
|
||||
calling png_read_rows() and not call it for that pass if either is zero.
|
||||
|
||||
You can, of course, read each sub-image row by row. If you want to
|
||||
produce optimal code to make a pixel-by-pixel transformation of an
|
||||
interlaced image this is the best approach; read each row of each pass,
|
||||
transform it, and write it out to a new interlaced image.
|
||||
|
||||
If you want to de-interlace the image yourself libpng provides further
|
||||
macros to help that tell you where to place the pixels in the output image.
|
||||
Because the interlacing scheme is rectangular - sub-image pixels are always
|
||||
arranged on a rectangular grid - all you need to know for each pass is the
|
||||
starting column and row in the output image of the first pixel plus the
|
||||
spacing between each pixel. As of libpng 1.5 there are four macros to
|
||||
retrieve this information:
|
||||
|
||||
png_uint_32 x = PNG_PASS_START_COL(pass);
|
||||
png_uint_32 y = PNG_PASS_START_ROW(pass);
|
||||
png_uint_32 xStep = 1U << PNG_PASS_COL_SHIFT(pass);
|
||||
png_uint_32 yStep = 1U << PNG_PASS_ROW_SHIFT(pass);
|
||||
|
||||
These allow you to write the obvious loop:
|
||||
|
||||
png_uint_32 input_y = 0;
|
||||
png_uint_32 output_y = PNG_PASS_START_ROW(pass);
|
||||
|
||||
while (output_y < output_image_height)
|
||||
{
|
||||
png_uint_32 input_x = 0;
|
||||
png_uint_32 output_x = PNG_PASS_START_COL(pass);
|
||||
|
||||
while (output_x < output_image_width)
|
||||
{
|
||||
image[output_y][output_x] = subimage[pass][input_y][input_x++];
|
||||
output_x += xStep;
|
||||
}
|
||||
|
||||
++input_y;
|
||||
ouput_y += yStep;
|
||||
}
|
||||
|
||||
Notice that the steps between successive output rows and columns are
|
||||
returned as shifts. This is possible because the pixels in the subimages
|
||||
are always a power of 2 apart - 1, 2, 4 or 8 pixels - in the original
|
||||
image. In practice you may need to directly calculate the output coordinate
|
||||
given an input coordinate. libpng provides two further macros for this
|
||||
purpose:
|
||||
|
||||
png_uint_32 output_x = PNG_COL_FROM_PASS_COL(input_x, pass);
|
||||
png_uint_32 output_y = PNG_ROW_FROM_PASS_ROW(input_y, pass);
|
||||
|
||||
Finally a pair of macros are provided to tell you if a particular image
|
||||
row or column appears in a given pass:
|
||||
|
||||
int col_in_pass = PNG_COL_IN_INTERLACE_PASS(output_x, pass);
|
||||
int row_in_pass = PNG_ROW_IN_INTERLACE_PASS(output_y, pass);
|
||||
|
||||
Bear in mind that you will probably also need to check the width and height
|
||||
of the pass in addition to the above to be sure the pass even exists!
|
||||
|
||||
With any luck you are convinced by now that you don't want to do your own
|
||||
interlace handling. In reality normally the only good reason for doing this
|
||||
is if you are processing PNG files on a pixel-by-pixel basis and don't want
|
||||
to load the whole file into memory when it is interlaced.
|
||||
|
||||
libpng includes a test program, pngvalid, that illustrates reading and
|
||||
writing of interlaced images. If you can't get interlacing to work in your
|
||||
code and don't want to leave it to libpng (the recommended approach) see
|
||||
how pngvalid.c does it.
|
||||
|
||||
.SS Finishing a sequential read
|
||||
|
||||
After you are finished reading the image through the
|
||||
@@ -2511,6 +2676,9 @@ png_infop info_ptr;
|
||||
any). You may start getting rows before
|
||||
png_process_data() returns, so this is your
|
||||
last chance to prepare for that.
|
||||
|
||||
This is where you turn on interlace handling,
|
||||
assuming you don't want to do it yourself.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -2531,14 +2699,22 @@ png_infop info_ptr;
|
||||
supplying them because it may make your life
|
||||
easier.
|
||||
|
||||
For the non-NULL rows of interlaced images,
|
||||
If you did not turn on interlace handling then
|
||||
the callback is called for each row of each
|
||||
sub-image when the image is interlaced. In this
|
||||
case 'row_num' is the row in the sub-image, not
|
||||
the row in the output image as it is in all other
|
||||
cases.
|
||||
|
||||
For the non-NULL rows of interlaced images when
|
||||
you have switched on libpng interlace handling,
|
||||
you must call png_progressive_combine_row()
|
||||
passing in the row and the old row. You can
|
||||
call this function for NULL rows (it will just
|
||||
return) and for non-interlaced images (it just
|
||||
does the memcpy for you) if it will make the
|
||||
code easier. Thus, you can just do this for
|
||||
all cases:
|
||||
all cases if you switch on interlace handling;
|
||||
*/
|
||||
|
||||
png_progressive_combine_row(png_ptr, old_row,
|
||||
@@ -2714,11 +2890,10 @@ filter types.
|
||||
PNG_FILTER_PAETH | PNG_FILTER_VALUE_PAETH|
|
||||
PNG_ALL_FILTERS);
|
||||
|
||||
If an application
|
||||
wants to start and stop using particular filters during compression,
|
||||
it should start out with all of the filters (to ensure that the previous
|
||||
row of pixels will be stored in case it's needed later), and then add
|
||||
and remove them after the start of compression.
|
||||
If an application wants to start and stop using particular filters during
|
||||
compression, it should start out with all of the filters (to ensure that
|
||||
the previous row of pixels will be stored in case it's needed later),
|
||||
and then add and remove them after the start of compression.
|
||||
|
||||
If you are writing a PNG datastream that is to be embedded in a MNG
|
||||
datastream, the second parameter can be either 0 or 64.
|
||||
@@ -3317,25 +3492,39 @@ for details of which pixels to write when.
|
||||
|
||||
If you don't want libpng to handle the interlacing details, just
|
||||
use png_set_interlace_handling() and call png_write_rows() the
|
||||
correct number of times to write all seven sub-images.
|
||||
correct number of times to write all the sub-images
|
||||
(png_set_interlace_handling() returns the number of sub-images.)
|
||||
|
||||
If you want libpng to build the sub-images, call this before you start
|
||||
writing any rows:
|
||||
|
||||
number_of_passes =
|
||||
png_set_interlace_handling(png_ptr);
|
||||
number_of_passes = png_set_interlace_handling(png_ptr);
|
||||
|
||||
This will return the number of passes needed. Currently, this is seven,
|
||||
but may change if another interlace type is added.
|
||||
|
||||
Then write the complete image number_of_passes times.
|
||||
|
||||
png_write_rows(png_ptr, row_pointers,
|
||||
number_of_rows);
|
||||
png_write_rows(png_ptr, row_pointers, number_of_rows);
|
||||
|
||||
As some of these rows are not used, and thus return immediately, you may
|
||||
want to read about interlacing in the PNG specification, and only update
|
||||
the rows that are actually used.
|
||||
Think carefully before you write an interlaced image. Typically code that
|
||||
reads such images reads all the image data into memory, uncompressed, before
|
||||
doing any processing. Only code that can display an image on the fly can
|
||||
take advantage of the interlacing and even then the image has to be exactly
|
||||
the correct size for the output device, because scaling an image requires
|
||||
adjacent pixels and these are not available until all the passes have been
|
||||
read.
|
||||
|
||||
If you do write an interlaced image you will hardly ever need to handle
|
||||
the interlacing yourself. Call png_set_interlace_handling() and use the
|
||||
approach described above.
|
||||
|
||||
The only time it is conceivable that you will really need to write an
|
||||
interlaced image pass-by-pass is when you have read one pass by pass and
|
||||
made some pixel-by-pixel transformation to it, as described in the read
|
||||
code above. In this case use the PNG_PASS_ROWS and PNG_PASS_COLS macros
|
||||
to determine the size of each sub-image in turn and simply write the rows
|
||||
you obtained from the read code.
|
||||
|
||||
.SS Finishing a sequential write
|
||||
|
||||
@@ -3881,7 +4070,6 @@ application:
|
||||
|
||||
png_uint_32 application_vn = PNG_LIBPNG_VER;
|
||||
|
||||
%10%.SH VIII. (Omitted).
|
||||
.SH VIII. Changes to Libpng from version 1.0.x to 1.2.x
|
||||
|
||||
Support for user memory management was enabled by default. To
|
||||
@@ -4042,6 +4230,12 @@ deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with
|
||||
png_set_expand_gray_1_2_4_to_8() because the former function also
|
||||
expanded palette images.
|
||||
|
||||
Macros for png_get_uint_16, png_get_uint_32, and png_get_int_32
|
||||
were added and are used by default instead of the corresponding
|
||||
functions. Unfortunately,
|
||||
from libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
We changed the prototype for png_malloc() from
|
||||
png_malloc(png_structp png_ptr, png_uint_32 size)
|
||||
to
|
||||
@@ -4079,7 +4273,257 @@ PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS.
|
||||
|
||||
We removed the trailing '.' from the warning and error messages.
|
||||
|
||||
.SH X. Detecting libpng
|
||||
.SH X. 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
|
||||
function) incorrectly returned a value of type png_uint_32.
|
||||
|
||||
A. Changes that affect users of libpng
|
||||
|
||||
There are no substantial API changes between the non-deprecated parts of
|
||||
the 1.4.5 API and the 1.5.0 API, however the ability to directly access
|
||||
the main libpng control structures, png_struct and png_info, deprecated
|
||||
in earlier versions of libpng, has been completely removed from
|
||||
libpng 1.5.
|
||||
|
||||
There are changes of form in png.h, including new and changed macros to
|
||||
declare
|
||||
parts of the API. Some API functions with arguments that are points to
|
||||
data not modified within the function have been corrected to declare
|
||||
these arguments with PNG_CONST.
|
||||
|
||||
Much of the internal use of C macros to control the library build has also
|
||||
changed and some of this is visible in the exported header files, in
|
||||
particular the use of macros to control data and API elements visible
|
||||
during application compilation may require significant revision to
|
||||
application code. (It is extremely rare for an application to do this.)
|
||||
|
||||
Any program that compiled against libpng 1.4 and did not use deprecated
|
||||
features or access internal library structures should compile and work
|
||||
against libpng 1.5.
|
||||
|
||||
libpng 1.5.0 adds PNG_ PASS macros to help in the reading and writing of
|
||||
interlaced images. The macros return the number of rows and columns in
|
||||
each pass and information that can be used to de-interlace and (if
|
||||
absolutely necessary) interlace an image.
|
||||
|
||||
libpng 1.5.0 adds an API png_longjmp(png_ptr, value). This API calls
|
||||
the application provided png_longjmp_ptr on the internal, but application
|
||||
initialized, jmpbuf. It is provided as a convenience to avoid the need
|
||||
to use the png_jmpbuf macro, which had the unnecessary side effect of
|
||||
resetting the internal png_longjmp_ptr value.
|
||||
|
||||
libpng 1.5.0 includes a complete fixed point API. By default this is
|
||||
present along with the corresponding floating point API. In general the
|
||||
fixed point API is faster and smaller than the floating point one because
|
||||
the PNG file format used fixed point, not floating point. This applies
|
||||
even if the library uses floating point in internal calculations. A new
|
||||
macro, PNG_FLOATING_ARITHMETIC_SUPPORTED, reveals whether the library
|
||||
uses floating point arithmetic (the default) or fixed point arithmetic
|
||||
internally for performance critical calculations such as gamma correction.
|
||||
|
||||
Fixed point support for the sCAL chunk comes with an important caveat;
|
||||
the sCAL specification uses a decimal encoding of floating point values
|
||||
and the accuracy of PNG fixed point values is insufficient for
|
||||
representation of these values. Consequently a "string" API
|
||||
(png_get_sCAL_s and png_set_sCAL_s) is the only reliable way of reading
|
||||
arbitrary sCAL chunks in the absence of either the floating point API or
|
||||
internal floating point calculations.
|
||||
|
||||
Applications no longer need to include the optional distribution header
|
||||
file pngusr.h or define the corresponding macros during application
|
||||
build in order to see the correct variant of the libpng API. From 1.5.0
|
||||
application code can check for the corresponding _SUPPORTED macro:
|
||||
|
||||
#ifdef PNG_INCH_CONVERSIONS_SUPPORTED
|
||||
/* code that uses the inch conversion APIs. */
|
||||
#endif
|
||||
|
||||
This macro will only be defined if the inch conversion functions have been
|
||||
compiled into libpng. The full set of macros, and whether or not support
|
||||
has been compiled in, are available in the header file pnglibconf.h.
|
||||
This header file is specific to the libpng build. Notice that prior to
|
||||
1.5.0 the _SUPPORTED macros would always have the default definition unless
|
||||
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
|
||||
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
|
||||
corresponding function by defining PNG_USE_READ_MACROS or
|
||||
PNG_NO_USE_READ_MACROS before including png.h. Notice that this is
|
||||
only supported from 1.5.0 -defining PNG_NO_USE_READ_MACROS prior to 1.5.0
|
||||
will lead to a link failure.
|
||||
%15%
|
||||
B. Changes to the build and configuration of libpng
|
||||
|
||||
Details of internal changes to the library code can be found in the CHANGES
|
||||
file. These will be of no concern to the vast majority of library users or
|
||||
builders, however the few who configure libpng to a non-default feature
|
||||
set may need to change how this is done.
|
||||
|
||||
There should be no need for library builders to alter build scripts if
|
||||
these use the distributed build support - configure or the makefiles -
|
||||
however users of the makefiles may care to update their build scripts
|
||||
to build pnglibconf.h where the corresponding makefile does not do so.
|
||||
|
||||
Building libpng with a non-default configuration has changed completely.
|
||||
The old method using pngusr.h should still work correctly even though the
|
||||
way pngusr.h is used in the build has been changed, however library
|
||||
builders will probably want to examine the changes to take advantage of
|
||||
new capabilities and to simplify their build system.
|
||||
|
||||
B.1 Specific changes to library configuration capabilities
|
||||
|
||||
The library now supports a complete fixed point implementation and can
|
||||
thus be used on systems which have no floating point support or very
|
||||
limited or slow support. Previously gamma correction, an essential part
|
||||
of complete PNG support, required reasonably fast floating point.
|
||||
|
||||
As part of this the choice of internal implementation has been made
|
||||
independent of the choice of fixed versus floating point APIs and all the
|
||||
missing fixed point APIs have been implemented.
|
||||
|
||||
The exact mechanism used to control attributes of API functions has
|
||||
changed. A single set of operating system independent macro definitions
|
||||
is used and operating system specific directives are defined in
|
||||
pnglibconf.h
|
||||
|
||||
As part of this the mechanism used to chose procedure call standards on those
|
||||
systems that allow a choice has been changed. At present this only
|
||||
affects certain Microsoft (DOS, Windows) and IBM (OS/2) operating systems
|
||||
running on Intel processors. As before PNGAPI is defined where required
|
||||
to control the exported API functions; however, two new macros, PNGCBAPI
|
||||
and PNGCAPI, are used instead for callback functions (PNGCBAPI) and
|
||||
(PNGCAPI) for functions that must match a C library prototype (currently
|
||||
only png_longjmp_ptr, which must match the C longjmp function.) The new
|
||||
approach is documented in pngconf.h
|
||||
|
||||
Despite these changes libpng 1.5.0 only supports the native C function
|
||||
calling standard on those platforms tested so far (__cdecl on Microsoft
|
||||
Windows). This is because the support requirements for alternative
|
||||
calling conventions seem to no longer exist. Developers who find it
|
||||
necessary to set PNG_API_RULE to 1 should advise the mailing list
|
||||
(png-mng-implement) of this and library builders who use Openwatcom and
|
||||
therefore set PNG_API_RULE to 2 should also contact the mailing list.
|
||||
|
||||
A new test program, pngvalid, is provided in addition to pngtest.
|
||||
pngvalid validates the arithmetic accuracy of the gamma correction
|
||||
calculations and includes a number of validations of the file format.
|
||||
A subset of the full range of tests is run when "make check" is done
|
||||
(in the 'configure' build.) pngvalid also allows total allocated memory
|
||||
usage to be evaluated and performs additional memory overwrite validation.
|
||||
|
||||
Many changes to individual feature macros have been made. The following
|
||||
are the changes most likely to be noticed by library builders who
|
||||
configure libpng:
|
||||
|
||||
1) All feature macros now have consistent naming:
|
||||
|
||||
#define PNG_NO_feature turns the feature off
|
||||
#define PNG_feature_SUPPORTED turns the feature on
|
||||
|
||||
pnglibconf.h contains one line for each feature macro which is either:
|
||||
|
||||
#define PNG_feature_SUPPORTED
|
||||
|
||||
if the feature is supported or:
|
||||
|
||||
/*#undef PNG_feature_SUPPORTED*/
|
||||
|
||||
if it is not. Library code consistently checks for the 'SUPPORTED' macro.
|
||||
It does not, and should not, check for the 'NO' macro which will not
|
||||
normally be defined even if the feature is not supported.
|
||||
|
||||
Compatibility with the old names is provided as follows:
|
||||
|
||||
PNG_INCH_CONVERSIONS turns on PNG_INCH_CONVERSIONS_SUPPORTED
|
||||
|
||||
And the following definitions disable the corresponding feature:
|
||||
|
||||
PNG_SETJMP_NOT_SUPPORTED disables SETJMP
|
||||
PNG_READ_TRANSFORMS_NOT_SUPPORTED disables READ_TRANSFORMS
|
||||
PNG_NO_READ_COMPOSITED_NODIV disables READ_COMPOSITE_NODIV
|
||||
PNG_WRITE_TRANSFORMS_NOT_SUPPORTED disables WRITE_TRANSFORMS
|
||||
PNG_READ_ANCILLARY_CHUNKS_NOT_SUPPORTED disables READ_ANCILLARY_CHUNKS
|
||||
PNG_WRITE_ANCILLARY_CHUNKS_NOT_SUPPORTED disables WRITE_ANCILLARY_CHUNKS
|
||||
|
||||
Library builders should remove use of the above, inconsistent, names.
|
||||
|
||||
2) Warning and error message formatting was previously conditional on
|
||||
the STDIO feature. The library has been changed to use the
|
||||
CONSOLE_IO feature instead. This means that if CONSOLE_IO is disabled
|
||||
the library no longer uses the printf(3) functions, even though the
|
||||
default read/write implementations use (FILE) style stdio.h functions.
|
||||
|
||||
3) Three feature macros now control the fixed/floating point decisions:
|
||||
|
||||
PNG_FLOATING_POINT_SUPPORTED enables the floating point APIs
|
||||
|
||||
PNG_FIXED_POINT_SUPPORTED enables the fixed point APIs; however, in
|
||||
practice these are normally required internally anyway (because the PNG
|
||||
file format is fixed point), therefore in most cases PNG_NO_FIXED_POINT
|
||||
merely stops the function from being exported.
|
||||
|
||||
PNG_FLOATING_ARITHMETIC_SUPPORTED chooses between the internal floating
|
||||
point implementation or the fixed point one. Typically the fixed point
|
||||
implementation is larger and slower than the floating point implementation
|
||||
on a system that supports floating point, however it may be faster on a
|
||||
system which lacks floating point hardware and therefore uses a software
|
||||
emulation.
|
||||
|
||||
4) Added PNG_{READ,WRITE}_INT_FUNCTIONS_SUPPORTED. This allows the
|
||||
functions to read and write ints to be disabled independently of
|
||||
PNG_USE_READ_MACROS, which allows libpng to be built with the functions
|
||||
even though the default is to use the macros - this allows applications
|
||||
to choose at app buildtime whether or not to use macros (previously
|
||||
impossible because the functions weren't in the default build.)
|
||||
|
||||
B.2 Changes to the configuration mechanism
|
||||
|
||||
Prior to libpng-1.5.0 library builders who needed to configure libpng
|
||||
had either to modify the exported pngconf.h header file to add system
|
||||
specific configuration or had to write feature selection macros into
|
||||
pngusr.h and cause this to be included into pngconf.h by defining
|
||||
PNG_USER_CONFIG. The latter mechanism had the disadvantage that an
|
||||
application built without PNG_USER_CONFIG defined would see the
|
||||
unmodified, default, libpng API and thus would probably fail to link.
|
||||
|
||||
These mechanisms still work in the configure build and in any makefile
|
||||
build that builds pnglibconf.h although the feature selection macros
|
||||
have changed somewhat as described above. In 1.5.0, however, pngusr.h
|
||||
is processed once when the exported header file pnglibconf.h is built.
|
||||
pngconf.h no longer includes pngusr.h, therefore it is ignored after the
|
||||
build of pnglibconf.h and it is never included in an application build.
|
||||
|
||||
The rarely used alternative of adding a list of feature macros to the
|
||||
CFLAGS setting in the build also still works, however the macros will be
|
||||
copied to pnglibconf.h and this may produce macro redefinition warnings
|
||||
when the individual C files are compiled.
|
||||
|
||||
All configuration now only works if pnglibconf.h is built from
|
||||
scripts/pnglibconf.dfa. This requires the program awk. Brian Kernighan
|
||||
(the original author of awk) maintains C source code of that awk and this
|
||||
and all known later implementations (often called by subtly different
|
||||
names - nawk and gawk for example) are adequate to build pnglibconf.h.
|
||||
The Sun Microsystems (now Oracle) program 'awk' is an earlier version
|
||||
and does not work, this may also apply to other systems that have a
|
||||
functioning awk called 'nawk'.
|
||||
|
||||
Configuration options are now documented in scripts/pnglibconf.dfa. This
|
||||
file also includes dependency information that ensures a configuration is
|
||||
consistent; that is, if a feature is switched off dependent features are
|
||||
also removed. As a recommended alternative to using feature macros in
|
||||
pngusr.h a system builder may also define equivalent options in pngusr.dfa
|
||||
(or, indeed, any file) and add that to the configuration by setting
|
||||
DFA_XTRA to the file name. The makefiles in contrib/pngminim illustrate
|
||||
how to do this, and a case where pngusr.h is still required.
|
||||
|
||||
.SH XI. Detecting libpng
|
||||
|
||||
The png_get_io_ptr() function has been present since libpng-0.88, has never
|
||||
changed, and is unaffected by conditional compilation macros. It is the
|
||||
@@ -4088,7 +4532,7 @@ libpng version since 0.88. In an autoconf "configure.in" you could use
|
||||
|
||||
AC_CHECK_LIB(png, png_get_io_ptr, ...
|
||||
|
||||
.SH XI. Source code repository
|
||||
.SH XII. Source code repository
|
||||
|
||||
Since about February 2009, version 1.2.34, libpng has been under "git" source
|
||||
control. The git repository was built from old libpng-x.y.z.tar.gz files
|
||||
@@ -4107,7 +4551,7 @@ the libpng bug tracker at
|
||||
|
||||
http://libpng.sourceforge.net
|
||||
|
||||
.SH XII. Coding style
|
||||
.SH XIII. Coding style
|
||||
|
||||
Our coding style is similar to the "Allman" style, with curly
|
||||
braces on separate lines:
|
||||
@@ -4164,7 +4608,7 @@ Functions and their curly braces are not indented, and
|
||||
exported functions are marked with PNGAPI:
|
||||
|
||||
/* This is a public function that is visible to
|
||||
* application programers. It does thus-and-so.
|
||||
* application programmers. It does thus-and-so.
|
||||
*/
|
||||
void PNGAPI
|
||||
png_exported_function(png_ptr, png_info, foo)
|
||||
@@ -4197,7 +4641,7 @@ with "png_", and all publicly visible C preprocessor
|
||||
macros begin with "PNG_".
|
||||
|
||||
We put a space after each comma and after each semicolon
|
||||
in "for" statments, and we put spaces before and after each
|
||||
in "for" statements, and we put spaces before and after each
|
||||
C binary operator and after "for" or "while", and before
|
||||
"?". We don't put a space between a typecast and the expression
|
||||
being cast, nor do we put one between a function name and the
|
||||
@@ -4215,15 +4659,15 @@ Lines do not exceed 80 characters.
|
||||
|
||||
Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
.SH XIII. Y2K Compliance in libpng
|
||||
.SH XIV. Y2K Compliance in libpng
|
||||
|
||||
November 21, 2010
|
||||
January 4, 2011
|
||||
|
||||
Since the PNG Development group is an ad-hoc body, we can't make
|
||||
an official declaration.
|
||||
|
||||
This is your unofficial assurance that libpng from version 0.71 and
|
||||
upward through 1.5.0beta55 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.0rc06 are Y2K compliant. It is my belief that earlier
|
||||
versions were also Y2K compliant.
|
||||
|
||||
Libpng only has three year fields. One is a 2-byte unsigned integer that
|
||||
@@ -4402,7 +4846,9 @@ the first widely used release:
|
||||
1.4.1 14 10401 14.so.14.1[.0]
|
||||
1.4.2 14 10402 14.so.14.2[.0]
|
||||
1.4.3 14 10403 14.so.14.3[.0]
|
||||
1.5.0beta01-55 15 10500 15.so.15.0[.0]
|
||||
1.4.4 14 10404 14.so.14.4[.0]
|
||||
1.5.0beta01-58 15 10500 15.so.15.0[.0]
|
||||
1.5.0rc01-06 15 10500 15.so.15.0[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -4459,7 +4905,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.5.0beta55 - November 21, 2010:
|
||||
Libpng version 1.5.0rc06 - January 4, 2011:
|
||||
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
|
||||
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
|
||||
|
||||
@@ -4482,7 +4928,7 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.0beta55, November 21, 2010, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.0rc06, January 4, 2011, are
|
||||
Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
|
||||
distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
with the following individual added to the list of Contributing Authors
|
||||
@@ -4581,7 +5027,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
November 21, 2010
|
||||
January 4, 2011
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "November 21, 2010"
|
||||
.TH LIBPNGPF 3 "January 4, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.0beta55
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.0rc06
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include \fI"pngpriv.h"
|
||||
|
||||
2
png.5
2
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "November 21, 2010"
|
||||
.TH PNG 5 "January 4, 2011"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
||||
21
png.c
21
png.c
@@ -14,7 +14,7 @@
|
||||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_5_0beta55 Your_png_h_is_not_version_1_5_0beta55;
|
||||
typedef png_libpng_version_1_5_0rc06 Your_png_h_is_not_version_1_5_0rc06;
|
||||
|
||||
/* 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
|
||||
@@ -441,11 +441,10 @@ png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (num == -1)
|
||||
info_ptr->free_me &= ~mask;
|
||||
if (num != -1)
|
||||
mask &= ~PNG_FREE_MUL;
|
||||
|
||||
else
|
||||
info_ptr->free_me &= ~(mask & ~PNG_FREE_MUL);
|
||||
info_ptr->free_me &= ~mask;
|
||||
}
|
||||
|
||||
/* This is an internal routine to free any memory that the info struct is
|
||||
@@ -550,19 +549,19 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
|
||||
png_const_charp PNGAPI
|
||||
png_get_copyright(png_structp png_ptr)
|
||||
{
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
#ifdef PNG_STRING_COPYRIGHT
|
||||
return PNG_STRING_COPYRIGHT
|
||||
return PNG_STRING_COPYRIGHT
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.5.0beta55 - November 21, 2010" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.5.0rc06 - January 4, 2011" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||
PNG_STRING_NEWLINE;
|
||||
# else
|
||||
return "libpng version 1.5.0beta55 - November 21, 2010\
|
||||
return "libpng version 1.5.0rc06 - January 4, 2011\
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||
@@ -589,7 +588,7 @@ png_const_charp PNGAPI
|
||||
png_get_header_ver(png_structp png_ptr)
|
||||
{
|
||||
/* Version of *.h files used when building libpng */
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
return PNG_LIBPNG_VER_STRING;
|
||||
}
|
||||
|
||||
@@ -597,7 +596,7 @@ png_const_charp PNGAPI
|
||||
png_get_header_version(png_structp png_ptr)
|
||||
{
|
||||
/* Returns longer string containing both version and date */
|
||||
png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */
|
||||
PNG_UNUSED(png_ptr) /* Silence compiler warning about unused png_ptr */
|
||||
#ifdef __STDC__
|
||||
return PNG_HEADER_VERSION_STRING
|
||||
# ifndef PNG_READ_SUPPORTED
|
||||
|
||||
29
pngconf.h
29
pngconf.h
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.5.0beta55 - (PENDING RELEASE)
|
||||
* libpng version 1.5.0rc06 - (PENDING RELEASE)
|
||||
*
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@@ -69,7 +69,8 @@
|
||||
* below) but still have compiler specific implementations, others
|
||||
* may be changed on a per-file basis when compiling against libpng.
|
||||
*/
|
||||
/* This macro protects us against machines that don't have function
|
||||
|
||||
/* The PNGARG macro protects us against machines that don't have function
|
||||
* prototypes (ie K&R style headers). If your compiler does not handle
|
||||
* function prototypes, define this macro and use the included ansi2knr.
|
||||
* I've always been able to use _NO_PROTO as the indicator, but you may
|
||||
@@ -304,18 +305,22 @@
|
||||
# define PNG_EXPORT_TYPE(type) PNG_IMPEXP type
|
||||
#endif
|
||||
|
||||
#ifndef PNG_EXPORT
|
||||
/* The ordinal value is only relevant when preprocessing png.h for symbol
|
||||
* table entries.
|
||||
* table entries, so we discard it here. See the .dfn files in the
|
||||
* scripts directory.
|
||||
*/
|
||||
# define PNG_EXPORT(type, name, args, attributes, ordinal)\
|
||||
#ifndef PNG_EXPORTA
|
||||
# define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
extern PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args),\
|
||||
attributes)
|
||||
#endif
|
||||
|
||||
#define PNG_EXPORT(ordinal, type, name, args)\
|
||||
PNG_EXPORTA(ordinal, type, name, args, )
|
||||
|
||||
/* Use PNG_REMOVED to comment out a removed interface. */
|
||||
#ifndef PNG_REMOVED
|
||||
# define PNG_REMOVED(type, name, args, attributes, ordinal)
|
||||
# define PNG_REMOVED(ordinal, type, name, args, attributes)
|
||||
#endif
|
||||
|
||||
#ifndef PNG_CALLBACK
|
||||
@@ -430,18 +435,18 @@
|
||||
#endif
|
||||
#ifndef PNG_FP_EXPORT /* A floating point API. */
|
||||
# ifdef PNG_FLOATING_POINT_SUPPORTED
|
||||
# define PNG_FP_EXPORT(type, name, args, attributes, ordinal)\
|
||||
PNG_EXPORT(type, name, args, attributes, ordinal)
|
||||
# define PNG_FP_EXPORT(ordinal, type, name, args)\
|
||||
PNG_EXPORT(ordinal, type, name, args)
|
||||
# else /* No floating point APIs */
|
||||
# define PNG_FP_EXPORT(type, name, args, attributes, ordinal)
|
||||
# define PNG_FP_EXPORT(ordinal, type, name, args)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef PNG_FIXED_EXPORT /* A fixed point API. */
|
||||
# ifdef PNG_FIXED_POINT_SUPPORTED
|
||||
# define PNG_FIXED_EXPORT(type, name, args, attributes, ordinal)\
|
||||
PNG_EXPORT(type, name, args, attributes, ordinal)
|
||||
# define PNG_FIXED_EXPORT(ordinal, type, name, args)\
|
||||
PNG_EXPORT(ordinal, type, name, args)
|
||||
# else /* No fixed point APIs */
|
||||
# define PNG_FIXED_EXPORT(type, name, args, attributes, ordinal)
|
||||
# define PNG_FIXED_EXPORT(ordinal, type, name, args)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ png_default_error,(png_structp png_ptr, png_const_charp error_message),
|
||||
}
|
||||
#endif
|
||||
#ifndef PNG_CONSOLE_IO_SUPPORTED
|
||||
error_message = error_message; /* Make compiler happy */
|
||||
PNG_UNUSED(error_message) /* Make compiler happy */
|
||||
#endif
|
||||
png_longjmp(png_ptr, 1);
|
||||
}
|
||||
@@ -394,9 +394,9 @@ png_default_warning(png_structp png_ptr, png_const_charp warning_message)
|
||||
fprintf(stderr, PNG_STRING_NEWLINE);
|
||||
}
|
||||
#else
|
||||
warning_message = warning_message; /* Make compiler happy */
|
||||
PNG_UNUSED(warning_message) /* Make compiler happy */
|
||||
#endif
|
||||
png_ptr = png_ptr; /* Make compiler happy */
|
||||
PNG_UNUSED(png_ptr) /* Make compiler happy */
|
||||
}
|
||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||
|
||||
|
||||
@@ -1230,7 +1230,7 @@ png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
{
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
png_error(png_ptr, "Out of place tEXt");
|
||||
/*NOT REACHED*/
|
||||
}
|
||||
@@ -1327,7 +1327,7 @@ png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
{
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
png_error(png_ptr, "Out of place zTXt");
|
||||
/*NOT REACHED*/
|
||||
}
|
||||
@@ -1531,7 +1531,7 @@ png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
{
|
||||
if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND))
|
||||
{
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
png_error(png_ptr, "Out of place iTXt");
|
||||
/*NOT REACHED*/
|
||||
}
|
||||
@@ -1669,7 +1669,7 @@ png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32
|
||||
#endif
|
||||
png_chunk_error(png_ptr, "unknown critical chunk");
|
||||
|
||||
info_ptr = info_ptr; /* To quiet some compiler warnings */
|
||||
PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
||||
|
||||
24
pngpriv.h
24
pngpriv.h
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngpriv.h - private declarations for use inside libpng
|
||||
*
|
||||
* libpng version 1.5.0beta55 - (PENDING RELEASE)
|
||||
* libpng version 1.5.0rc06 - (PENDING RELEASE)
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
@@ -63,9 +63,10 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
#endif
|
||||
|
||||
/* Moved to pngpriv.h at libpng-1.5.0 */
|
||||
/* NOTE: some of these may be used in external applications as these definitions
|
||||
* were exposed in pngconf.h prior to 1.5.
|
||||
/* NOTE: some of these may have been used in external applications as
|
||||
* these definitions were exposed in pngconf.h prior to 1.5.
|
||||
*/
|
||||
|
||||
/* If you are running on a machine where you cannot allocate more
|
||||
* than 64K of memory at once, uncomment this. While libpng will not
|
||||
* normally need that much memory in a chunk (unless you load up a very
|
||||
@@ -81,6 +82,15 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
# define PNG_MAX_MALLOC_64K
|
||||
#endif
|
||||
|
||||
/* Unused formal parameter errors are removed using the following macro
|
||||
* which is expected to have no bad effects on performance. Note that
|
||||
* if you replace it with something other than whitespace, you must include
|
||||
* the terminating semicolon.
|
||||
*/
|
||||
#ifndef PNG_UNUSED
|
||||
# define PNG_UNUSED(param) param = param;
|
||||
#endif
|
||||
|
||||
/* Just a little check that someone hasn't tried to define something
|
||||
* contradictory.
|
||||
*/
|
||||
@@ -107,7 +117,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
* aren't usually used outside the library (as far as I know), so it is
|
||||
* debatable if they should be exported at all. In the future, when it
|
||||
* is possible to have run-time registry of chunk-handling functions,
|
||||
* some of these will be made available again.
|
||||
* some of these might be made available again.
|
||||
# define PNG_EXTERN extern
|
||||
*/
|
||||
# define PNG_EXTERN
|
||||
@@ -247,6 +257,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
/* CONSTANTS and UTILITY MACROS
|
||||
* These are used internally by libpng and not exposed in the API
|
||||
*/
|
||||
|
||||
/* Various modes of operation. Note that after an init, mode is set to
|
||||
* zero automatically when the structure is created.
|
||||
*/
|
||||
@@ -399,8 +410,9 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp;
|
||||
* its argument multiple times, so must be used with care. The
|
||||
* range checking uses the PNG specification values for a signed
|
||||
* 32 bit fixed point value except that the values are deliberately
|
||||
* rounded-to-zero to an integral value - 21474. 's' is a string
|
||||
* that describes the value being converted.
|
||||
* rounded-to-zero to an integral value - 21474 (21474.83 is roughly
|
||||
* (2^31-1) * 100000). 's' is a string that describes the value being
|
||||
* converted.
|
||||
*
|
||||
* NOTE: this macro will raise a png_error if the range check fails,
|
||||
* therefore it is normally only appropriate to use this on values
|
||||
|
||||
@@ -1457,8 +1457,8 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
/* Read rest of file, and get additional chunks in info_ptr - REQUIRED */
|
||||
png_read_end(png_ptr, info_ptr);
|
||||
|
||||
transforms = transforms; /* Quiet compiler warnings */
|
||||
params = params;
|
||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
||||
PNG_UNUSED(params)
|
||||
|
||||
}
|
||||
#endif /* PNG_INFO_IMAGE_SUPPORTED */
|
||||
|
||||
@@ -1068,7 +1068,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
*/
|
||||
png_ptr->transformations &= ~PNG_BACKGROUND;
|
||||
png_ptr->transformations &= ~PNG_GAMMA;
|
||||
png_ptr->transformations |= PNG_STRIP_ALPHA;
|
||||
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
|
||||
}
|
||||
|
||||
/* if (png_ptr->background_gamma_type!=PNG_BACKGROUND_GAMMA_UNKNOWN) */
|
||||
@@ -1202,7 +1202,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
|
||||
/* Handled alpha, still need to strip the channel. */
|
||||
png_ptr->transformations &= ~PNG_BACKGROUND;
|
||||
png_ptr->transformations |= PNG_STRIP_ALPHA;
|
||||
png_ptr->flags |= PNG_FLAG_STRIP_ALPHA;
|
||||
}
|
||||
#endif /* PNG_READ_BACKGROUND_SUPPORTED */
|
||||
|
||||
|
||||
64
pngrutil.c
64
pngrutil.c
@@ -781,7 +781,7 @@ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
|
||||
png_crc_finish(png_ptr, length);
|
||||
|
||||
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
||||
}
|
||||
|
||||
#ifdef PNG_READ_gAMA_SUPPORTED
|
||||
@@ -2619,7 +2619,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||
png_crc_finish(png_ptr, skip);
|
||||
|
||||
#ifndef PNG_READ_USER_CHUNKS_SUPPORTED
|
||||
info_ptr = info_ptr; /* Quiet compiler warnings about unused info_ptr */
|
||||
PNG_UNUSED(info_ptr) /* Quiet compiler warnings about unused info_ptr */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3110,7 +3110,7 @@ png_do_read_interlace(png_structp png_ptr)
|
||||
row_info->rowbytes = PNG_ROWBYTES(row_info->pixel_depth, final_width);
|
||||
}
|
||||
#ifndef PNG_READ_PACKSWAP_SUPPORTED
|
||||
transformations = transformations; /* Silence compiler warning */
|
||||
PNG_UNUSED(transformations) /* Silence compiler warning */
|
||||
#endif
|
||||
}
|
||||
#endif /* PNG_READ_INTERLACING_SUPPORTED */
|
||||
@@ -3293,15 +3293,12 @@ png_read_finish_row(png_structp png_ptr)
|
||||
png_pass_yinc[png_ptr->pass] - 1 -
|
||||
png_pass_ystart[png_ptr->pass]) /
|
||||
png_pass_yinc[png_ptr->pass];
|
||||
|
||||
if (!(png_ptr->num_rows))
|
||||
continue;
|
||||
}
|
||||
|
||||
else /* if (png_ptr->transformations & PNG_INTERLACE) */
|
||||
break;
|
||||
break; /* libpng deinterlacing sees every row */
|
||||
|
||||
} while (png_ptr->iwidth == 0);
|
||||
} while (png_ptr->num_rows == 0 || png_ptr->iwidth == 0);
|
||||
|
||||
if (png_ptr->pass < 7)
|
||||
return;
|
||||
@@ -3614,55 +3611,4 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
|
||||
|
||||
png_ptr->flags |= PNG_FLAG_ROW_INIT;
|
||||
}
|
||||
|
||||
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED
|
||||
int PNGAPI
|
||||
png_get_num_passes(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
if (png_ptr->interlaced)
|
||||
return 7;
|
||||
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Here on error */
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_num_rows(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
if (png_ptr->flags & PNG_FLAG_ROW_INIT)
|
||||
return png_ptr->num_rows;
|
||||
|
||||
else
|
||||
png_error(png_ptr, "Call png_start_read_image or png_read_update_info "
|
||||
"before png_get_num_rows");
|
||||
}
|
||||
|
||||
/* Here on error */
|
||||
return 0;
|
||||
}
|
||||
|
||||
png_uint_32 PNGAPI
|
||||
png_get_num_cols(png_structp png_ptr)
|
||||
{
|
||||
if (png_ptr != NULL)
|
||||
{
|
||||
if (png_ptr->flags & PNG_FLAG_ROW_INIT)
|
||||
return png_ptr->iwidth;
|
||||
else
|
||||
png_error(png_ptr, "Call png_start_read_image or png_read_update_info "
|
||||
"before png_get_num_cols");
|
||||
}
|
||||
|
||||
/* Here on error */
|
||||
return 0;
|
||||
}
|
||||
#endif /* SEQUENTIAL READ */
|
||||
#endif /* PNG_READ_SUPPORTED */
|
||||
|
||||
@@ -425,7 +425,7 @@ static void PNGCBAPI
|
||||
pngtest_flush(png_structp png_ptr)
|
||||
{
|
||||
/* Do nothing; fflush() is said to be just a waste of energy. */
|
||||
png_ptr = png_ptr; /* Stifle compiler warning */
|
||||
PNG_UNUSED(png_ptr) /* Stifle compiler warning */
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1784,4 +1784,4 @@ main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_5_0beta55 Your_png_h_is_not_version_1_5_0beta55;
|
||||
typedef png_libpng_version_1_5_0rc06 Your_png_h_is_not_version_1_5_0rc06;
|
||||
|
||||
1506
pngvalid.c
1506
pngvalid.c
File diff suppressed because it is too large
Load Diff
@@ -1597,8 +1597,8 @@ png_write_png(png_structp png_ptr, png_infop info_ptr,
|
||||
/* It is REQUIRED to call this to finish writing the rest of the file */
|
||||
png_write_end(png_ptr, info_ptr);
|
||||
|
||||
transforms = transforms; /* Quiet compiler warnings */
|
||||
params = params;
|
||||
PNG_UNUSED(transforms) /* Quiet compiler warnings */
|
||||
PNG_UNUSED(params)
|
||||
}
|
||||
#endif
|
||||
#endif /* PNG_WRITE_SUPPORTED */
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng14.dll"
|
||||
LinkIncremental="1"
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"/>
|
||||
OutputFile="$(OutDir)/libpng15.dll"
|
||||
LinkIncremental="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
@@ -79,8 +78,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng14d.dll"
|
||||
ModuleDefinitionFile="..\..\scripts\pngwin.def"
|
||||
OutputFile="$(OutDir)/libpng15d.dll"
|
||||
GenerateDebugInformation="TRUE"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
@@ -128,7 +126,7 @@
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/libpng14vb.dll"
|
||||
OutputFile="$(OutDir)/libpng15vb.dll"
|
||||
LinkIncremental="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
@@ -340,27 +338,6 @@
|
||||
<File
|
||||
RelativePath="..\..\pngtrans.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\scripts\pngwin.def">
|
||||
<FileConfiguration
|
||||
Name="DLL VB|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="LIB Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="LIB Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\pngwio.c">
|
||||
</File>
|
||||
|
||||
@@ -130,7 +130,7 @@ $(TargetPath) ..\..\pngtest.png $(IntDir)\pngout.png"
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/pngtest.exe"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="$(IntDir)\libpng14b.lib"
|
||||
IgnoreDefaultLibraryNames="$(IntDir)\libpng15b.lib"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
VisualStudio instructions
|
||||
|
||||
libpng version 1.5.0beta55 - November 21, 2010
|
||||
libpng version 1.5.0rc06 - January 4, 2011
|
||||
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* zlib.props - location of zlib source
|
||||
*
|
||||
* libpng version 1.5.0beta55 - November 21, 2010
|
||||
* libpng version 1.5.0rc06 - January 4, 2011
|
||||
*
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
Makefiles for libpng version 1.5.0beta55 - November 21, 2010
|
||||
Makefiles for libpng version 1.5.0rc06 - January 4, 2011
|
||||
|
||||
pnglibconf.h.prebuilt => Stores configuration settings
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng15.so.15.1.5.0beta55)
|
||||
(gcc, creates libpng15.so.15.1.5.0rc06)
|
||||
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
|
||||
makefile.knr => Archaic UNIX Makefile that converts files with
|
||||
ansi2knr (Requires ansi2knr.c from
|
||||
@@ -20,7 +20,7 @@ pnglibconf.h.prebuilt => Stores configuration settings
|
||||
makefile.dec => DEC Alpha UNIX makefile
|
||||
makefile.dj2 => DJGPP 2 makefile
|
||||
makefile.elf => Linux/ELF makefile symbol versioning,
|
||||
(gcc, creates libpng15.so.15.1.5.0beta55)
|
||||
(gcc, creates libpng15.so.15.1.5.0rc06)
|
||||
makefile.freebsd => FreeBSD makefile
|
||||
makefile.gcc => Generic gcc makefile
|
||||
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.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
|
||||
makefile.sggcc => Silicon Graphics (gcc,
|
||||
creates libpng15.so.15.1.5.0beta55)
|
||||
creates libpng15.so.15.1.5.0rc06)
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng15.so.15.1.5.0beta55)
|
||||
creates libpng15.so.15.1.5.0rc06)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng15.so.15.1.5.0beta55)
|
||||
creates libpng15.so.15.1.5.0rc06)
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
|
||||
@@ -20,6 +20,7 @@ BEGIN{
|
||||
lasto = 0 # last ordinal value from png.h
|
||||
mastero = 0 # highest ordinal in master file
|
||||
symbolo = 0 # highest ordinal in png.h
|
||||
missing = "error"# log an error on missing symbols
|
||||
}
|
||||
|
||||
# Read existing definitions from the master file (the first
|
||||
@@ -44,6 +45,13 @@ FILENAME==master && NF==2 && $2~/^@/ && $1!~/^;/ {
|
||||
print master ": bad export line format:", $0
|
||||
err = 1
|
||||
}
|
||||
FILENAME==master && $1==";missing" && NF==2{
|
||||
# This allows the master file to control how missing symbols
|
||||
# are handled; symbols that aren't in either the master or
|
||||
# the new file. Valid values are 'ignore', 'warning' and
|
||||
# 'error'
|
||||
missing = $2
|
||||
}
|
||||
FILENAME==master {
|
||||
next
|
||||
}
|
||||
@@ -112,11 +120,19 @@ END{
|
||||
}
|
||||
}
|
||||
if (unexported != 0) {
|
||||
# Symbols in the .def but not in the new file are errors
|
||||
if (o-1 > unexported)
|
||||
print "png.h: warning: unexported symbol definitions:", unexported "-" o-1
|
||||
else
|
||||
print "png.h: warning: unexported symbol definition:", unexported
|
||||
# Symbols in the .def but not in the new file are errors, but
|
||||
# the 'unexported' symbols aren't in either. By default this
|
||||
# is an error too (see the setting of 'missing' at the start),
|
||||
# but this can be reset on the command line or by stuff in the
|
||||
# file - see the comments above.
|
||||
if (missing != "ignore") {
|
||||
if (o-1 > unexported)
|
||||
print "png.h:", missing ": missing symbols:", unexported "-" o-1
|
||||
else
|
||||
print "png.h:", missing ": missing symbol:", unexported
|
||||
if (missing != "warning")
|
||||
err = 1
|
||||
}
|
||||
unexported = 0
|
||||
}
|
||||
if (symbol[o] != "" && removed[o] != "") {
|
||||
|
||||
38
scripts/def.dfn
Normal file
38
scripts/def.dfn
Normal file
@@ -0,0 +1,38 @@
|
||||
/* def.dfn - define format of libpng.def
|
||||
*
|
||||
* Last changed in libpng version 1.5.0 [(PENDING RELEASE)]
|
||||
* Copyright (c) 2010-2010 Glenn Randers-Pehrson
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
/* These macros exist to make the header and trailer shorter below: */
|
||||
#define S PNG_DEFN_MAGIC
|
||||
#define E PNG_DEFN_END
|
||||
|
||||
/* Write the export file header: */
|
||||
S-;---------------------------------------------------------------E
|
||||
S-; LIBPNG module definition file for OS/2-E
|
||||
S-;---------------------------------------------------------------E
|
||||
S--E
|
||||
S-; If you give the library an explicit name one or other files-E
|
||||
S-; may need modifying to support the new name on one or more-E
|
||||
S-; systems.-E
|
||||
S-LIBRARY-E
|
||||
S-OS2 DESCRIPTION "PNG image compression library"-E
|
||||
S-OS2 CODE PRELOAD MOVEABLE DISCARDABLE-E
|
||||
S--E
|
||||
S-EXPORTS-E
|
||||
S-;Version 1.5.0beta58-E
|
||||
|
||||
/* NOTE: @@@ is interpreted by the calling script as a signal to
|
||||
* join the two things on either side, so we can do symbol
|
||||
* substitution within the name, regular C ## joins the pp-tokens,
|
||||
* not their final values.
|
||||
*/
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name-PNG_DEFN_END
|
||||
|
||||
#include "../png.h"
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.5.0beta55
|
||||
version=1.5.0rc06
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng15
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.5.0beta55
|
||||
Version: 1.5.0rc06
|
||||
Libs: -L${libdir} -lpng15
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15
|
||||
|
||||
LIB= png15
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.5.0beta55
|
||||
SHLIB_MINOR= 1.5.0rc06
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
|
||||
|
||||
LIB= png
|
||||
SHLIB_MAJOR= 3
|
||||
SHLIB_MINOR= 1.5.0beta55
|
||||
SHLIB_MINOR= 1.5.0rc06
|
||||
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
|
||||
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
|
||||
pngwtran.c pngmem.c pngerror.c pngpread.c
|
||||
|
||||
@@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
|
||||
MANDIR= ${PREFIX}/man/cat
|
||||
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.5.0beta55
|
||||
SHLIB_MINOR= 1.5.0rc06
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
# makefile for libpng on OS/2 with gcc
|
||||
#
|
||||
# This code is released under the libpng license.
|
||||
# For conditions of distribution and use, see the disclaimer
|
||||
# and license in png.h
|
||||
|
||||
# Related files: scripts/pngwin.def
|
||||
|
||||
CC=gcc -Zomf -s
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
ZLIBLIB=../zlib
|
||||
ZLIBINC=../zlib
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
CFLAGS=-I$(ZLIBINC) -W -Wall -O6 -funroll-loops -malign-loops=2 \
|
||||
-malign-functions=2 #$(WARNMORE) -g -DPNG_DEBUG=5
|
||||
LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lzdll -Zcrtdll
|
||||
AR=emxomfar
|
||||
|
||||
PNGLIB=png.lib
|
||||
IMPLIB=emximp
|
||||
SHAREDLIB=png.dll
|
||||
SHAREDLIBIMP=pngdll.lib
|
||||
|
||||
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
|
||||
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
|
||||
pngwtran.o pngmem.o pngerror.o pngpread.o
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
all: $(PNGLIB) $(SHAREDLIB) $(SHAREDLIBIMP)
|
||||
|
||||
# see scripts/pnglibconf.mak for more options
|
||||
pnglibconf.h: scripts/pnglibconf.h.prebuilt
|
||||
cp scripts/pnglibconf.h.prebuilt $@
|
||||
|
||||
$(PNGLIB): $(OBJS)
|
||||
$(AR) rc $@ $(OBJS)
|
||||
|
||||
$(SHAREDLIB): $(OBJS) scripts/pngwin.def
|
||||
$(CC) $(LDFLAGS) -Zdll -o $@ $^
|
||||
|
||||
$(SHAREDLIBIMP): scripts/pngwin.def
|
||||
$(IMPLIB) -o $@ $^
|
||||
|
||||
pngtest.exe: pngtest.o png.dll pngdll.lib
|
||||
$(CC) -o $@ $(CFLAGS) $< $(LDFLAGS)
|
||||
|
||||
test: pngtest.exe
|
||||
./pngtest.exe
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PNGLIB) png.dll pngdll.lib pngtest.exe pngout.png \
|
||||
pnglibconf.h
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
||||
|
||||
pngtest.o: png.h pngconf.h pnglibconf.h
|
||||
@@ -301,7 +301,7 @@ option READ_16BIT requires READ enables 16BIT
|
||||
option READ_QUANTIZE requires READ
|
||||
|
||||
option READ_TRANSFORMS requires READ
|
||||
= NO_READ_TRANSFORMS PNG_READ_TRANSFORMS_NOT_SUPPORTED
|
||||
= NO_READ_TRANSFORMS READ_TRANSFORMS_NOT_SUPPORTED
|
||||
|
||||
option READ_EXPAND requires READ_TRANSFORMS
|
||||
option READ_SHIFT requires READ_TRANSFORMS
|
||||
@@ -332,12 +332,12 @@ option SEQUENTIAL_READ requires READ
|
||||
#option READ_INTERLACING requires READ
|
||||
|
||||
option READ_COMPOSITE_NODIV requires READ
|
||||
= NO_READ_COMPOSITE_NODIV PNG_NO_READ_COMPOSITED_NODIV
|
||||
= NO_READ_COMPOSITE_NODIV NO_READ_COMPOSITED_NODIV
|
||||
|
||||
# Inch conversions
|
||||
|
||||
option INCH_CONVERSIONS
|
||||
= INCH_CONVERSIONS PNG_INCH_CONVERSIONS
|
||||
= INCH_CONVERSIONS INCH_CONVERSIONS
|
||||
|
||||
# IN DEVELOPMENT
|
||||
# These are currently experimental features, define them if you want
|
||||
@@ -355,7 +355,7 @@ option WRITE
|
||||
option WRITE_16BIT requires WRITE enables 16BIT
|
||||
|
||||
option WRITE_TRANSFORMS requires WRITE
|
||||
= NO_WRITE_TRANSFORMS PNG_WRITE_TRANSFORMS_NOT_SUPPORTED
|
||||
= NO_WRITE_TRANSFORMS WRITE_TRANSFORMS_NOT_SUPPORTED
|
||||
|
||||
option WRITE_SHIFT requires WRITE_TRANSFORMS
|
||||
option WRITE_PACK requires WRITE_TRANSFORMS
|
||||
|
||||
@@ -1,230 +0,0 @@
|
||||
;--------------------------------------------------------------
|
||||
; LIBPNG module definition file for Windows, WindowsCE and OS/2
|
||||
; On OS/2 uncomment lines preceded by ;0S2
|
||||
;--------------------------------------------------------------
|
||||
|
||||
; If you give the library an explicit name one or other files
|
||||
; may need modifying to support the new name on one or more
|
||||
; systems.
|
||||
LIBRARY
|
||||
;OS2 DESCRIPTION "PNG image compression library"
|
||||
;OS2 CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
|
||||
EXPORTS
|
||||
;Version 1.5.0beta55
|
||||
png_access_version_number @1
|
||||
png_set_sig_bytes @2
|
||||
png_sig_cmp @3
|
||||
png_create_read_struct @4
|
||||
png_create_write_struct @5
|
||||
png_get_compression_buffer_size @6
|
||||
png_set_compression_buffer_size @7
|
||||
png_set_longjmp_fn @8
|
||||
png_longjmp @9
|
||||
png_reset_zstream @10
|
||||
png_create_read_struct_2 @11
|
||||
png_create_write_struct_2 @12
|
||||
png_write_sig @13
|
||||
png_write_chunk @14
|
||||
png_write_chunk_start @15
|
||||
png_write_chunk_data @16
|
||||
png_write_chunk_end @17
|
||||
png_create_info_struct @18
|
||||
png_info_init_3 @19
|
||||
png_write_info_before_PLTE @20
|
||||
png_write_info @21
|
||||
png_read_info @22
|
||||
png_convert_to_rfc1123 @23
|
||||
png_convert_from_struct_tm @24
|
||||
png_convert_from_time_t @25
|
||||
png_set_expand @26
|
||||
png_set_expand_gray_1_2_4_to_8 @27
|
||||
png_set_palette_to_rgb @28
|
||||
png_set_tRNS_to_alpha @29
|
||||
png_set_bgr @30
|
||||
png_set_gray_to_rgb @31
|
||||
png_set_rgb_to_gray @32
|
||||
png_set_rgb_to_gray_fixed @33
|
||||
png_get_rgb_to_gray_status @34
|
||||
png_build_grayscale_palette @35
|
||||
png_set_strip_alpha @36
|
||||
png_set_swap_alpha @37
|
||||
png_set_invert_alpha @38
|
||||
png_set_filler @39
|
||||
png_set_add_alpha @40
|
||||
png_set_swap @41
|
||||
png_set_packing @42
|
||||
png_set_packswap @43
|
||||
png_set_shift @44
|
||||
png_set_interlace_handling @45
|
||||
png_set_invert_mono @46
|
||||
png_set_background @47
|
||||
png_set_strip_16 @48
|
||||
png_set_quantize @49
|
||||
png_set_gamma @50
|
||||
png_set_flush @51
|
||||
png_write_flush @52
|
||||
png_start_read_image @53
|
||||
png_read_update_info @54
|
||||
png_read_rows @55
|
||||
png_read_row @56
|
||||
png_read_image @57
|
||||
png_write_row @58
|
||||
png_write_rows @59
|
||||
png_write_image @60
|
||||
png_write_end @61
|
||||
png_read_end @62
|
||||
png_destroy_info_struct @63
|
||||
png_destroy_read_struct @64
|
||||
png_destroy_write_struct @65
|
||||
png_set_crc_action @66
|
||||
png_set_filter @67
|
||||
png_set_filter_heuristics @68
|
||||
png_set_compression_level @69
|
||||
png_set_compression_mem_level @70
|
||||
png_set_compression_strategy @71
|
||||
png_set_compression_window_bits @72
|
||||
png_set_compression_method @73
|
||||
png_init_io @74
|
||||
png_set_error_fn @75
|
||||
png_get_error_ptr @76
|
||||
png_set_write_fn @77
|
||||
png_set_read_fn @78
|
||||
png_get_io_ptr @79
|
||||
png_set_read_status_fn @80
|
||||
png_set_write_status_fn @81
|
||||
png_set_mem_fn @82
|
||||
png_get_mem_ptr @83
|
||||
png_set_read_user_transform_fn @84
|
||||
png_set_write_user_transform_fn @85
|
||||
png_set_user_transform_info @86
|
||||
png_get_user_transform_ptr @87
|
||||
png_set_read_user_chunk_fn @88
|
||||
png_get_user_chunk_ptr @89
|
||||
png_set_progressive_read_fn @90
|
||||
png_get_progressive_ptr @91
|
||||
png_process_data @92
|
||||
png_progressive_combine_row @93
|
||||
png_malloc @94
|
||||
png_calloc @95
|
||||
png_malloc_warn @96
|
||||
png_free @97
|
||||
png_free_data @98
|
||||
png_data_freer @99
|
||||
png_malloc_default @100
|
||||
png_free_default @101
|
||||
png_error @102
|
||||
png_chunk_error @103
|
||||
png_warning @105
|
||||
png_chunk_warning @106
|
||||
png_benign_error @107
|
||||
png_chunk_benign_error @108
|
||||
png_set_benign_errors @109
|
||||
png_get_valid @110
|
||||
png_get_rowbytes @111
|
||||
png_get_rows @112
|
||||
png_set_rows @113
|
||||
png_get_channels @114
|
||||
png_get_image_width @115
|
||||
png_get_image_height @116
|
||||
png_get_bit_depth @117
|
||||
png_get_color_type @118
|
||||
png_get_filter_type @119
|
||||
png_get_interlace_type @120
|
||||
png_get_compression_type @121
|
||||
png_get_pixels_per_meter @122
|
||||
png_get_x_pixels_per_meter @123
|
||||
png_get_y_pixels_per_meter @124
|
||||
png_get_pixel_aspect_ratio @125
|
||||
png_get_x_offset_pixels @126
|
||||
png_get_y_offset_pixels @127
|
||||
png_get_x_offset_microns @128
|
||||
png_get_y_offset_microns @129
|
||||
png_get_signature @130
|
||||
png_get_bKGD @131
|
||||
png_set_bKGD @132
|
||||
png_get_cHRM @133
|
||||
png_get_cHRM_fixed @134
|
||||
png_set_cHRM @135
|
||||
png_set_cHRM_fixed @136
|
||||
png_get_gAMA @137
|
||||
png_get_gAMA_fixed @138
|
||||
png_set_gAMA @139
|
||||
png_set_gAMA_fixed @140
|
||||
png_get_hIST @141
|
||||
png_set_hIST @142
|
||||
png_get_IHDR @143
|
||||
png_set_IHDR @144
|
||||
png_get_oFFs @145
|
||||
png_set_oFFs @146
|
||||
png_get_pCAL @147
|
||||
png_set_pCAL @148
|
||||
png_get_pHYs @149
|
||||
png_set_pHYs @150
|
||||
png_get_PLTE @151
|
||||
png_set_PLTE @152
|
||||
png_get_sBIT @153
|
||||
png_set_sBIT @154
|
||||
png_get_sRGB @155
|
||||
png_set_sRGB @156
|
||||
png_set_sRGB_gAMA_and_cHRM @157
|
||||
png_get_iCCP @158
|
||||
png_set_iCCP @159
|
||||
png_get_sPLT @160
|
||||
png_set_sPLT @161
|
||||
png_get_text @162
|
||||
png_set_text @163
|
||||
png_get_tIME @164
|
||||
png_set_tIME @165
|
||||
png_get_tRNS @166
|
||||
png_set_tRNS @167
|
||||
png_get_sCAL @168
|
||||
png_get_sCAL_s @169
|
||||
png_set_sCAL @170
|
||||
png_set_sCAL_s @171
|
||||
png_set_keep_unknown_chunks @172
|
||||
png_handle_as_unknown @173
|
||||
png_set_unknown_chunks @174
|
||||
png_set_unknown_chunk_location @175
|
||||
png_get_unknown_chunks @176
|
||||
png_set_invalid @177
|
||||
png_read_png @178
|
||||
png_write_png @179
|
||||
png_get_copyright @180
|
||||
png_get_header_ver @181
|
||||
png_get_header_version @182
|
||||
png_get_libpng_ver @183
|
||||
png_permit_mng_features @184
|
||||
png_set_user_limits @186
|
||||
png_get_user_width_max @187
|
||||
png_get_user_height_max @188
|
||||
png_set_chunk_cache_max @189
|
||||
png_get_chunk_cache_max @190
|
||||
png_set_chunk_malloc_max @191
|
||||
png_get_chunk_malloc_max @192
|
||||
png_get_pixels_per_inch @193
|
||||
png_get_x_pixels_per_inch @194
|
||||
png_get_y_pixels_per_inch @195
|
||||
png_get_x_offset_inches @196
|
||||
png_get_y_offset_inches @197
|
||||
png_get_pHYs_dpi @198
|
||||
png_get_io_state @199
|
||||
png_get_io_chunk_name @200
|
||||
png_get_uint_32 @201
|
||||
png_get_uint_16 @202
|
||||
png_get_int_32 @203
|
||||
png_get_uint_31 @204
|
||||
png_save_uint_32 @205
|
||||
png_save_int_32 @206
|
||||
png_save_uint_16 @207
|
||||
png_set_gamma_fixed @208
|
||||
png_set_filter_heuristics_fixed @209
|
||||
png_get_pixel_aspect_ratio_fixed @210
|
||||
png_get_x_offset_inches_fixed @211
|
||||
png_get_y_offset_inches_fixed @212
|
||||
png_set_sCAL_fixed @213
|
||||
png_get_sCAL_fixed @214
|
||||
png_get_num_passes @215
|
||||
png_get_num_rows @216
|
||||
png_set_background_fixed @217
|
||||
png_get_num_cols @218
|
||||
@@ -1,38 +0,0 @@
|
||||
|
||||
/* pngwin.dfn - define format of pngwin.def
|
||||
*
|
||||
* Last changed in libpng version 1.5.0 [(PENDING RELEASE)]
|
||||
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_EXPORT(type, name, args, attributes, ordinal)\
|
||||
PNG_DEFN_MAGIC- name @ordinal-PNG_DEFN_END
|
||||
#define PNG_REMOVED(type, name, args, attributes, ordinal)\
|
||||
PNG_DEFN_MAGIC-; name @ordinal-PNG_DEFN_END
|
||||
#define PNG_EXPORT_LAST_ORDINAL(ordinal)\
|
||||
PNG_DEFN_MAGIC-; @ordinal-PNG_DEFN_END
|
||||
|
||||
PNG_DEFN_MAGIC-;---------------------------------------------------------------PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-; LIBPNG module definition file for Windows, WindowsCE and OS/2-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-; On OS/2 uncomment lines preceded by ;0S2-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-;---------------------------------------------------------------PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC--PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-; If you give the library an explicit name one or other files-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-; may need modifying to support the new name on one or more-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-; systems.-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-LIBRARY-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-;OS2 DESCRIPTION "PNG image compression library"-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-;OS2 CODE PRELOAD MOVEABLE DISCARDABLE-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC--PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-EXPORTS-PNG_DEFN_END
|
||||
PNG_DEFN_MAGIC-;Version 1.5.0beta55-PNG_DEFN_END
|
||||
|
||||
/* Read the defaults, but use scripts/pnglibconf.h.prebuilt; the 'standard'
|
||||
* header file.
|
||||
*/
|
||||
#include "pnglibconf.h.prebuilt"
|
||||
#include "../png.h"
|
||||
@@ -9,7 +9,7 @@
|
||||
* and license in png.h
|
||||
*/
|
||||
|
||||
#define PNG_EXPORT(type, name, args, attributes, ordinal)\
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC-SYMBOL_PREFIX @@@ name-PNG_DEFN_END
|
||||
|
||||
#include "../png.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
;Version 1.5.0beta55
|
||||
;Version 1.5.0rc06
|
||||
png_access_version_number @1
|
||||
png_set_sig_bytes @2
|
||||
png_sig_cmp @3
|
||||
@@ -220,7 +220,4 @@ EXPORTS
|
||||
png_get_y_offset_inches_fixed @212
|
||||
png_set_sCAL_fixed @213
|
||||
png_get_sCAL_fixed @214
|
||||
png_get_num_passes @215
|
||||
png_get_num_rows @216
|
||||
png_set_background_fixed @217
|
||||
png_get_num_cols @218
|
||||
png_set_background_fixed @215
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
* .dfa file too.
|
||||
*/
|
||||
|
||||
#define PNG_EXPORT(type, name, args, attributes, ordinal)\
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC-name @ordinal-PNG_DEFN_END
|
||||
#define PNG_REMOVED(type, name, args, attributes, ordinal)\
|
||||
#define PNG_REMOVED(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC-; name @ordinal-PNG_DEFN_END
|
||||
#define PNG_EXPORT_LAST_ORDINAL(ordinal)\
|
||||
PNG_DEFN_MAGIC-; @ordinal-PNG_DEFN_END
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
* substitution within the name, regular C ## joins the pp-tokens,
|
||||
* not their final values.
|
||||
*/
|
||||
#define PNG_EXPORT(type, name, args, attributes, ordinal)\
|
||||
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\
|
||||
PNG_DEFN_MAGIC- SYMBOL_PREFIX @@@ name;-PNG_DEFN_END
|
||||
|
||||
#define TRAILER PNG_DEFN_MAGIC-local: *; };-PNG_DEFN_END
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
./pngtest ${srcdir}/pngtest.png
|
||||
echo "Running tests. For details see pngtest-log.txt"
|
||||
|
||||
echo "============ pngtest pngtest.png ==============" > pngtest-log.txt
|
||||
|
||||
echo "Running test-pngtest.sh"
|
||||
./pngtest ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1
|
||||
|
||||
29
test-pngvalid-full.sh
Executable file
29
test-pngvalid-full.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run a sequence of gamma tests quietly
|
||||
err=0
|
||||
|
||||
echo >> pngtest-log.txt
|
||||
echo "============ pngvalid-full.sh ==============" >> pngtest-log.txt
|
||||
|
||||
echo "Running test-pngvalid-full.sh -- it's lengthy, please wait..."
|
||||
for gamma in threshold transform sbit 16-to-8
|
||||
do
|
||||
opts=
|
||||
test "$gamma" = threshold || opts="$opts --nogamma-threshold"
|
||||
test "$gamma" = transform || opts="$opts --nogamma-transform"
|
||||
test "$gamma" = sbit || opts="$opts --nogamma-sbit"
|
||||
test "$gamma" = 16-to-8 || opts="$opts --nogamma-16-to-8"
|
||||
|
||||
if ./pngvalid --nostandard $opts >> pngtest-log.txt 2>&1
|
||||
then
|
||||
echo " PASS:" pngvalid "(gamma-$gamma)"
|
||||
else
|
||||
echo " FAIL:" pngvalid "(gamma-$gamma)"
|
||||
err=1
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
|
||||
exit $err
|
||||
28
test-pngvalid-simple.sh
Executable file
28
test-pngvalid-simple.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run a sequence of tests quietly, without the slow
|
||||
# gamma tests
|
||||
err=0
|
||||
|
||||
echo >> pngtest-log.txt
|
||||
echo "============ pngvalid-simple.sh ==============" >> pngtest-log.txt
|
||||
echo "Running test-pngvalid-simple.sh"
|
||||
# The options to test are:
|
||||
#
|
||||
# --progressive-read, --interlace on the 'transform' images
|
||||
# --progressive-read on the 'size' images
|
||||
#
|
||||
for opts in "" --progressive-read --interlace \
|
||||
"--progressive-read --interlace" "--nostandard --size" \
|
||||
"--nostandard --size --progressive-read"
|
||||
do
|
||||
if ./pngvalid --nogamma $opts >> pngtest-log.txt 2>&1
|
||||
then
|
||||
echo " PASS:" pngvalid --nogamma $opts
|
||||
else
|
||||
echo " FAIL:" pngvalid --nogamma $opts
|
||||
err=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $err
|
||||
Reference in New Issue
Block a user