2440 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
8c94b1295f Merge branch 'libpng17' of https://github.com/jbowler/libpng-1 into libpng17 2015-09-25 18:43:07 -05:00
Glenn Randers-Pehrson
1932e16c21 [libpng17] Restored license output to pngstest.c 2015-09-25 18:37:44 -05:00
John Bowler
a6278e7c87 Merge remote-tracking branch 'glennrp/libpng17' into libpng17 2015-09-25 16:25:11 -07:00
John Bowler
a5b993aaed Enable low-bit-depth gray tests in pngvalid 2015-09-25 16:22:59 -07:00
John Bowler
53e537439f Fix png_set_tRNS_to_alpha for low-bit-depth gray
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 16:22:17 -07:00
Glenn Randers-Pehrson
f1eec0ba62 [libng17] Updated CHANGES and ANNOUNCE, restored license info in
pngtest-errors.h
2015-09-25 17:40:48 -05:00
John Bowler
1e563f689c New test PNG files incorporated into make check
tests/pngstest-* are changed so that the new test files are divided into 8
groups by gamma and alpha channel.  This makes each test take just under 5
seconds on a moderately up-to-date x86_64 system using libpng16 (test times are
somewhat variable under libpng17 at present because of the lack of optimization
in some gamma processing paths.)

These tests have considerably better code and pixel-value coverage than
contrib/pngsuite however coverage is still incomplete.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 12:21:10 -07:00
John Bowler
0301cc2627 Update pngstest-errors.h for new make check tests
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-25 12:20:36 -07:00
Glenn Randers-Pehrson
9ee0b63b09 [libpng17] Updated CHANGES and ANNOUNCE 2015-09-24 23:09:12 -05:00
John Bowler
2c13de800f Merge remote-tracking branch 'glennrp/libpng17' into libpng17
Changes from Glenn for legal reasons
2015-09-24 17:44:05 -07:00
John Bowler
d394d889e1 png_rgb_to_gray optimization fixes
This fixes the code that optimizes RGB to Gray transformations that only
selected on channel and clarifies the handling of max_depth in the transform
code.  It eliminates some UNTESTED cases and removes the write 'invert alpha'
UNTESTED macro because, while there are no test cases for it, code review
some months after writing it suggests it is ok.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-24 17:33:32 -07:00
Glenn Randers-Pehrson
40d90d34a8 [libpng17] Add copyright and license to contrib/testpngs/makepngs.sh 2015-09-22 16:04:26 -05:00
John Bowler
3f6efbd8e2 Squashed commit of the following:
commit bf51c644f7d29400d884e20def9a0bee74904308
Author: John Bowler <jbowler@acm.org>
Date:   Tue Sep 22 09:05:13 2015 -0700

    Updated contrib/testpngs/*.png

    Corrected copyright/licensing information, corrected filtering.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 05399c8c82d7b188357dc6fa05a8cdd89426b155
Author: John Bowler <jbowler@acm.org>
Date:   Tue Sep 22 09:04:03 2015 -0700

    makepng.c: correct the first row filter setting

    It needs to include the "UP" filter so that libpng knows to retain the first
    line for the UP filter on the next one.  Without this libpng ended up using NONE
    for the second line.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 8fae6609c063c7e0a5eeb592f8eec15849617ae9
Author: John Bowler <jbowler@acm.org>
Date:   Mon Sep 21 17:15:45 2015 -0700

    makepng: spelling corrections, single test output

    Corrections to some obvious mistakes, plus one output file.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit a2245a2c54a679d25f8f1609f85654d155936863
Author: John Bowler <jbowler@acm.org>
Date:   Mon Sep 21 13:39:48 2015 -0700

    Updated testpngs files with new Licensing tag

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 46d3f863cace5b7aa769c9b882fca49e2a821138
Author: John Bowler <jbowler@acm.org>
Date:   Mon Sep 21 13:38:34 2015 -0700

    Updated makepng.c

    This supports more test cases and a reduced licence keyword (now licensing).
    The extra text cases require more slack in pngstest.c

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 7c9a08b8bc5e2542184d4abb25c33c516bc0adc7
Author: John Bowler <jbowler@acm.org>
Date:   Sun Sep 20 20:55:19 2015 -0700

    Test PNG files

    These files were generated by contrib/testpngs/makepngs.sh --small with MAKEPNG
    set to the makepng compiled from the current contrib/libtests/makepngs.sh

    Signed-off-by: John Bowler <jbowler@acm.org>

commit c2a8a01b2ac733b8029478d10f700f5ab8a713f2
Author: John Bowler <jbowler@acm.org>
Date:   Sun Sep 20 20:51:06 2015 -0700

    makepng --small

    This patch adds code to 'makepng' to allow the generation of smaller images that
    also give better test case coverage.  It also adds 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 one,
    appropriate to a non-source-code work.

    The resultant image were used to generate the updated pngstest-errors.h file in
    a prior commit.

    Signed-off-by: John Bowler <jbowler@acm.org>

commit 8c025bcf3fdfb68fb8b1e5fab4b7deb0f94453f6
Author: John Bowler <jbowler@acm.org>
Date:   Sun Sep 20 20:40:52 2015 -0700

    Simplified API sRGB gamma handling correction

    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 the patch also includes a new
    pngstest-errors which allows the result, however this is still a
    work-in-progress; a better solution is possible.

    Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-22 13:46:19 -05:00
John Bowler
bf51c644f7 Updated contrib/testpngs/*.png
Corrected copyright/licensing information, corrected filtering.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-22 09:05:13 -07:00
John Bowler
05399c8c82 makepng.c: correct the first row filter setting
It needs to include the "UP" filter so that libpng knows to retain the first
line for the UP filter on the next one.  Without this libpng ended up using NONE
for the second line.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-22 09:04:03 -07:00
John Bowler
8fae6609c0 makepng: spelling corrections, single test output
Corrections to some obvious mistakes, plus one output file.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-21 17:15:45 -07:00
John Bowler
a2245a2c54 Updated testpngs files with new Licensing tag
Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-21 13:39:48 -07:00
John Bowler
46d3f863ca Updated makepng.c
This supports more test cases and a reduced licence keyword (now licensing).
The extra text cases require more slack in pngstest.c

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-21 13:38:34 -07:00
John Bowler
7c9a08b8bc Test PNG files
These files were generated by contrib/testpngs/makepngs.sh --small with MAKEPNG
set to the makepng compiled from the current contrib/libtests/makepngs.sh

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-20 20:55:19 -07:00
John Bowler
c2a8a01b2a makepng --small
This patch adds code to 'makepng' to allow the generation of smaller images that
also give better test case coverage.  It also adds 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 one,
appropriate to a non-source-code work.

The resultant image were used to generate the updated pngstest-errors.h file in
a prior commit.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-20 20:51:06 -07:00
John Bowler
8c025bcf3f Simplified API sRGB gamma handling correction
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 the patch also includes a new
pngstest-errors which allows the result, however this is still a
work-in-progress; a better solution is possible.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-20 20:40:52 -07:00
Glenn Randers-Pehrson
d555056b24 [libng17] Suppressed bogus Coverity issues in pngrutil.c and pngwutil.c. 2015-09-19 22:47:59 -05:00
Glenn Randers-Pehrson
69f2152c0f [libpng17] Added license info to pngstest-errors.h and its generator. 2015-09-19 20:18:49 -05:00
Glenn Randers-Pehrson
e6a3e2456c [libpng17] Update CHANGES and ANNOUNCE with changes from pull request #20 2015-09-19 19:45:24 -05:00
John Bowler
493bfd14a2 gamma handling fixes
One serious bug; 8 was forced as a bit depth when caching a palette, even though
the palette have been expanded.  One less serious bug, the optimization for
avoiding gamma correction introduced significant errors if the app subsequently
did further corrections, only shown by using gAMA 1/1.52 files in pngstest.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-19 16:36:22 -07:00
John Bowler
8a9a3fb4dd pngstest: make error limits version specific
Splitting the machine generated error structs out to a file allows the values to
be updated without changing pngstest.c itself, sine libpng 1.6 and 1.7 have
slightly different error limits this simplifies maintenance.

makepngs.sh has also been updated to more accurately reflect current problems in
libpng 1.7

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-19 16:21:36 -07:00
John Bowler
3e46c31961 Coverity bug fix: dead code
Also fix the previous fix attempt; the intent was to limit the calls to crc32 to
ZLIB_IO_MAX, although it is not clear that this is optimal.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-19 16:19:18 -07:00
Glenn Randers-Pehrson
714515bc0c [libpng17] Improved description of filler-byte bug fix in CHANGES and ANNOUNCE. 2015-09-18 23:39:51 -05:00
John Bowler
38647d4b21 [libpng17] Fixed makepng.c so that it compiles with GCC 5.1.0.
Added contrib/testspngs/: a directory for additional test png files
2015-09-18 16:36:57 -05:00
John Bowler
f8d3e854cb Coverity related changes
These should fix most of the reported Coverity issues.  The remaining issues
should be the back_b etc assignments, which look like a Coverity bug, and
passing a pointer to a byte to a function that expects a pointer to one or more
bytes, which should (I believe) be fixed in one case and not the other
(next_filter) case; the latter case will probably go away as I am going to
rewrite that piece of code to avoid a spurious buffer allocation.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-17 22:04:30 -05:00
Glenn Randers-Pehrson
d280c3a6da [libpng17] Updated CHANGES and ANNOUNCE 2015-09-17 07:34:38 -05:00
John Bowler
62dff2f97e Merge branch 'libpng17' of /home/jbowler/src/libpng/libpng into libpng17 2015-09-16 21:42:04 -07:00
John Bowler
fea86b1c29 Remove memcpy of png_transform_background
Replaced by a structure copy which is safer since it doesn't depend on knowing
the first member to be copied, also the copies are improved to copy the
transform args too; not required at present but it may prevent a bug being
introduced in the future.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-16 21:33:43 -07:00
John Bowler
601ae5387e [libpng17] correct low-depth-gray code and enable tests
The low-bit-depth gray tests were disabled in prior versions of libpng because
of problems which should have been fixed by the recent changes to libpng17,
enabling the tests reveals bugs in those changes which are fixed by this commit.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-16 21:09:10 -07:00
Glenn Randers-Pehrson
36ada4acae [libpng17] Add pngchunk.h to contrib/pngminim makefiles. 2015-09-16 11:09:25 -05:00
Glenn Randers-Pehrson
bfc7affa0d [libpng17] Imported from libpng-1.7.0beta65.tar v1.7.0beta65 2015-09-16 10:19:29 -05:00
Glenn Randers-Pehrson
dba870122c [libpng17] Updated makefiles to handle pngchunk.h 2015-09-16 08:34:56 -05:00
Glenn Randers-Pehrson
35abfe72d6 [libpng17] Fix debug statement in pngread.c 2015-09-15 23:54:55 -05:00
Glenn Randers-Pehrson
497ff3400c [libpng17] moved scripts/chunkdesc.h to pngchunk.h 2015-09-15 23:53:49 -05:00
Glenn Randers-Pehrson
bb4e79c947 [libpng17] Updated configure.ac was omitted from previous commit 2015-09-15 19:53:08 -05:00
Glenn Randers-Pehrson
b00bb570f8 [libpng17] Fix file permission for contrib/tools/intgamma.sh 2015-09-15 18:35:26 -05:00
Glenn Randers-Pehrson
c68de14844 [libpng17] Merge contrib/libtests and contrib/tools with libpng16. 2015-09-15 17:11:43 -05:00
Glenn Randers-Pehrson
cc7fa5e23f [libpng17] Added public domain declaration to contrib/libtests/fakepng.c 2015-09-15 15:21:12 -05:00
John Bowler
ec99b373dd Merge 3184947a25b78dee14b0dda09f368ab3f6107c8f into 1fc5345bff82118fd6f3138138805083e66656ca 2015-09-15 03:52:31 +00:00
John Bowler
3184947a25 chunk handling and transform rewrite
This implements a new chunk parse implementation that can be shared, it
is currently shared by the progressive reader and the sequential one
(not, yet, the writer).

The patch also implements shared transform handling that is used
throughout.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 20:42:40 -07:00
John Bowler
c5ead5d2cd Test changes
Most of these are back-portable to earlier versions (contrib/libtests
should just work with earlier versions), however the 1.7 specific
changes in pngvalid mean that it probably won't work against 1.7 without
the commits following this one.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 17:57:40 -07:00
John Bowler
76c5c11168 Test corrections: minor fixes to the test scripts
pngimage: add --list-combos
pngunknown: add --strict to catch warnings
pngvalid-standard: remove the spurious --progressive read (compare with
pngvalid-progressive-standard!)
This patch probably applies to 1.5 and 1.6 (where the tests exist) too.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 17:51:06 -07:00
John Bowler
ddcca52933 ARM NEON code moved to contrib
This patch contains changes to the build (configure) system and the code
required to support the move.  The patch is provided to isolate the
changes from the others that follow it; the code won't necessarily
compile after this patch (the next changes are required.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 17:31:51 -07:00
John Bowler
3bd90db79f Rename arm -> contrib/neon
libpng will not compile if ARM NEON support is enabled with this commit;
the commit is provided to isolate the rename of the directory from the
rest of the required changes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-09-14 17:18:50 -07:00
Glenn Randers-Pehrson
1fc5345bff [libpng17] Mention dropping support for 16-bit platforms in libpng16.
Update some comments, fix example.c usage of png_set_sig_bytes().
2015-08-18 10:45:16 -05:00