2492 Commits

Author SHA1 Message Date
Glenn Randers-Pehrson
07e2cf117f [libpng17] Fixed handling zero length IDAT in pngfix (bug report by Agostino Sarubbo,
bugfix by John Bowler).
2016-09-01 17:36:36 -05:00
Glenn Randers-Pehrson
f0ada4edee [libpng17] Minor editing of INSTALL, (whitespace, added copyright line) 2016-08-18 18:45:35 -05:00
Glenn Randers-Pehrson
3220f9c5a5 [libpng17] Bump version to 1.7.0beta84 2016-08-07 19:54:00 -05:00
Glenn Randers-Pehrson
5096cac90c [libpng17] Imported from libpng-1.7.0beta83.tar v1.7.0beta83 2016-08-07 19:45:17 -05:00
Glenn Randers-Pehrson
2a2373c1ec [libpng17] Update CHANGES and ANNOUNCE, fix typos in pngrutil.c 2016-07-23 16:41:19 -05:00
John Bowler
4283e2bf66 Fix debug test of output gamma
The test would fire when a gamma transform was eliminated because it was not
significant if other transforms remained.  This is a debug-only change to alter
the test to check for an insignificant mis-match of the actual output gamma from
the requested output gamma.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-23 10:03:48 -07:00
Glenn Randers-Pehrson
8ffea2e56b [libpng17] Update CHANGES and ANNOUNCE 2016-07-16 11:37:48 -05:00
John Bowler
99eb6b5d5d Remove/rearrange png_struct fields
Certain fields are only used in reading.  This attempts to do some minor
cleanup/rearrangement.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-16 08:26:14 -07:00
Glenn Randers-Pehrson
096dbf8335 [libpng17] Fixed more indentation to comply with our coding style. 2016-07-15 14:43:19 -05:00
Glenn Randers-Pehrson
9743d58bc0 [libpng17] Fix one incorrect indent in pngvalid.c 2016-07-13 17:19:58 -05:00
Glenn Randers-Pehrson
bdb730a593 [libng17] Undo bad indentation change in example.c 2016-07-13 16:30:28 -05:00
Glenn Randers-Pehrson
f1fb09c406 [libpng17] Fixed some indentation to comply with our coding style (synced
with libpng-1.6.24beta05).
2016-07-13 15:27:04 -05:00
Glenn Randers-Pehrson
83ca33b017 [libpng17] Minor update of INSTALL 2016-07-04 20:39:41 -05:00
Glenn Randers-Pehrson
aa78bc36d9 [libpng17] Bump version to 1.7.0beta83 2016-07-04 14:30:59 -05:00
Glenn Randers-Pehrson
f7b1d9a172 [libpng17] Imported from libpng-1.7.0beta82.tar v1.7.0beta82 2016-07-04 14:30:52 -05:00
Glenn Randers-Pehrson
ce67b437ea [libpng17] Fixed two Coverity issues in pngcp.c. 2016-07-04 12:30:10 -05:00
Glenn Randers-Pehrson
86a3c4fb14 [libpng17] Don't call png_icc_set_sRGB() when it's not compiled. 2016-07-03 10:26:38 -05:00
Glenn Randers-Pehrson
4b846be113 [libpng17] Relocated misplaced #endif in png.c sRGB profile checking. 2016-07-02 21:33:25 -05:00
Glenn Randers-Pehrson
b9d7d5525b [libpng17] Added "Common linking failures" section to INSTALL 2016-07-02 12:01:27 -05:00
John Bowler
0ecbe53243 pngimage: correct #define checking
In libpng 1.7 pngimage needs to check PNG_WRITE_PNG_SUPPORTED (new in 1.7), not
PNG_WRITE_SUPPORTED because png_write_png can be disabled without disabling
PNG_WRITE_SUPPORTED.  Copied the approach from 1.6 pngcp.c (so this still works
in 1.6 as well.)
2016-07-02 07:37:37 -07:00
Glenn Randers-Pehrson
53bda5a7af [libpng17] Sync contrib/libtests/pngimage.c with libpng16; update CHANGES and ANNOUNCE 2016-07-02 08:53:21 -05:00
John Bowler
6a574a84bd pngcp minimal configuration changes
Corrections for the pngcp minimal configuration in libpng 1.7 and corrections to
the libpng 1.7 code to fix bugs revealed by the reduced configuration.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 22:39:13 -07:00
John Bowler
eaf7abfdc3 pngcp: tool to copy PNG files
This adds pngcp to the build together with a pngcp.dfa configuration test; the
test revealed some configuration bugs which are fixed by corrections to the
_SUPPORTED macros.

pngcp builds on all tested configurations and a number of bugs have been fixed
to make this happen relative to the version in libpng 1.7 contrib/examples.
pngcp.dfa will have to be different for 1.7 but pngcp.c should work fine (not
yet tested).  pngcp itself is still missing a usage message; this is a
preliminary version, although since it behaves the same way as 'cp' most unoids
shouldn't have a problem using it correctly.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:44:08 -07:00
John Bowler
0f5992051f Move pngcp to contrib/tools
Signed-off-by: John Bowler <jbowler@acm.org>
2016-07-01 11:38:03 -07:00
Glenn Randers-Pehrson
12c3c2e136 [libpng17] Sync pngvalid.c with libpng16; update CHANGES and ANNOUNCE 2016-06-24 21:36:29 -05:00
Glenn Randers-Pehrson
d6037dcb09 [libpng17] Update CHANGES and ANNOUNCE 2016-06-23 12:14:15 -05:00
John Bowler
9dfdb2270b SKIP definition in pngstest.c misplaced
The SKIP definition needs to come after the png.h include (see all the other .c
files in contrib/libtests) because it depends on PNG_LIBPNG_VER.  This commit
puts it in the correct place.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-23 09:13:10 -07:00
Glenn Randers-Pehrson
29be8f11ed [libpng17] Bump version to 1.7.0beta82 2016-06-11 18:47:04 -05:00
Glenn Randers-Pehrson
8592a85535 [libpng17] Imported from libpng-1.7.0beta81.tar v1.7.0beta81 2016-06-11 18:46:56 -05:00
John Bowler
b21a37323f [libpng17] Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macro
is not used within libpng, but is used in some of the examples.
2016-06-11 14:21:08 -05:00
John Bowler
7a0fe97841 Change image size checks
This covers the case where PNG_IMAGE_BUFFER_SIZE can overflow in the application
as a result of the application using an increased 'row_stride'; previously
png_image_finish_read only checked for overflow on the base calculation of
components.  (I.e. it checked for overflow of a png_alloc_size_t number on the
total number of pixel components in the output format, not the possibly padded
row length and not the number of bytes, which for linear formats is twice the
number of components.)
2016-06-11 10:12:59 -07:00
Glenn Randers-Pehrson
9a137f332f [libpng17] Update CHANGES and ANNOUNCE 2016-06-08 13:45:37 -05:00
John Bowler
8c8aea7fd4 png_app_warning fix
The implementations of png_app_error and png_app_warning were swapped.  The
non-release behavior of using PNG_ERROR on both doesn't work in practice because
there are some cases where the warnings are very mild (specifically the one
about writing an iCCP chunk when sRGB could be used.)  png_app_warning now does
PNG_WARN by default in all cases.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-08 10:43:25 -07:00
John Bowler
d52c8eba99 Compression changes/fixes
Simplified API: change handling of PNG_IMAGE_FLAG_FAST to use
PNG_COMPRESSION_HIGH_SPEED, and PNG_COMPRESSION_HIGH otherwise.

Compression: add missing break statements that caused some compression settings
to fall through to the 'HIGH' setting.

Internal: remove png_struct::flags, it only stored the 'library mismatch' flag
and that could never be accessed (because immediately after it was set the
png_struct, which was on the stack, was eliminated.)

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-08 08:37:20 -07:00
Glenn Randers-Pehrson
b70b51ba17 [libpng17] Update CHANGES and ANNOUNCE 2016-06-07 14:46:42 -05:00
John Bowler
2b711a751c LOW_MEMORY and COMPAT bug fixes
The LOW_MEMORY PNG_COMPRESSION option should not be setting HUFFMAN_ONLY or
using a low deflate 'level'; according to the comments in zconf.h only
windowBits and memLevel affect the memory.  pngwutil.c has been changed to use
the same values as HIGH compression.

The COMPAT option turned on the old optimize_cmf code (now in fix_cinfo),
however there was a serious bug in that code; it put the wrong value in z_cmf.
The setting was also not handled correctly in pz_compression_settings.

pngtest now verifies the operation of COMPAT and, as a result, pngtest.png has
been reverted to the libpng 1.6 (etc) version.

IDAT size handling has been improved; if not explicitly set values appropriate
to png_level are now chosen (in addition to the handling for the COMPAT
setting).  HIGH and HIGH_READ_SPEED now create unlimited size IDAT chunks, which
requires buffering the whole of the IDAT data in memory but reflects what other
programs and optimizers do.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-07 11:27:23 -07:00
Glenn Randers-Pehrson
2e68f96511 [libpng17] Update link to RFC-2083 in png.5 2016-06-07 11:03:26 -05:00
Glenn Randers-Pehrson
8c7b59f2b9 [libpng17] Update CHANGES and ANNOUNCE, fixed several new typos 2016-06-07 11:02:07 -05:00
John Bowler
01ff090760 API reduction, PNG compression level
PNG compression level setting API: this allows the various compression settings
controlling deflate, fitlering, and so on to be set via a single setting with
six values.  This is currently documented in png.h ("Write compression
settings").

Internally the compression settings have been tuned both for the overall setting
and for any specific settings made by the original APIs.

APIs to control iCCP chunk compression separately have been added.

contrib/examples/pngcp.c has been modified to accomodate the new compression
setting and to include options for separate control of iCCP chunk compression.

The new ABI, png_setting, has been modified to accomodate a wider range of
settings and most of the old compression control ABIs have been replaced by
function-like macros with the same API which call png_setting.  This is an API
check in 1.7.0 for png_setting (alone).  png_setting now handles all of
png_set_option.  This eliminates 19 ABIs at the cost of adding 1 (png_setting).

CRC and benign error checking has been updated internally to use bit-fields and
the CRC calculation skip when the CRC is not used has been improved slightly to
avoid the initialization of the CRC.  A new png_setting based API allows more
detailed control of benign error/warning messages (this may change, the internal
error handling seems too complex.)  The ERROR_NUMBERS support has been removed
with the intent of implementing proper i18n.

The memcpy-size-0 issue in png_push_fill_buffer has been fixed, with an
appropriate debug() assert if a fill for 0 bytes occurs.

Most PNG_FLAG_ values for png_struct::flags have been eliminated (as a result of
the benign error handling changes).  Only one remains.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-06-07 06:48:52 -07:00
Glenn Randers-Pehrson
120f80369b [libpng17] Port contrib/libtests/pngvalid.c from libpng16. 2016-05-31 10:14:08 -05:00
John Bowler
1982dc6c2f Back-port 1.6 pngvalid.c
No changes; files are identical

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-29 09:28:39 -07:00
Glenn Randers-Pehrson
a1296131fe [libpng17] Refactored duplicate coded in png_set_check_for_invalid_index()
to quiet a Coverity issue and save a few bytes of code.
2016-05-22 14:42:14 -05:00
Glenn Randers-Pehrson
5095b2adfb [libpng17] Update CHANGES and ANNOUNCE 2016-05-21 13:26:51 -05:00
John Bowler
5b19ac3019 Write fine tuning
Fine tuning of options so that the default settings are comparable with 1.6;
test set sizes are about 2% greater than 1.6 because of the use of FAST rather
than ALL filters (this mainly affects RGB images).

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-21 08:41:44 -07:00
John Bowler
a5b340e20b timepng: fix builds in certain 1.7 configs
Libpng 1.7 supports read without PNG de-interlace, however this means the old
checks on whether contrib/libtests/timepng.c (just checking for sequential read)
are inadequate.  1.7 also provides macros to explicitly turn off png_read_png
and png_read_image, so use these instead.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-21 08:40:04 -07:00
John Bowler
21f92eef89 timepng.c: check for clock_gettime
Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-18 08:42:21 -07:00
John Bowler
bf101dcea1 Merge branch 'libpng17' into 20160506-write 2016-05-18 08:41:15 -07:00
John Bowler
764ae3995b Filter tuning, legacy option
png_level -1 sets the defaults for write compression/filters/IDAT size to those
used in pre-1.7 versions of libpng, producing results that with a few exceptions
are identical to earlier versions.  This commit also includes an important bug
fix for the previous commit which was erroneously using the greatest sum not the
least sum of absolute values when performing filter selection.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-16 22:59:20 -07:00
Glenn Randers-Pehrson
bd6fb5534f [libpng17] Update Makefile.am, fix typo in timepng.c 2016-05-16 19:39:55 -05:00
Glenn Randers-Pehrson
f05407d292 [libpng17] Check for CLOCK_PROCESS_CPUTIME_ID in /contrib/libtests/timepng.
Otherwise it does not build on platforms that don't supply clock_gettime().
2016-05-16 18:59:47 -05:00