Merge remote-tracking branch 'glennrp/libpng17' into libpng17

Changes from Glenn for legal reasons
This commit is contained in:
John Bowler 2015-09-24 17:44:05 -07:00
commit 2c13de800f
6 changed files with 71 additions and 11 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.7.0beta66 - September 20, 2015
Libpng 1.7.0beta66 - September 22, 2015
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.
@ -871,7 +871,7 @@ Version 1.7.0beta65 [September 16, 2015]
(but not yet by the writer) (John Bowler).
Implemented shared transform handling that is used throughout (John Bowler).
Version 1.7.0beta66 [September 20, 2015]
Version 1.7.0beta66 [September 22, 2015]
Enabled the low-bit-depth gray tests that were disabled in prior versions
of libpng because of problems that should have been fixed by the recent
changes to libpng17. Enabling the tests revealed bugs in those changes
@ -901,6 +901,34 @@ Version 1.7.0beta66 [September 20, 2015]
did further corrections, only shown by using files with gAMA 1/1.52 in
pngstest (John Bowler).
Suppressed bogus Coverity issues in pngrutil.c and pngwutil.c.
Corrected sRGB gamma handling in the Simplified API (John Bowler).
If a gamma encoded file that has a gamma not matching that of sRGB is
passed to the simplified API the previous code simply interpreted it as
a power law encoding. However old Mac files had a power law correction
of 1.45 built in to the encoding, even though the display devices were
consistent with sRGB. Assuming a power law encoding results in
substantial differences in the interpretation of low 8-bit values;
below 10. For example an Apple '5' which is equivalent to an sRGB '17'
ends up as the value '8'. This patch provides some measure of correction
for this by making the gamma correction done within the simplified API
assume that any encoded data is encoded relative to an sRGB-like transfer
function; the data is corrected back to the PNG-nominal 2.2 value then
decoded to linear (if required) using the sRGB transfer function.
This reduces the errors reported by pngstest for such files (colormapped
ones) but still leaves the issue with files where the standard libpng
code does the gamma decoding. To cope with the latter cases there is a
new pngstest-errors which allows the result; however, this is still a
work-in-progress; a better solution is possible.
Added a '--small' option to 'makepng' to allow the generation of smaller
images that also give better test case coverage. Also added copyright
and licence to the generated images, reflecting the fact that they are
original works of the author of the code. The licence used is the
Creative Commons Public Domain (CC0-1.0) one, which is appropriate
for non-source-code works. The resultant images were used to generate
the recently-updated pngstest-errors.h file.
Added test files generated by "contrib/testpngs/makepngs.sh --small"
with MAKEPNG set to the makepng compiled from the current
contrib/libtests/makepngs.sh, to the "contrib/testpngs" directory.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

30
CHANGES
View File

@ -5170,7 +5170,7 @@ Version 1.7.0beta65 [September 16, 2015]
(but not yet by the writer) (John Bowler).
Implemented shared transform handling that is used throughout (John Bowler).
Version 1.7.0beta66 [September 20, 2015]
Version 1.7.0beta66 [September 22, 2015]
Enabled the low-bit-depth gray tests that were disabled in prior versions
of libpng because of problems that should have been fixed by the recent
changes to libpng17. Enabling the tests revealed bugs in those changes
@ -5200,6 +5200,34 @@ Version 1.7.0beta66 [September 20, 2015]
did further corrections, only shown by using files with gAMA 1/1.52 in
pngstest (John Bowler).
Suppressed bogus Coverity issues in pngrutil.c and pngwutil.c.
Corrected sRGB gamma handling in the Simplified API (John Bowler).
If a gamma encoded file that has a gamma not matching that of sRGB is
passed to the simplified API the previous code simply interpreted it as
a power law encoding. However old Mac files had a power law correction
of 1.45 built in to the encoding, even though the display devices were
consistent with sRGB. Assuming a power law encoding results in
substantial differences in the interpretation of low 8-bit values;
below 10. For example an Apple '5' which is equivalent to an sRGB '17'
ends up as the value '8'. This patch provides some measure of correction
for this by making the gamma correction done within the simplified API
assume that any encoded data is encoded relative to an sRGB-like transfer
function; the data is corrected back to the PNG-nominal 2.2 value then
decoded to linear (if required) using the sRGB transfer function.
This reduces the errors reported by pngstest for such files (colormapped
ones) but still leaves the issue with files where the standard libpng
code does the gamma decoding. To cope with the latter cases there is a
new pngstest-errors which allows the result; however, this is still a
work-in-progress; a better solution is possible.
Added a '--small' option to 'makepng' to allow the generation of smaller
images that also give better test case coverage. Also added copyright
and licence to the generated images, reflecting the fact that they are
original works of the author of the code. The licence used is the
Creative Commons Public Domain (CC0-1.0) one, which is appropriate
for non-source-code works. The resultant images were used to generate
the recently-updated pngstest-errors.h file.
Added test files generated by "contrib/testpngs/makepngs.sh --small"
with MAKEPNG set to the makepng compiled from the current
contrib/libtests/makepngs.sh, to the "contrib/testpngs" directory.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit

View File

@ -3,7 +3,7 @@
/* Copyright: */
#define COPYRIGHT "\251 2013,2015 John Cunningham Bowler"
/*
* Last changed in libpng 1.7.0 [September 20, 2015]
* Last changed in libpng 1.7.0 [(PENDING RELEASE)]
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer

View File

@ -3577,10 +3577,6 @@ main(int argc, char **argv)
printf(" *\n");
printf(" * BUILT USING:" PNG_HEADER_VERSION_STRING);
printf(" *\n");
printf(" * This code is released under the libpng license.\n");
printf(" * For conditions of distribution and use, see the disclaimer\n");
printf(" * and license in png.h\n");
printf(" *\n");
printf(" * THIS IS A MACHINE GENERATED FILE: do not edit it directly!\n");
printf(" * Instead run:\n");
printf(" *\n");

View File

@ -1,7 +1,7 @@
/* pngvalid.c - validate libpng by constructing then reading png files.
*
* Last changed in libpng 1.6.18 [(PENDING RELEASE)]
* Last changed in libpng 1.5.24 [(PENDING RELEASE)]
* Copyright (c) 2014-2015 Glenn Randers-Pehrson
* Written by John Cunningham Bowler
*
@ -3578,7 +3578,7 @@ check_interlace_type(int const interlace_type)
#define CAN_WRITE_INTERLACE\
PNG_LIBPNG_VER >= 10700 || defined PNG_WRITE_INTERLACING_SUPPORTED
/* Make a standardized image given a an image colour type, bit depth and
/* Make a standardized image given an image colour type, bit depth and
* interlace type. The standard images have a very restricted range of
* rows and heights and are used for testing transforms rather than image
* layout details. See make_size_images below for a way to make images

View File

@ -2,7 +2,15 @@
#
# Make a set of test PNG files, MAKEPNG is the name of the makepng executable
# built from contrib/libtests/makepng.c
#
# Copyright (c) 2015 John Cunningham Bowler
# Last changed in libpng 1.7.0 [(PENDING RELEASE)]
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# The arguments say whether to build all the files or whether just to build the
# ones that extend the code-coverage of libpng from the existing test files in
# contrib/pngsuite.