mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Compare commits
12 Commits
v1.5.3beta
...
v1.5.3beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f68453d4a | ||
|
|
0a048923ae | ||
|
|
5441e18988 | ||
|
|
db0ed3e62d | ||
|
|
8a7ec52c8b | ||
|
|
66e1b3abba | ||
|
|
cd116fa248 | ||
|
|
c261077788 | ||
|
|
55fbff358a | ||
|
|
1921e6db90 | ||
|
|
bb4f77cd95 | ||
|
|
5ca62c9f35 |
36
ANNOUNCE
36
ANNOUNCE
@@ -1,5 +1,5 @@
|
||||
|
||||
Libpng 1.5.3beta08 - May 16, 2011
|
||||
Libpng 1.5.3beta10 - May 20, 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.3beta08.tar.xz (LZMA-compressed, recommended)
|
||||
1.5.3beta08.tar.gz
|
||||
1.5.3beta08.tar.bz2
|
||||
1.5.3beta10.tar.xz (LZMA-compressed, recommended)
|
||||
1.5.3beta10.tar.gz
|
||||
1.5.3beta10.tar.bz2
|
||||
|
||||
Source files with CRLF line endings (for Windows), without the
|
||||
"configure" script
|
||||
|
||||
lp153b08.7z (LZMA-compressed, recommended)
|
||||
lp153b08.zip
|
||||
lp153b10.7z (LZMA-compressed, recommended)
|
||||
lp153b10.zip
|
||||
|
||||
Other information:
|
||||
|
||||
1.5.3beta08-README.txt
|
||||
1.5.3beta08-LICENSE.txt
|
||||
1.5.3beta10-README.txt
|
||||
1.5.3beta10-LICENSE.txt
|
||||
|
||||
Changes since the last public release (1.5.2):
|
||||
|
||||
@@ -123,10 +123,28 @@ Version 1.5.3beta08 [May 16, 2011]
|
||||
header is read. It never performed any useful function to override
|
||||
the default anyway.
|
||||
Added memory overwrite and palette image checks to pngvalid.c
|
||||
Previously palette image code was poorly checked, since the transformation
|
||||
Previously palette image code was poorly checked. Since the transformation
|
||||
code has a special palette path in most cases this was a severe weakness.
|
||||
Minor cleanup and some extra checking in pngrutil.c and pngrtran.c
|
||||
|
||||
Version 1.5.3beta09 [May 17, 2011]
|
||||
Reversed earlier 1.5.3 change of transformation order; move png_expand_16 back.
|
||||
The change doesn't work because it requires 16-bit gamma tables when the code
|
||||
only generates 8-bit ones. This fails silently; the libpng code just doesn't
|
||||
do any gamma correction. Moving the tests back leaves the old, inaccurate,
|
||||
8-bit gamma calculations, but these are clearly better than none!
|
||||
|
||||
Version 1.5.3beta10 [May 20, 2011]
|
||||
png_set_background() and png_expand_16() did not work together correctly.
|
||||
This problem is present in 1.5.2; if png_set_background is called with
|
||||
need_expand false and the matching 16 bit color libpng erroneously just
|
||||
treats it as an 8-bit color because of where png_do_expand_16 is in the
|
||||
transform list. This simple fix reduces the supplied colour to 8-bits,
|
||||
so it gets smashed, but this is better than the current behavior.
|
||||
Added tests for expand16, more fixes for palette image tests to pngvalid.
|
||||
Corrects the code for palette image tests and disables attempts to
|
||||
validate palette colors.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
||||
32
CHANGES
32
CHANGES
@@ -15,7 +15,7 @@ Version 0.3
|
||||
fixed some bugs in writer
|
||||
interfaced with zlib 0.5
|
||||
added K&R support
|
||||
added check for 64 KB blocks for 16 bit machines
|
||||
added check for 64 KB blocks for 16-bit machines
|
||||
|
||||
Version 0.4
|
||||
cleaned up code and commented code
|
||||
@@ -74,7 +74,7 @@ Version 0.82 [September, 1995]
|
||||
Version 0.85 [December, 1995]
|
||||
added more medium model code (almost everything's a far)
|
||||
added i/o, error, and memory callback functions
|
||||
fixed some bugs (16 bit, 4 bit interlaced, etc.)
|
||||
fixed some bugs (16-bit, 4-bit interlaced, etc.)
|
||||
added first run progressive reader (barely tested)
|
||||
|
||||
Version 0.86 [January, 1996]
|
||||
@@ -2935,7 +2935,7 @@ Version 1.5.0beta36 [July 29, 2010]
|
||||
PNG_INTERLACE transform and to get the number of rows in the current
|
||||
pass.
|
||||
A new test program, pngvalid.c, validates the gamma code.
|
||||
Errors in the 16 bit gamma correction (overflows) have been corrected.
|
||||
Errors in the 16-bit gamma correction (overflows) have been corrected.
|
||||
cHRM chunk testing is done consistently (previously the floating point
|
||||
API bypassed it, because the test really didn't work on FP, now the test
|
||||
is performed on the actual values to be stored in the PNG file so it
|
||||
@@ -3227,7 +3227,7 @@ Version 1.5.1beta10 [January 27, 2010]
|
||||
Version 1.5.1beta11 [January 28, 2011]
|
||||
Changed PNG_UNUSED from "param=param;" to "{if(param){}}".
|
||||
Corrected local variable type in new API png_process_data_skip()
|
||||
The type was self-evidently incorrect but only causes problems on 64 bit
|
||||
The type was self-evidently incorrect but only causes problems on 64-bit
|
||||
architectures.
|
||||
Added transform tests to pngvalid and simplified the arguments.
|
||||
|
||||
@@ -3346,6 +3346,8 @@ Version 1.5.3beta05 [May 6, 2011]
|
||||
requiring the host OS to implement snprintf. As a side effect the
|
||||
dependency of the tIME-supporting RFC1132 code on stdio is removed and
|
||||
PNG_NO_WARNINGS does actually work now.
|
||||
Pass "" instead of '\0' to png_default_error() in png_err(). This mistake
|
||||
was introduced in libpng-1.2.20beta01.
|
||||
Added PNG_WRITE_OPTIMIZE_CMF_SUPPORTED macro to make the zlib "CMF" byte
|
||||
optimization configureable.
|
||||
IDAT compression failed if preceded by a compressed text chunk (bug
|
||||
@@ -3382,10 +3384,30 @@ Version 1.5.3beta08 [May 16, 2011]
|
||||
header is read. It never performed any useful function to override
|
||||
the default anyway.
|
||||
Added memory overwrite and palette image checks to pngvalid.c
|
||||
Previously palette image code was poorly checked, since the transformation
|
||||
Previously palette image code was poorly checked. Since the transformation
|
||||
code has a special palette path in most cases this was a severe weakness.
|
||||
Minor cleanup and some extra checking in pngrutil.c and pngrtran.c
|
||||
|
||||
Version 1.5.3beta09 [May 17, 2011]
|
||||
Reversed earlier 1.5.3 change of transformation order; move png_expand_16
|
||||
back where it was. The change doesn't work because it requires 16-bit
|
||||
gamma tables when the code only generates 8-bit ones. This fails
|
||||
silently; the libpng code just doesn't do any gamma correction. Moving
|
||||
the tests back leaves the old, inaccurate, 8-bit gamma calculations, but
|
||||
these are clearly better than none!
|
||||
|
||||
Version 1.5.3beta10 [May 20, 2011]
|
||||
|
||||
png_set_background() and png_expand_16() did not work together correctly.
|
||||
This problem is present in 1.5.2; if png_set_background is called with
|
||||
need_expand false and the matching 16 bit color libpng erroneously just
|
||||
treats it as an 8-bit color because of where png_do_expand_16 is in the
|
||||
transform list. This simple fix reduces the supplied colour to 8-bits,
|
||||
so it gets smashed, but this is better than the current behavior.
|
||||
Added tests for expand16, more fixes for palette image tests to pngvalid.
|
||||
Corrects the code for palette image tests and disables attempts to
|
||||
validate palette colors.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
|
||||
|
||||
@@ -260,7 +260,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.3beta08
|
||||
# VERSION 15.${PNGLIB_RELEASE}.1.5.3beta10
|
||||
VERSION 15.${PNGLIB_RELEASE}.0
|
||||
SOVERSION 15
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
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.3beta08, May 16, 2011, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.3beta10, May 20, 2011, are
|
||||
Copyright (c) 2004, 2006-2011 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
|
||||
May 16, 2011
|
||||
May 20, 2011
|
||||
|
||||
2
README
2
README
@@ -1,4 +1,4 @@
|
||||
README for libpng version 1.5.3beta08 - May 16, 2011 (shared library 15.0)
|
||||
README for libpng version 1.5.3beta10 - May 20, 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.
|
||||
|
||||
22
configure
vendored
22
configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.68 for libpng 1.5.3beta08.
|
||||
# Generated by GNU Autoconf 2.68 for libpng 1.5.3beta10.
|
||||
#
|
||||
# Report bugs to <png-mng-implement@lists.sourceforge.net>.
|
||||
#
|
||||
@@ -570,8 +570,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='libpng'
|
||||
PACKAGE_TARNAME='libpng'
|
||||
PACKAGE_VERSION='1.5.3beta08'
|
||||
PACKAGE_STRING='libpng 1.5.3beta08'
|
||||
PACKAGE_VERSION='1.5.3beta10'
|
||||
PACKAGE_STRING='libpng 1.5.3beta10'
|
||||
PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures libpng 1.5.3beta08 to adapt to many kinds of systems.
|
||||
\`configure' configures libpng 1.5.3beta10 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1377,7 +1377,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of libpng 1.5.3beta08:";;
|
||||
short | recursive ) echo "Configuration of libpng 1.5.3beta10:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1485,7 +1485,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
libpng configure 1.5.3beta08
|
||||
libpng configure 1.5.3beta10
|
||||
generated by GNU Autoconf 2.68
|
||||
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
@@ -1908,7 +1908,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by libpng $as_me 1.5.3beta08, which was
|
||||
It was created by libpng $as_me 1.5.3beta10, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2723,7 +2723,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='libpng'
|
||||
VERSION='1.5.3beta08'
|
||||
VERSION='1.5.3beta10'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -2787,7 +2787,7 @@ fi
|
||||
|
||||
|
||||
|
||||
PNGLIB_VERSION=1.5.3beta08
|
||||
PNGLIB_VERSION=1.5.3beta10
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=5
|
||||
PNGLIB_RELEASE=3
|
||||
@@ -13040,7 +13040,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by libpng $as_me 1.5.3beta08, which was
|
||||
This file was extended by libpng $as_me 1.5.3beta10, which was
|
||||
generated by GNU Autoconf 2.68. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -13106,7 +13106,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
libpng config.status 1.5.3beta08
|
||||
libpng config.status 1.5.3beta10
|
||||
configured by $0, generated by GNU Autoconf 2.68,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ AC_PREREQ(2.59)
|
||||
|
||||
dnl Version number stuff here:
|
||||
|
||||
AC_INIT([libpng], [1.5.3beta08], [png-mng-implement@lists.sourceforge.net])
|
||||
AC_INIT([libpng], [1.5.3beta10], [png-mng-implement@lists.sourceforge.net])
|
||||
AM_INIT_AUTOMAKE
|
||||
dnl stop configure from automagically running automake
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
PNGLIB_VERSION=1.5.3beta08
|
||||
PNGLIB_VERSION=1.5.3beta10
|
||||
PNGLIB_MAJOR=1
|
||||
PNGLIB_MINOR=5
|
||||
PNGLIB_RELEASE=3
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
libpng version 1.5.3beta08 - May 16, 2011
|
||||
libpng version 1.5.3beta10 - May 20, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2011 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.3beta08 - May 16, 2011
|
||||
libpng versions 0.97, January 1998, through 1.5.3beta10 - May 20, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
|
||||
@@ -1451,8 +1451,8 @@ the information. If, instead, you want to convert the image to an opaque
|
||||
version with no alpha channel use png_set_background; see below.
|
||||
|
||||
As of libpng version 1.5.2, almost all useful expansions are supported, the
|
||||
major ommissions are convertion of grayscale to indexed images (which can be
|
||||
done trivially in the application) and convertion of indexed to grayscale (which
|
||||
major ommissions are conversion of grayscale to indexed images (which can be
|
||||
done trivially in the application) and conversion of indexed to grayscale (which
|
||||
can be done by a trivial manipulation of the palette.)
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
@@ -4400,13 +4400,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
XIV. Y2K Compliance in libpng
|
||||
|
||||
May 16, 2011
|
||||
May 20, 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.3beta08 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.3beta10 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
|
||||
|
||||
24
libpng.3
24
libpng.3
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNG 3 "May 16, 2011"
|
||||
.TH LIBPNG 3 "May 20, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta08
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta10
|
||||
.SH SYNOPSIS
|
||||
\fI\fB
|
||||
|
||||
@@ -951,7 +951,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.3beta08 - May 16, 2011
|
||||
libpng version 1.5.3beta10 - May 20, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
<glennrp at users.sourceforge.net>
|
||||
Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
@@ -962,7 +962,7 @@ libpng-manual.txt - A description on how to use and modify libpng
|
||||
|
||||
Based on:
|
||||
|
||||
libpng versions 0.97, January 1998, through 1.5.3beta08 - May 16, 2011
|
||||
libpng versions 0.97, January 1998, through 1.5.3beta10 - May 20, 2011
|
||||
Updated and distributed by Glenn Randers-Pehrson
|
||||
Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
|
||||
@@ -2402,8 +2402,8 @@ the information. If, instead, you want to convert the image to an opaque
|
||||
version with no alpha channel use png_set_background; see below.
|
||||
|
||||
As of libpng version 1.5.2, almost all useful expansions are supported, the
|
||||
major ommissions are convertion of grayscale to indexed images (which can be
|
||||
done trivially in the application) and convertion of indexed to grayscale (which
|
||||
major ommissions are conversion of grayscale to indexed images (which can be
|
||||
done trivially in the application) and conversion of indexed to grayscale (which
|
||||
can be done by a trivial manipulation of the palette.)
|
||||
|
||||
In the following table, the 01 means grayscale with depth<8, 31 means
|
||||
@@ -5351,13 +5351,13 @@ Other rules can be inferred by inspecting the libpng source.
|
||||
|
||||
.SH XIV. Y2K Compliance in libpng
|
||||
|
||||
May 16, 2011
|
||||
May 20, 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.3beta08 are Y2K compliant. It is my belief that earlier
|
||||
upward through 1.5.3beta10 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
|
||||
@@ -5546,7 +5546,7 @@ the first widely used release:
|
||||
1.5.2beta01-03 15 10502 15.so.15.2[.0]
|
||||
1.5.2rc01-03 15 10502 15.so.15.2[.0]
|
||||
1.5.2 15 10502 15.so.15.2[.0]
|
||||
1.5.3beta01-08 15 10503 15.so.15.3[.0]
|
||||
1.5.3beta01-10 15 10503 15.so.15.3[.0]
|
||||
|
||||
Henceforth the source version will match the shared-library minor
|
||||
and patch numbers; the shared-library major version number will be
|
||||
@@ -5603,7 +5603,7 @@ possible without all of you.
|
||||
|
||||
Thanks to Frank J. T. Wojcik for helping with the documentation.
|
||||
|
||||
Libpng version 1.5.3beta08 - May 16, 2011:
|
||||
Libpng version 1.5.3beta10 - May 20, 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).
|
||||
|
||||
@@ -5626,7 +5626,7 @@ this sentence.
|
||||
|
||||
This code is released under the libpng license.
|
||||
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.3beta08, May 16, 2011, are
|
||||
libpng versions 1.2.6, August 15, 2004, through 1.5.3beta10, May 20, 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
|
||||
@@ -5725,7 +5725,7 @@ certification mark of the Open Source Initiative.
|
||||
|
||||
Glenn Randers-Pehrson
|
||||
glennrp at users.sourceforge.net
|
||||
May 16, 2011
|
||||
May 20, 2011
|
||||
|
||||
.\" end of man page
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.TH LIBPNGPF 3 "May 16, 2011"
|
||||
.TH LIBPNGPF 3 "May 20, 2011"
|
||||
.SH NAME
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta08
|
||||
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.3beta10
|
||||
(private functions)
|
||||
.SH SYNOPSIS
|
||||
\fB#include \fI"pngpriv.h"
|
||||
|
||||
2
png.5
2
png.5
@@ -1,4 +1,4 @@
|
||||
.TH PNG 5 "May 16, 2011"
|
||||
.TH PNG 5 "May 20, 2011"
|
||||
.SH NAME
|
||||
png \- Portable Network Graphics (PNG) format
|
||||
.SH DESCRIPTION
|
||||
|
||||
96
png.c
96
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_3beta08 Your_png_h_is_not_version_1_5_3beta08;
|
||||
typedef png_libpng_version_1_5_3beta10 Your_png_h_is_not_version_1_5_3beta10;
|
||||
|
||||
/* 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
|
||||
@@ -619,13 +619,13 @@ png_get_copyright(png_const_structp png_ptr)
|
||||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.5.3beta08 - May 16, 2011" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.5.3beta10 - May 20, 2011" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2011 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.3beta08 - May 16, 2011\
|
||||
return "libpng version 1.5.3beta10 - May 20, 2011\
|
||||
Copyright (c) 1998-2011 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||
@@ -1559,7 +1559,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
|
||||
r /= divisor;
|
||||
r = floor(r+.5);
|
||||
|
||||
/* A png_fixed_point is a 32 bit integer. */
|
||||
/* A png_fixed_point is a 32-bit integer. */
|
||||
if (r <= 2147483647. && r >= -2147483648.)
|
||||
{
|
||||
*res = (png_fixed_point)r;
|
||||
@@ -1604,7 +1604,7 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
|
||||
|
||||
if (s32 < D) /* else overflow */
|
||||
{
|
||||
/* s32.s00 is now the 64 bit product, do a standard
|
||||
/* s32.s00 is now the 64-bit product, do a standard
|
||||
* division, we know that s32 < D, so the maximum
|
||||
* required shift is 31.
|
||||
*/
|
||||
@@ -1747,7 +1747,7 @@ png_reciprocal2(png_fixed_point a, png_fixed_point b)
|
||||
* 2010: moved from pngset.c) */
|
||||
/*
|
||||
* Multiply two 32-bit numbers, V1 and V2, using 32-bit
|
||||
* arithmetic, to produce a 64 bit result in the HI/LO words.
|
||||
* arithmetic, to produce a 64-bit result in the HI/LO words.
|
||||
*
|
||||
* A B
|
||||
* x C D
|
||||
@@ -1791,17 +1791,17 @@ png_64bit_product (long v1, long v2, unsigned long *hi_product,
|
||||
/* Fixed point gamma.
|
||||
*
|
||||
* To calculate gamma this code implements fast log() and exp() calls using only
|
||||
* fixed point arithmetic. This code has sufficient precision for either 8 or
|
||||
* 16 bit sample values.
|
||||
* fixed point arithmetic. This code has sufficient precision for either 8-bit
|
||||
* or 16-bit sample values.
|
||||
*
|
||||
* The tables used here were calculated using simple 'bc' programs, but C double
|
||||
* precision floating point arithmetic would work fine. The programs are given
|
||||
* at the head of each table.
|
||||
*
|
||||
* 8 bit log table
|
||||
* 8-bit log table
|
||||
* This is a table of -log(value/255)/log(2) for 'value' in the range 128 to
|
||||
* 255, so it's the base 2 logarithm of a normalized 8 bit floating point
|
||||
* mantissa. The numbers are 32 bit fractions.
|
||||
* 255, so it's the base 2 logarithm of a normalized 8-bit floating point
|
||||
* mantissa. The numbers are 32-bit fractions.
|
||||
*/
|
||||
static png_uint_32
|
||||
png_8bit_l2[128] =
|
||||
@@ -1832,10 +1832,10 @@ png_8bit_l2[128] =
|
||||
172473545U, 147538590U, 122703574U, 97967701U, 73330182U, 48790236U,
|
||||
24347096U, 0U
|
||||
#if 0
|
||||
/* The following are the values for 16 bit tables - these work fine for the 8
|
||||
* bit conversions but produce very slightly larger errors in the 16 bit log
|
||||
* (about 1.2 as opposed to 0.7 absolute error in the final value). To use
|
||||
* these all the shifts below must be adjusted appropriately.
|
||||
/* The following are the values for 16-bit tables - these work fine for the
|
||||
* 8-bit conversions but produce very slightly larger errors in the 16-bit
|
||||
* log (about 1.2 as opposed to 0.7 absolute error in the final value). To
|
||||
* use these all the shifts below must be adjusted appropriately.
|
||||
*/
|
||||
65166, 64430, 63700, 62976, 62257, 61543, 60835, 60132, 59434, 58741, 58054,
|
||||
57371, 56693, 56020, 55352, 54689, 54030, 53375, 52726, 52080, 51439, 50803,
|
||||
@@ -1878,11 +1878,11 @@ png_log8bit(unsigned int x)
|
||||
return (png_int_32)((lg2 << 16) + ((png_8bit_l2[x-128]+32768)>>16));
|
||||
}
|
||||
|
||||
/* The above gives exact (to 16 binary places) log2 values for 8 bit images,
|
||||
* for 16 bit images we use the most significant 8 bits of the 16 bit value to
|
||||
/* The above gives exact (to 16 binary places) log2 values for 8-bit images,
|
||||
* for 16-bit images we use the most significant 8 bits of the 16-bit value to
|
||||
* get an approximation then multiply the approximation by a correction factor
|
||||
* determined by the remaining up to 8 bits. This requires an additional step
|
||||
* in the 16 bit case.
|
||||
* in the 16-bit case.
|
||||
*
|
||||
* We want log2(value/65535), we have log2(v'/255), where:
|
||||
*
|
||||
@@ -1891,8 +1891,8 @@ png_log8bit(unsigned int x)
|
||||
*
|
||||
* So f is value/v', which is equal to (256+v''/v') since v' is in the range 128
|
||||
* to 255 and v'' is in the range 0 to 255 f will be in the range 256 to less
|
||||
* than 258. The final factor also needs to correct for the fact that our 8 bit
|
||||
* value is scaled by 255, whereas the 16 bit values must be scaled by 65535.
|
||||
* than 258. The final factor also needs to correct for the fact that our 8-bit
|
||||
* value is scaled by 255, whereas the 16-bit values must be scaled by 65535.
|
||||
*
|
||||
* This gives a final formula using a calculated value 'x' which is value/v' and
|
||||
* scaling by 65536 to match the above table:
|
||||
@@ -1902,7 +1902,7 @@ png_log8bit(unsigned int x)
|
||||
* Since these numbers are so close to '1' we can use simple linear
|
||||
* interpolation between the two end values 256/257 (result -368.61) and 258/257
|
||||
* (result 367.179). The values used below are scaled by a further 64 to give
|
||||
* 16 bit precision in the interpolation:
|
||||
* 16-bit precision in the interpolation:
|
||||
*
|
||||
* Start (256): -23591
|
||||
* Zero (257): 0
|
||||
@@ -1929,7 +1929,7 @@ png_log16bit(png_uint_32 x)
|
||||
if ((x & 0x8000) == 0)
|
||||
lg2 += 1, x <<= 1;
|
||||
|
||||
/* Calculate the base logarithm from the top 8 bits as a 28 bit fractional
|
||||
/* Calculate the base logarithm from the top 8 bits as a 28-bit fractional
|
||||
* value.
|
||||
*/
|
||||
lg2 <<= 28;
|
||||
@@ -1959,18 +1959,18 @@ png_log16bit(png_uint_32 x)
|
||||
return (png_int_32)((lg2 + 2048) >> 12);
|
||||
}
|
||||
|
||||
/* The 'exp()' case must invert the above, taking a 20 bit fixed point
|
||||
* logarithmic value and returning a 16 or 8 bit number as appropriate. In
|
||||
/* The 'exp()' case must invert the above, taking a 20-bit fixed point
|
||||
* logarithmic value and returning a 16 or 8-bit number as appropriate. In
|
||||
* each case only the low 16 bits are relevant - the fraction - since the
|
||||
* integer bits (the top 4) simply determine a shift.
|
||||
*
|
||||
* The worst case is the 16 bit distinction between 65535 and 65534, this
|
||||
* The worst case is the 16-bit distinction between 65535 and 65534, this
|
||||
* requires perhaps spurious accuracty in the decoding of the logarithm to
|
||||
* distinguish log2(65535/65534.5) - 10^-5 or 17 bits. There is little chance
|
||||
* of getting this accuracy in practice.
|
||||
*
|
||||
* To deal with this the following exp() function works out the exponent of the
|
||||
* frational part of the logarithm by using an accurate 32 bit value from the
|
||||
* frational part of the logarithm by using an accurate 32-bit value from the
|
||||
* top four fractional bits then multiplying in the remaining bits.
|
||||
*/
|
||||
static png_uint_32
|
||||
@@ -1979,7 +1979,7 @@ png_32bit_exp[16] =
|
||||
# if PNG_DO_BC
|
||||
for (i=0;i<16;++i) { .5 + e(-i/16*l(2))*2^32; }
|
||||
# endif
|
||||
/* NOTE: the first entry is deliberately set to the maximum 32 bit value. */
|
||||
/* NOTE: the first entry is deliberately set to the maximum 32-bit value. */
|
||||
4294967295U, 4112874773U, 3938502376U, 3771522796U, 3611622603U, 3458501653U,
|
||||
3311872529U, 3171459999U, 3037000500U, 2908241642U, 2784941738U, 2666869345U,
|
||||
2553802834U, 2445529972U, 2341847524U, 2242560872U
|
||||
@@ -2007,7 +2007,7 @@ png_exp(png_fixed_point x)
|
||||
{
|
||||
if (x > 0 && x <= 0xfffff) /* Else overflow or zero (underflow) */
|
||||
{
|
||||
/* Obtain a 4 bit approximation */
|
||||
/* Obtain a 4-bit approximation */
|
||||
png_uint_32 e = png_32bit_exp[(x >> 12) & 0xf];
|
||||
|
||||
/* Incorporate the low 12 bits - these decrease the returned value by
|
||||
@@ -2053,10 +2053,10 @@ png_exp(png_fixed_point x)
|
||||
static png_byte
|
||||
png_exp8bit(png_fixed_point lg2)
|
||||
{
|
||||
/* Get a 32 bit value: */
|
||||
/* Get a 32-bit value: */
|
||||
png_uint_32 x = png_exp(lg2);
|
||||
|
||||
/* Convert the 32 bit value to 0..255 by multiplying by 256-1, note that the
|
||||
/* Convert the 32-bit value to 0..255 by multiplying by 256-1, note that the
|
||||
* second, rounding, step can't overflow because of the first, subtraction,
|
||||
* step.
|
||||
*/
|
||||
@@ -2067,10 +2067,10 @@ png_exp8bit(png_fixed_point lg2)
|
||||
static png_uint_16
|
||||
png_exp16bit(png_fixed_point lg2)
|
||||
{
|
||||
/* Get a 32 bit value: */
|
||||
/* Get a 32-bit value: */
|
||||
png_uint_32 x = png_exp(lg2);
|
||||
|
||||
/* Convert the 32 bit value to 0..65535 by multiplying by 65536-1: */
|
||||
/* Convert the 32-bit value to 0..65535 by multiplying by 65536-1: */
|
||||
x -= x >> 16;
|
||||
return (png_uint_16)((x + 32767U) >> 16);
|
||||
}
|
||||
@@ -2123,9 +2123,9 @@ png_gamma_16bit_correct(unsigned int value, png_fixed_point gamma_val)
|
||||
}
|
||||
|
||||
/* This does the right thing based on the bit_depth field of the
|
||||
* png_struct, interpreting values as 8 or 16 bit. While the result
|
||||
* is nominally a 16 bit value if bit depth is 8 then the result is
|
||||
* 8 bit (as are the arguments.)
|
||||
* png_struct, interpreting values as 8-bit or 16-bit. While the result
|
||||
* is nominally a 16-bit value if bit depth is 8 then the result is
|
||||
* 8-bit (as are the arguments.)
|
||||
*/
|
||||
png_uint_16 /* PRIVATE */
|
||||
png_gamma_correct(png_structp png_ptr, unsigned int value,
|
||||
@@ -2148,7 +2148,7 @@ png_gamma_significant(png_fixed_point gamma_val)
|
||||
gamma_val > PNG_FP_1 + PNG_GAMMA_THRESHOLD_FIXED;
|
||||
}
|
||||
|
||||
/* Internal function to build a single 16 bit table - the table consists of
|
||||
/* Internal function to build a single 16-bit table - the table consists of
|
||||
* 'num' 256 entry subtables, where 'num' is determined by 'shift' - the amount
|
||||
* to shift the input values right (or 16-number_of_signifiant_bits).
|
||||
*
|
||||
@@ -2175,7 +2175,7 @@ png_build_16bit_table(png_structp png_ptr, png_uint_16pp *ptable,
|
||||
(png_uint_16p)png_malloc(png_ptr, 256 * png_sizeof(png_uint_16));
|
||||
|
||||
/* The 'threshold' test is repeated here because it can arise for one of
|
||||
* the 16 bit tables even if the others don't hit it.
|
||||
* the 16-bit tables even if the others don't hit it.
|
||||
*/
|
||||
if (png_gamma_significant(gamma_val))
|
||||
{
|
||||
@@ -2237,7 +2237,7 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
|
||||
(png_uint_16pp)png_calloc(png_ptr, num * png_sizeof(png_uint_16p));
|
||||
|
||||
/* 'num' is the number of tables and also the number of low bits of low
|
||||
* bits of the input 16 bit value used to select a table. Each table is
|
||||
* bits of the input 16-bit value used to select a table. Each table is
|
||||
* itself index by the high 8 bits of the value.
|
||||
*/
|
||||
for (i = 0; i < num; i++)
|
||||
@@ -2247,24 +2247,24 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
|
||||
/* 'gamma_val' is set to the reciprocal of the value calculated above, so
|
||||
* pow(out,g) is an *input* value. 'last' is the last input value set.
|
||||
*
|
||||
* In the loop 'i' is used to find output values. Since the output is 8
|
||||
* bit there are only 256 possible values. The tables are set up to
|
||||
* In the loop 'i' is used to find output values. Since the output is
|
||||
* 8-bit there are only 256 possible values. The tables are set up to
|
||||
* select the closest possible output value for each input by finding
|
||||
* the input value at the boundary between each pair of output values
|
||||
* and filling the table up to that boundary with the lower output
|
||||
* value.
|
||||
*
|
||||
* The boundary values are 0.5,1.5..253.5,254.5. Since these are 9 bit
|
||||
* values the code below uses a 16 bit value in i; the values start at
|
||||
* The boundary values are 0.5,1.5..253.5,254.5. Since these are 9-bit
|
||||
* values the code below uses a 16-bit value in i; the values start at
|
||||
* 128.5 (for 0.5) and step by 257, for a total of 254 values (the last
|
||||
* entries are filled with 255). Start i at 128 and fill all 'last'
|
||||
* table entries <= 'max'
|
||||
*/
|
||||
last = 0;
|
||||
for (i = 0; i < 255; ++i) /* 8 bit output value */
|
||||
for (i = 0; i < 255; ++i) /* 8-bit output value */
|
||||
{
|
||||
/* Find the corresponding maximum input value */
|
||||
png_uint_16 out = (png_uint_16)(i * 257U); /* 16 bit output value */
|
||||
png_uint_16 out = (png_uint_16)(i * 257U); /* 16-bit output value */
|
||||
|
||||
/* Find the boundary value in 16 bits: */
|
||||
png_uint_32 bound = png_gamma_16bit_correct(out+128U, gamma_val);
|
||||
@@ -2287,7 +2287,7 @@ png_build_16to8_table(png_structp png_ptr, png_uint_16pp *ptable,
|
||||
}
|
||||
}
|
||||
|
||||
/* Build a single 8 bit table: same as the 16 bit case but much simpler (and
|
||||
/* Build a single 8-bit table: same as the 16-bit case but much simpler (and
|
||||
* typically much faster). Note that libpng currently does no sBIT processing
|
||||
* (apparently contrary to the spec) so a 256 entry table is always generated.
|
||||
*/
|
||||
@@ -2352,7 +2352,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
|
||||
else
|
||||
sig_bit = png_ptr->sig_bit.gray;
|
||||
|
||||
/* 16 bit gamma code uses this equation:
|
||||
/* 16-bit gamma code uses this equation:
|
||||
*
|
||||
* ov = table[(iv & 0xff) >> gamma_shift][iv >> 8]
|
||||
*
|
||||
@@ -2367,7 +2367,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
|
||||
*
|
||||
* So the table 'n' corresponds to all those 'iv' of:
|
||||
*
|
||||
* <all high 8 bit values><n << gamma_shift>..<(n+1 << gamma_shift)-1>
|
||||
* <all high 8-bit values><n << gamma_shift>..<(n+1 << gamma_shift)-1>
|
||||
*
|
||||
*/
|
||||
if (sig_bit > 0 && sig_bit < 16U)
|
||||
@@ -2394,7 +2394,7 @@ png_build_gamma_table(png_structp png_ptr, int bit_depth)
|
||||
#ifdef PNG_16BIT_SUPPORTED
|
||||
/* NOTE: prior to 1.5.3 this test used to include PNG_BACKGROUND (now
|
||||
* PNG_COMPOSE). This effectively smashed the background calculation for
|
||||
* 16 bit output because the 8 bit table assumes the result will be reduced
|
||||
* 16-bit output because the 8-bit table assumes the result will be reduced
|
||||
* to 8 bits.
|
||||
*/
|
||||
if (png_ptr->transformations & PNG_16_TO_8)
|
||||
|
||||
20
png.h
20
png.h
@@ -1,7 +1,7 @@
|
||||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.5.3beta08 - May 16, 2011
|
||||
* libpng version 1.5.3beta10 - May 20, 2011
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
@@ -11,7 +11,7 @@
|
||||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.5.3beta08 - May 16, 2011: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.5.3beta10 - May 20, 2011: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
@@ -150,7 +150,7 @@
|
||||
* 1.5.2beta01-03 15 10502 15.so.15.2[.0]
|
||||
* 1.5.2rc01-03 15 10502 15.so.15.2[.0]
|
||||
* 1.5.2 15 10502 15.so.15.2[.0]
|
||||
* 1.5.3beta01-08 15 10503 15.so.15.3[.0]
|
||||
* 1.5.3beta01-10 15 10503 15.so.15.3[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
@@ -182,7 +182,7 @@
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.5.3beta08, May 16, 2011, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.5.3beta10, May 20, 2011, are
|
||||
* Copyright (c) 2004, 2006-2011 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:
|
||||
@@ -294,13 +294,13 @@
|
||||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* May 16, 2011
|
||||
* May 20, 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.3beta08 are Y2K compliant. It is my belief that
|
||||
* upward through 1.5.3beta10 are Y2K compliant. It is my belief that
|
||||
* earlier versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
@@ -355,9 +355,9 @@
|
||||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.5.3beta08"
|
||||
#define PNG_LIBPNG_VER_STRING "1.5.3beta10"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.5.3beta08 - May 16, 2011\n"
|
||||
" libpng version 1.5.3beta10 - May 20, 2011\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 15
|
||||
#define PNG_LIBPNG_VER_DLLNUM 15
|
||||
@@ -370,7 +370,7 @@
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
*/
|
||||
|
||||
#define PNG_LIBPNG_VER_BUILD 08
|
||||
#define PNG_LIBPNG_VER_BUILD 10
|
||||
|
||||
/* Release Status */
|
||||
#define PNG_LIBPNG_BUILD_ALPHA 1
|
||||
@@ -517,7 +517,7 @@ extern "C" {
|
||||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_5_3beta08;
|
||||
typedef char* png_libpng_version_1_5_3beta10;
|
||||
|
||||
/* Three color definitions. The order of the red, green, and blue, (and the
|
||||
* exact size) is not important, although the size of the fields need to
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.5.3beta08 - May 16, 2011
|
||||
* libpng version 1.5.3beta10 - May 20, 2011
|
||||
*
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
||||
@@ -89,9 +89,10 @@ png_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN)
|
||||
PNG_FUNCTION(void,PNGAPI
|
||||
png_err,(png_structp png_ptr),PNG_NORETURN)
|
||||
{
|
||||
/* Prior to 1.5.2 the error_fn received a NULL pointer, expressed erroneouly
|
||||
* as '\0'. This was apparently an error, and png_default_error will crash
|
||||
* in this case.
|
||||
/* Prior to 1.5.2 the error_fn received a NULL pointer, expressed
|
||||
* erroneously as '\0', instead of the empty string "". This was
|
||||
* apparently an error, introduced in libpng-1.2.20, and png_default_error
|
||||
* will crash in this case.
|
||||
*/
|
||||
if (png_ptr != NULL && png_ptr->error_fn != NULL)
|
||||
(*(png_ptr->error_fn))(png_ptr, "");
|
||||
|
||||
@@ -1287,7 +1287,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
/* -------------- image transformations start here ------------------- */
|
||||
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
/* Tell libpng to strip 16 bit/color files down to 8 bits per color.
|
||||
/* Tell libpng to strip 16-bit/color files down to 8 bits per color.
|
||||
*/
|
||||
if (transforms & PNG_TRANSFORM_STRIP_16)
|
||||
png_set_strip_16(png_ptr);
|
||||
@@ -1368,7 +1368,7 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_SWAP_SUPPORTED
|
||||
/* Swap bytes of 16 bit files to least significant byte first */
|
||||
/* Swap bytes of 16-bit files to least significant byte first */
|
||||
if (transforms & PNG_TRANSFORM_SWAP_ENDIAN)
|
||||
png_set_swap(png_ptr);
|
||||
#endif
|
||||
|
||||
70
pngrtran.c
70
pngrtran.c
@@ -133,7 +133,7 @@ png_set_background(png_structp png_ptr,
|
||||
#endif /* READ_BACKGROUND */
|
||||
|
||||
#ifdef PNG_READ_16_TO_8_SUPPORTED
|
||||
/* Strip 16 bit depth files to 8 bit depth */
|
||||
/* Strip 16-bit depth files to 8-bit depth */
|
||||
void PNGAPI
|
||||
png_set_strip_16(png_structp png_ptr)
|
||||
{
|
||||
@@ -342,7 +342,7 @@ png_set_alpha_mode(png_structp png_ptr, int mode, double output_gamma)
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_QUANTIZE_SUPPORTED
|
||||
/* Dither file to 8 bit. Supply a palette, the current number
|
||||
/* Dither file to 8-bit. Supply a palette, the current number
|
||||
* of elements in the palette, the maximum number of elements
|
||||
* allowed, and a histogram if possible. If the current number
|
||||
* of colors is greater then the maximum number, the palette will be
|
||||
@@ -872,7 +872,7 @@ png_set_tRNS_to_alpha(png_structp png_ptr)
|
||||
#endif /* defined(PNG_READ_EXPAND_SUPPORTED) */
|
||||
|
||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||
/* Expand to 16 bit channels, expand the tRNS chunk too (because otherwise
|
||||
/* Expand to 16-bit channels, expand the tRNS chunk too (because otherwise
|
||||
* it may not work correctly.)
|
||||
*/
|
||||
void PNGAPI
|
||||
@@ -1106,10 +1106,6 @@ png_init_palette_transformations(png_structp png_ptr)
|
||||
(png_ptr->transformations & PNG_EXPAND))
|
||||
{
|
||||
{
|
||||
/* TODO: THIS MUST BE WRONG, because in png_init_read_transformations
|
||||
* below the background red,green,blue values are used directly in the
|
||||
* palette case (allowing an out-of-palette background color!)
|
||||
*/
|
||||
png_ptr->background.red =
|
||||
png_ptr->palette[png_ptr->background.index].red;
|
||||
png_ptr->background.green =
|
||||
@@ -1318,7 +1314,7 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
* 8) PNG_ENCODE_ALPHA
|
||||
* 9) PNG_16_TO_8 (strip16)
|
||||
* 10) PNG_QUANTIZE (converts to palette)
|
||||
* 11) PNG_EXPAND_16 [NOTE: temporarily moved to (3) for accuracy!]
|
||||
* 11) PNG_EXPAND_16
|
||||
* 12) PNG_GRAY_TO_RGB iff PNG_BACKGROUND_IS_GRAY
|
||||
* 13) PNG_INVERT_MONO
|
||||
* 14) PNG_SHIFT
|
||||
@@ -1429,6 +1425,29 @@ png_init_read_transformations(png_structp png_ptr)
|
||||
else
|
||||
png_init_rgb_transformations(png_ptr);
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) && \
|
||||
defined(PNG_READ_EXPAND_16_SUPPORTED)
|
||||
if ((png_ptr->transformations & PNG_EXPAND_16) &&
|
||||
(png_ptr->transformations & PNG_COMPOSE) &&
|
||||
!(png_ptr->transformations & PNG_BACKGROUND_EXPAND) &&
|
||||
png_ptr->bit_depth != 16)
|
||||
{
|
||||
/* TODO: fix this. Because the expand_16 operation is after the compose
|
||||
* handling the background color must be 8, not 16, bits deep, but the
|
||||
* application will supply a 16-bit value so reduce it here.
|
||||
*
|
||||
* The PNG_BACKGROUND_EXPAND code above does not expand to 16 bits at
|
||||
* present, so that case is ok (until do_expand_16 is moved.)
|
||||
*/
|
||||
# define CHOP(x) ((png_uint_16)((2*(png_uint_32)(x) + 257)/514))
|
||||
png_ptr->background.red = CHOP(png_ptr->background.red);
|
||||
png_ptr->background.green = CHOP(png_ptr->background.green);
|
||||
png_ptr->background.blue = CHOP(png_ptr->background.blue);
|
||||
png_ptr->background.gray = CHOP(png_ptr->background.gray);
|
||||
# undef CHOP
|
||||
}
|
||||
#endif
|
||||
|
||||
/* NOTE: below 'PNG_READ_ALPHA_MODE_SUPPORTED' is presumed to also enable the
|
||||
* background support (see the comments in scripts/pnglibconf.dfa), this
|
||||
* allows pre-multiplication of the alpha channel to be implemented as
|
||||
@@ -1808,14 +1827,6 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_EXPAND_16 && info_ptr->bit_depth == 8 &&
|
||||
info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
info_ptr->bit_depth = 16;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PNG_READ_BACKGROUND_SUPPORTED) ||\
|
||||
defined(PNG_READ_ALPHA_MODE_SUPPORTED)
|
||||
/* The following is almost certainly wrong unless the background value is in
|
||||
@@ -1870,6 +1881,14 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||
if (png_ptr->transformations & PNG_EXPAND_16 && info_ptr->bit_depth == 8 &&
|
||||
info_ptr->color_type != PNG_COLOR_TYPE_PALETTE)
|
||||
{
|
||||
info_ptr->bit_depth = 16;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_PACK_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_PACK) && (info_ptr->bit_depth < 8))
|
||||
info_ptr->bit_depth = 8;
|
||||
@@ -1995,19 +2014,6 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* TODO: Delay the 'expand 16' step until later for efficiency, so that the
|
||||
* intermediate steps work with 8 bit data.
|
||||
*/
|
||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||
/* Do the expansion now, after all the arithmetic has been done. Notice
|
||||
* that previous transformations can handle the PNG_EXPAND_16 flag if this
|
||||
* is efficient (particularly true in the case of gamma correction, where
|
||||
* better accuracy results faster!)
|
||||
*/
|
||||
if (png_ptr->transformations & PNG_EXPAND_16)
|
||||
png_do_expand_16(&png_ptr->row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
|
||||
#ifdef PNG_READ_STRIP_ALPHA_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_STRIP_ALPHA) &&
|
||||
!(png_ptr->transformations & PNG_COMPOSE) &&
|
||||
@@ -2127,11 +2133,6 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
}
|
||||
#endif /* PNG_READ_QUANTIZE_SUPPORTED */
|
||||
|
||||
#if 0
|
||||
/* This is where this code *should* be for efficiency, but that requires all
|
||||
* the inaccurate calculations above to output 16 bit values if expand_16 is
|
||||
* set!
|
||||
*/
|
||||
#ifdef PNG_READ_EXPAND_16_SUPPORTED
|
||||
/* Do the expansion now, after all the arithmetic has been done. Notice
|
||||
* that previous transformations can handle the PNG_EXPAND_16 flag if this
|
||||
@@ -2141,7 +2142,6 @@ png_do_read_transformations(png_structp png_ptr)
|
||||
if (png_ptr->transformations & PNG_EXPAND_16)
|
||||
png_do_expand_16(&png_ptr->row_info, png_ptr->row_buf + 1);
|
||||
#endif
|
||||
#endif /*commented out*/
|
||||
|
||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
||||
/*NOTE: moved here in 1.5.3 (from much later in this list.) */
|
||||
|
||||
@@ -1794,4 +1794,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_3beta08 Your_png_h_is_not_version_1_5_3beta08;
|
||||
typedef png_libpng_version_1_5_3beta10 Your_png_h_is_not_version_1_5_3beta10;
|
||||
|
||||
752
pngvalid.c
752
pngvalid.c
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
|
||||
VisualStudio instructions
|
||||
|
||||
libpng version 1.5.3beta08 - May 16, 2011
|
||||
libpng version 1.5.3beta10 - May 20, 2011
|
||||
|
||||
Copyright (c) 1998-2010 Glenn Randers-Pehrson
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* zlib.props - location of zlib source
|
||||
*
|
||||
* libpng version 1.5.3beta08 - May 16, 2011
|
||||
* libpng version 1.5.3beta10 - May 20, 2011
|
||||
*
|
||||
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||
*
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
Makefiles for libpng version 1.5.3beta08 - May 16, 2011
|
||||
Makefiles for libpng version 1.5.3beta10 - May 20, 2011
|
||||
|
||||
pnglibconf.h.prebuilt => Stores configuration settings
|
||||
makefile.linux => Linux/ELF makefile
|
||||
(gcc, creates libpng15.so.15.1.5.3beta08)
|
||||
(gcc, creates libpng15.so.15.1.5.3beta10)
|
||||
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.3beta08)
|
||||
(gcc, creates libpng15.so.15.1.5.3beta10)
|
||||
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.3beta08)
|
||||
creates libpng15.so.15.1.5.3beta10)
|
||||
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
|
||||
makefile.solaris => Solaris 2.X makefile (gcc,
|
||||
creates libpng15.so.15.1.5.3beta08)
|
||||
creates libpng15.so.15.1.5.3beta10)
|
||||
makefile.so9 => Solaris 9 makefile (gcc,
|
||||
creates libpng15.so.15.1.5.3beta08)
|
||||
creates libpng15.so.15.1.5.3beta10)
|
||||
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
|
||||
makefile.sunos => Sun makefile
|
||||
makefile.32sunu => Sun Ultra 32-bit makefile
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
# Modeled after libxml-config.
|
||||
|
||||
version=1.5.3beta08
|
||||
version=1.5.3beta10
|
||||
prefix=""
|
||||
libdir=""
|
||||
libs=""
|
||||
|
||||
@@ -5,6 +5,6 @@ includedir=@includedir@/libpng15
|
||||
|
||||
Name: libpng
|
||||
Description: Loads and saves PNG files
|
||||
Version: 1.5.3beta08
|
||||
Version: 1.5.3beta10
|
||||
Libs: -L${libdir} -lpng15
|
||||
Cflags: -I${includedir}
|
||||
|
||||
@@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng15
|
||||
|
||||
LIB= png15
|
||||
SHLIB_MAJOR= 0
|
||||
SHLIB_MINOR= 1.5.3beta08
|
||||
SHLIB_MINOR= 1.5.3beta10
|
||||
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= 15
|
||||
SHLIB_MINOR= 1.5.3beta08
|
||||
SHLIB_MINOR= 1.5.3beta10
|
||||
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= 15
|
||||
SHLIB_MINOR= 1.5.3beta08
|
||||
SHLIB_MINOR= 1.5.3beta10
|
||||
|
||||
LIB= png
|
||||
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
LIBRARY
|
||||
|
||||
EXPORTS
|
||||
;Version 1.5.3beta08
|
||||
;Version 1.5.3beta10
|
||||
png_access_version_number @1
|
||||
png_set_sig_bytes @2
|
||||
png_sig_cmp @3
|
||||
|
||||
@@ -7,18 +7,9 @@ echo >> pngtest-log.txt
|
||||
echo "============ pngvalid-full.sh ==============" >> pngtest-log.txt
|
||||
|
||||
echo "Running test-pngvalid-full.sh"
|
||||
for gamma in threshold transform sbit 16-to-8 background alpha-mode
|
||||
for gamma in threshold transform sbit 16-to-8 background alpha-mode "transform --expand16" "background --expand16" "alpha-mode --expand16"
|
||||
do
|
||||
# For the moment the composition calculation is performed with minimal
|
||||
# accuracy, do this to work round the problem:
|
||||
if test $gamma = background -o $gamma = alpha-mode
|
||||
then
|
||||
opts=--use-linear-precision
|
||||
else
|
||||
opts=
|
||||
fi
|
||||
|
||||
if ./pngvalid $opts "--gamma-$gamma" >> pngtest-log.txt 2>&1
|
||||
if ./pngvalid --gamma-$gamma >> pngtest-log.txt 2>&1
|
||||
then
|
||||
echo " PASS:" pngvalid "--gamma-$gamma"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user