142 Commits

Author SHA1 Message Date
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
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
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
John Bowler
5652acdd48 Filter selection, palette index checks
Palette index checking: checking on read was erroneously skipped.  pngcp can now
turn off the palette index checking or fix the errors (mainly to allow
comparison with libpng 1.6, which defaulted to ignoring it).  The API now
documents how the 'enabled' parameter works.  On read the check is on by default
(it was apparently off in libpng 1.6) however now if explicitly turned on the
warning message is stopped, this provides better interaction with
get_palette_max at the cost of a small API change (may need to be reviewed.)

Palette size errors: invalid entries in the palette are now set to #beaded to
make the errors more obvious and allow easy detection in memory.

Read transform pipeline caching: changes to fix the palette index check (which
are erroneously cached), the pipeline can now contain multiple caches.  E.g.
caching of packing of palette indices can be combined with caching of palette
RGB transforms.

Read code now checks for callbacks to read 0 data (and faults them).  Fixed the
reading of PNGs with multiple 0 length IDATs that failed as a result plus the
handling of zero length unknown.  (Which occurs, validly; the spurious warning
has been removed).

filter selection: the 1.6 and earlier sum of absolute differences algorithm has
been reintroduced with an option to disfavor some filters over others where the
sums are close (not yet exposed).  The selection code also logs the last known
occurence of each possible byte code across multiple lines.  This allows
detection of PNG images with lower bit depth than the format implies and,
therefore, allows the filtering to be turned off in those cases as well.

The default write zlib settings are still lower than libpng16.  The selection
algorithm is being refined (the overall results are worse than not doing any
filtering).

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-15 16:32:01 -07:00
John Bowler
cde9b583a8 Write code update
Implemented better defaulting of zlib settings based on image properties.
Implemented pass-through of png_write_rows when the rows can be used directly (a
common case) optimizing the handling of previous-row buffering.

Removed the METHODICAL filter selection method and disabled the HEURISTIC one;
the first was ridiculously slow (though useful for experiments) the second
doesn't work.  Filter selection is temporarily disabled (it defaults to the
lowest numbered filter in the list; typically 'none').

New handling of compression settings (incomplete), new PNG compression level
(not yet visible in an API).

Back ported 'PNG_FAST_FILTERS' from 1.6 (in png.h).

There are minimal API changes beyond removal of the selection options.  Work is
still to be done to investigate a filter selection mechanism that is at least as
good as the previous one.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-05-04 17:02:20 -07:00
John Bowler
3d024874a5 Recently introduced palette sharing bug
The internal read code change to stop sharing the palette was incompletely
implemented.  The result is that unless palette index checking is turned off and
there are no read transformations the png_info palette gets deleted when the
png_struct is deleted.  This is normally harmless (png_info gets deleted first)
but in the case of pngcp it results in use-after-free of the palette and,
therefore, palette corruption and maybe on some operating systems and access
violation.

This also updated pngcp 'search' mode to check a restricted range of memLevels;
there is an unrelated bug which means that lower zlib memLevels result in memory
corruption under some circumstances, probably less often than 1:1000.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-12 09:36:10 -08:00
John Bowler
1afbb57994 IDAT read buffering correction
The sequential read code failed to read to the end of the IDAT stream in about
1/820 cases, resulting in a spurious warning.  The
png_set_compression_buffer_size API also would not work (or do bad things) if
the size of a zlib uInt was less than 32 bits.

This includes a quiet API change to alter png_set_compression_buffer_size to use
a png_alloc_size_t, not png_size_t and implement the correct checks.

Signed-off-by: John Bowler <jbowler@acm.org>
2016-01-10 13:51:29 -08:00
Glenn Randers-Pehrson
89ebb4dd52 [libpng17] Happy 2016! Updated copyright year 2016-01-02 13:51:52 -06:00
John Bowler
4253c4d759 tIME and text position handling
The handling of tIME and text chunks on read now records the location of the
chunks relative to PLTE and IDAT.  Behavior on write is unchanged except that if
the position was recorded on read it will be re-used.

This involves an ABI change to the png_text_struct; a one byte location field is
added (with the same meaning as the one used to record unknown chunk location.)
Because this field is only used on read there is no API change unless a png_info
from a libpng read is passed to a subsequent libpng write (this did not work
very well before 1.7; the tIME chunk could get duplicated.)

png_set_text ignores the new field, resetting it to the current position in the
read or write stream.  On write the position is set to the next location to be
written unless the write has not started (the position is before the signature)
in which case the location is set to PNG_HAVE_PLTE|PNG_AFTER_IDAT.  When the
chunk is written the position is set to the actual write location (effectively
the position is frozen.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-29 15:30:31 -08:00
John Bowler
8d48a512bd Fix duplicate tIME chunk from png_write_png
Also add an example program, pngcp.c, which illustrates the problem when used to
copy pngtest.png (the result is an invalid PNG because the tIME chunk is
duplicated.)

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-19 09:51:07 -08:00
John Bowler
61acc4c9ed Prototype implementation of filter selection
This rewrites the code used previously in the heuristics to make it easier to
debug and introduces the 'methodical' method, which is intended to be an
expensive but reliable way of reducing image size.

The code in this commit does not work; the 'methodical' test for success does
not take account of data buffered inside zlib and, anyway, it changes the
results of pngtest so that the test fails.  This commit is just a checkpoint of
the current state; another commit will temporarily disable the 'methodical'
code.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-17 17:47:29 -08:00
Glenn Randers-Pehrson
15b6717221 [libpng17] Update copyright years in source files. 2015-12-13 22:37:27 -06:00
Glenn Randers-Pehrson
17bfbce61c [libpng17] Imported from libpng-1.7.0beta73.tar 2015-12-11 16:07:31 -06:00
Glenn Randers-Pehrson
2933c2e361 [libpng17] Changed png_struct->options from png_byte to png_uint_32, to hold
up to 16 2-bit options.
2015-12-11 14:53:54 -06:00
John Bowler
86499967c3 Checkpoint for 'methodical' filter selection
This checkpoint is to allow the massive merge with the recent mainline libpng17
changes.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-03 13:25:11 -08:00
John Bowler
9fce04fcd6 Change option (SUPPORTED) names, dummy code
The filter selection options are made more intuitive (IMO, but I am not an
Intuitive User).  Dummy code added for methodical filter selection.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-02 19:03:28 -08:00
John Bowler
84a8bb8244 Make png_struct palette, trans_alpha private
This removes the side-effect on the png_struct palette of calling png_set_PLTE
or png_set_tRNS.  NOTE: this is a quiet API change, it was possible before to
alter the palette on a PNG image by using png_set_PLTE, but this was unintended
and inconsistent with the other png_set APIs.

Fix a bug in palette index checking; png_struct::num_palette could, in
principle, get changed by the transformations (e.g. png_set_quantize) and this
would invalidate the check.  The palette checking init function now makes a copy
of png_struct::num_palette.

Fix a bug in pngvalid error handling.  A png_error in png_write_info is not
continuable (a valid image cannot necessarily be written afterward) because the
png_error aborts the write of subsequent pre-IDAT chunks.  In particular an
abort as a result of a bogus colorspace information (gAMA, cHRM, sBIT etc)
prevents the write of the PLTE chunk.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-12-01 08:16:53 -08:00
John Bowler
8fe2eac47f Separate png_compress_IDAT into w/c
I.e. write/compress, also remove some trailing spaces and clean up pnglibconf
stuff.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-30 21:00:22 -08:00
John Bowler
4792c8a751 compression code unification
Unify the compression code so that inflate calls are localized to a common
routine.  Ground work for filter selection support.  Minor API changes to use
void* not byte* for data parameters.  Unification of some of the compression
code with the decompression code; IDAT_size replaces IDAT_read_size and
zbuffer_size, IDAT reading and writing is no longer controlled by the size of
the compression buffer.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-30 13:39:49 -08:00
John Bowler
b3a18efebf Filter code change prep.
This commit moves code round and changes the filter write interfaces that took
png_uint_32 buffer pixel counts to unsigned int.  Also moves compression code
and definitions into pngwutil.c so that the compression code is isolated from
other definitions.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-27 15:42:52 -08:00
Glenn Randers-Pehrson
5db709d83c [libpng17] Updated CHANGES and ANNOUNCE, removed trailing blanks from *.c *.h 2015-11-24 14:38:52 -06:00
John Bowler
504ebd427d Back out READ/WRITE_INTERLACING changes
Now that the code works consistently so that these just switch off the support
for having libpng do the interlace/deinterlace the old names make more sense,
restoring them avoids cruft in the configuration file and avoids an unnecessary
version specific change.

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 20:25:24 -08:00
John Bowler
0f2554a5e6 Squashed commit of the following:
commit fc4b42b1d56f95efeb1b9fe42dc35b7d98d246bb
Merge: 74516c7 9eb1413
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 19:37:54 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 74516c7257f1a28a69985684c5673caa390c700a
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 19:32:43 2015 -0800

    Make check full pass on gcc/g++ x86_64

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

commit e891e34737fc0bc9ee873a5d56b83c1e777b990c
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 12:01:37 2015 -0800

    Checkpoint: write buffering changes

    This version fails in pngvalid --size because of an error handling very narrow
    images, otherwise a standard build passes make check.

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

commit 457a046ebdab737eefb477126cf855e49df6de50
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 06:39:36 2015 -0800

    Fix previous bad merge

commit b4f426c97267317637d43f41fe0b05d1659bc63d
Merge: 07b9b90 a3458a6
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 22 06:32:34 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 07b9b90dfd653b744dbc3710b096facf6b4605f6
Merge: ed43306 5592e0b
Author: John Bowler <jbowler@acm.org>
Date:   Sat Nov 21 17:07:23 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit ed43306599f7039a90187862db82273fca3a4c3d
Merge: 772aed7 d3c0359
Author: John Bowler <jbowler@acm.org>
Date:   Tue Nov 17 17:47:26 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 772aed72378df9c8fccc5a4594b095d02d410a9c
Merge: 73ae431 801608f
Author: John Bowler <jbowler@acm.org>
Date:   Mon Nov 16 14:26:38 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 73ae4316cb6db7d7f6756583a1c213c35ca4e3f4
Merge: 687e6e3 c09b3ab
Author: John Bowler <jbowler@acm.org>
Date:   Sun Nov 15 09:31:30 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 687e6e393e9d0220c2a12ec474aa01b83c5e9f25
Merge: fedd6da e916d9b
Author: John Bowler <jbowler@acm.org>
Date:   Thu Nov 5 08:45:14 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit fedd6da8798a14b2e002b0bc1379f5a09a03598a
Merge: 2e2fc5f ea41fd2
Author: John Bowler <jbowler@acm.org>
Date:   Tue Nov 3 21:05:01 2015 -0800

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 2e2fc5f6d7678b710c52b7ea081ac4add677d8d5
Merge: 990d5f8 5b05197
Author: John Bowler <jbowler@acm.org>
Date:   Mon Oct 12 08:28:30 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 990d5f88688635dc0888657b689e30ffe7e7a7b3
Author: John Bowler <jbowler@acm.org>
Date:   Sun Oct 4 17:04:53 2015 -0700

    Read row buffer changes

    The read code now allocates one row buffer of the size of the input PNG row and,
    only if required, one buffer of the size of the output.

    The output buffer is required for the progressive reader (always) and for the
    sequential reader if libpng is de-interlacing an image (because the output row
    is used multiple times if png_read_row is called with a display row parameter.)

    This should reduce memory utilization by libpng significantly, but it has no
    detectable effect on overall performance figures of the test programs, these are
    probably dominated by memory allocations for the whole image within the test
    programs.

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

commit 527bf989bf0e30440f9e07a5544a6ebb1d6fd039
Merge: 50ebbc2 9099254
Author: John Bowler <jbowler@acm.org>
Date:   Sat Oct 3 13:39:17 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 50ebbc2c9a24cf1a6b428db53d55fbd5af4d6be6
Merge: 21a7f40 2cd6d56
Author: John Bowler <jbowler@acm.org>
Date:   Sat Oct 3 11:16:32 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit 21a7f401ab40c79ead9e35882a8066e2cf1d6902
Merge: b512e1c 15a143e
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 19:01:23 2015 -0700

    Merge branch 'libpng17' into libpng17-filter-enhancements

commit b512e1c2c5bfe6df8b6dca32f862d325ec22115e
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:33:34 2015 -0700

    Transform rewrite: perform transforms in small chunks

    The intent of this change is to reduce the memory footprint during transform
    sequences by performing transforms in fixed (small) sized blocks of pixels.
    The change is incomplete; the filter code still works row-by-row, so the whole
    tranform also works row-by-row, the intent is to fix this so that everything
    works in small(ish) chunks.

    At present the change has no discernable effect on pngvalid --speed or pngstest
    with (e.g.) rgb-8-1.8.png; user time and (minor) page faults are the same in old
    and new versions.  The same applies to real-world 15MP PNG images; even on these
    the presence of the filter code causes a cyclical progress through memory which
    will interfere with any caching otherwise possible (useful word, 'otherwise'.)

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

commit 781cb3699b92beb0e6bc5e03cef8fba820267082
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:12:53 2015 -0700

    Fix NO_WRITE_INTERLACE in pngvalid.c

    The support for writing interlaced images directly from libpng 1.7 was
    unintentionally disabled (INTERLACE_LAST was defined incorrectly, excluding the
    interlaced images).  This obscured the fact that the transform and error test
    case generators lacked the support for writing interlaced images from libpng.

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

commit 406ee2fd7946a384f1d7713712dc646080c5c52c
Author: John Bowler <jbowler@acm.org>
Date:   Wed Sep 30 17:11:40 2015 -0700

    Add pngvalid --transform --interlace test

    This increases code coverage by generating test cases with smaller length rows
    as a result of the interlacing.  Without this packswap handling was incompletely
    tested.

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

Signed-off-by: John Bowler <jbowler@acm.org>
2015-11-22 19:41:41 -08: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
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
Glenn Randers-Pehrson
8ffa92dc25 [libpng17] Removed some unused WEIGHTED_FILTER macros from png.h and pngstruct.h 2015-06-10 07:02:36 -05:00
Glenn Randers-Pehrson
e0fea61cd8 [libpng17] Imported from libpng-1.7.0beta61.tar 2015-05-30 23:03:01 -05:00
John Bowler
673ae608ab [libpng17] Transformed rewrite: changed row_info, added checks. This introduces an
internal struct (png_transform_control) to replace row_info and uses
    that to implement affirms correctly.  The change also adds checks on
    the rowbytes calculation and additional checks on most transform
    implementations.
Added png_uint_16 range checking, pngvalid tRNS, fixed png_uint_16:
    review of previous checks, removal of some where SAFE. pngvalid: add
    testing of tRNS for better code coverage pngvalid: correct rgb-to-gray
    error calculations. Code coverage is still incomplete: see /*UNTESTED*/
    in pngrtran.c
2015-03-30 21:32:41 -05:00
Glenn Randers-Pehrson
9c7aee825c [libpng17] Bump version to 1.7.0beta52 2015-02-17 10:52:59 -06:00
Glenn Randers-Pehrson
f1e4acb5b1 [libpng17] Combined sub_row, up_row, avg_row, and paeth_row buffers into a
single try_row buffer and in cases where two or more of those are
being tested, a second tst_row buffer.  This improves CPU speed
over that achieved by libpng-1.7.0beta49.
2015-02-15 12:44:16 -06:00
Glenn Randers-Pehrson
1fd10de101 [libpng17] Removed now-obsolete comments. 2015-02-10 19:55:20 -06:00
Glenn Randers-Pehrson
8bc832389a [libpng17] Combined sub_row, up_row, avg_row, and paeth_row buffers into a
single try_row buffer.
2015-02-10 17:03:27 -06:00
Glenn Randers-Pehrson
ab95226db8 [libpng17] Imported from libpng-1.7.0beta47.tar 2015-01-28 19:25:43 -06:00
Glenn Randers-Pehrson
b1d49de5bc [libpng17] Happy New Year -- update copyright year. 2014-12-31 18:43:44 -06:00
Glenn Randers-Pehrson
28711dff2a [libpng17] Updated copyright year in recently-changed files. 2013-12-31 21:15:11 -06:00
John Bowler
808ea281a4 [libpng17] Corrected Android builds and corrected libpng.vers with symbol
prefixing. This adds an API to set optimization options externally,
providing an alternative and general solution for the non-portable
run-time tests used by the ARM Neon code.  It also makes those tests
compile and link on Android.  The order of settings vs options in
pnglibconf.h is reversed to allow settings to depend on options and
options can now set (or override) the defaults for settings.
2013-03-03 21:29:36 -06:00
Glenn Randers-Pehrson
851a6265a8 [libpng17] Use parentheses consistently with #if defined()
and wrapped some long lines.
2013-02-17 15:25:29 -06:00
John Bowler
803493e19c [libpng17] Ported libpng 1.5 options.awk/dfn file handling to 1.7, fixed one
bug.
2013-02-05 10:16:42 -06:00
John Bowler
46369f35c5 [libpng17] Fixed Windows build issues, enabled ARM compilation. Various warnings issued
by earlier versions of GCC fixed for Cygwin and Min/GW (which both use old GCCs.)
ARM support is enabled by default in zlib.props (unsupported by Microsoft) and
ARM compilation is made possible by deleting the check for x86. The test programs
cannot be run because they are not signed.
2012-12-20 22:58:13 -06:00
John Bowler
72389dec42 [libpng17] Cleaned up and enhanced the configure option; libpng now correctly
links and tests against zlib with a prefix; tests have been clarified; and
irrelevant or obsolete things (as defined by the autotools man page) have
been removed.
2012-12-17 09:20:02 -06:00
Glenn Randers-Pehrson
bbabd977d1 [libpng17] Fixed some typos in comments; updated manual. 2012-12-15 17:12:48 -06:00
John Bowler
eac85878bf [libpng17] Clean up USER_LIMITS feature, removing members from png_struct
when not required.
2012-12-14 22:56:00 -06:00
John Bowler
3e42c81193 [libpng17] Made 8-bit compose and rgb_to_grayscale accuracy improvements.
These changes cause 16-bit arithmetic to be used for 8-bit data in the gamma
    corrected compose and grayscale operations.  The arithmetic errors have
    three sources all of which are fixed in this commit:
    1) 8-bit linear calculations produce massive errors for lower intensity
       values.
    2) The old 16-bit "16 to 8" gamma table code erroneously wrote the lowest
       output value into a table entry which corresponded to multiple output
       values (so where the value written should have been the closest to the
       transformed input value.)
    3) In a number of cases the code to access the 16-bit table did not round;
       it did a simple shift, which was wrong and made the side effects of (2)
       even worse.
  The new gamma code does not have the 16-to-8 problem at the cost of slighly
    more calculations and the algorithm used to minimize the number of
    calculations has been extended to all the 16-bit tables; it has advantages
    for any significant gamma correction.
2012-12-14 22:17:54 -06:00
John Bowler
520803d57e [libpng16] Removed non-working ICC profile support code. There was too much
code for too little gain; implementing full ICC color correction is maybe
desireable but is left up to applications.
2012-11-01 08:12:47 -05:00
John Bowler
f8dfd123e2 [libpng16] Changed ICC profile support to allow use of an external color
management system (CMS). In practice it is not possible to obtain cHRM
information reliably using just the end-point tags because they do not exist
in the vast majority of profiles.  Instead it is necessary to run the endpoints
through the ICC colorimetric intent transform (as described in the v4
spec).  Since this is likely to be too much code inside libpng for too
little gain (it implies a fairly complete CMS implementation) the code
has been changed to allow an external CMS to be used.  This code is
temporarily disabled until a suitable set of test cases using one or more
external CMS implementations have been implemented.
2012-10-25 19:30:02 -05:00
Glenn Randers-Pehrson
933bc842ac [libpng16] Fix confusion between "adopted" and "adapted" in new comments.
Glenn thought the "adopted" were typos and changed them all to "adapted".
This reverts the spelling and adds parenthetical comments when each
word first appears in png.h.
2012-09-04 20:16:25 -05:00
Glenn Randers-Pehrson
9c06d78468 [libpng16] Imported from libpng-1.6.0beta29.tar 2012-09-04 16:59:12 -05:00
John Bowler
b98681b49a [libpng16] Improved ICC profile handling including cHRM chunk generation and
fixed Cygwin+MSVC build errors. The ICC profile handling now includes more
checking.  Several errors that caused rejection of the profile are now
handled with a warning in such a way that the invalid profiles will be
read by default in release (but not pre-RC) builds but will not be
written by default.  The easy part of handling a cHRM chunk is written,
where the ICC profile contains the required data.  The more difficult
part plus guessing a gAMA value requires code to pass selected RGB values
through the profile.
2012-09-04 16:35:20 -05:00
Glenn Randers-Pehrson
702053d110 [libpng16] Bump version to 1.6.0beta28 2012-08-17 21:54:45 -05:00
John Bowler
e9567514dd [libpng16] Unknown handling fixes and clean up. This adds more correct option
control of the unknown handling, corrects the pre-existing bug where
the per-chunk 'keep' setting is ignored and makes it possible to skip
IDAT chunks in the sequential reader (broken in earlier 1.6 versions).
There is a new test program, test-unknown.c, which is a work in progress
(not currently part of the test suite).  Comments in the header files now
explain how the unknown handling works.
2012-08-15 22:53:00 -05:00