READ_GAMMA. Prior to 1.6.0 switching off READ_GAMMA did unpredictable things
to the interfaces that use it (specifically, png_do_background in 1.4 would
simply display composite for grayscale images but do composition
with the incorrect arithmetic for color ones). In 1.6 the semantic
of -DPNG_NO_READ_GAMMA is changed to simply disable any interface that
depends on it; this obliges people who set it to consider whether they
really want it off if they happen to use any of the interfaces in
question (typically most users who disable it won't).
option to pngtest. The "--relaxed" option turns off the benign errors that are
enabled by default in pre-RC builds. makepng can now write ICC profiles
where the length has not been extended to a multiple of 4, and pngtest
now intercepts all libpng errors, allowing the previously-introduced
"--strict test" on no warnings to actually work.
contrib/libtests/makepng: corrected 'rgb' and 'gray' cases. profile_error
messages could be truncated; made a correct buffer size calculation and
adjusted pngerror.c appropriately. png_icc_check_* checking improved;
changed the functions to receive the correct color type of the PNG on read
or write and check that it matches the color space of the profile (despite
what the comments said before, there is danger in assuming the app will
cope correctly with an RGB profile on a grayscale image and, since it
violates the PNG spec, allowing it is certain to produce inconsistent
app behavior and might even cause app crashes.) Check that profiles
contain the tags needed to process the PNG (tags all required by the ICC
spec). Removed unused PNG_STATIC from pngpriv.h.
png_handle_unknown() when SAVE support is absent. Moved the shell test
scripts for contrib/libtests from the libpng top directory to contrib/libtests.
png_handle_unknown() must always read or skip the chunk, if
SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set
a user callback an unknown chunk will not be read, leading to a read
error, which was revealed by the "tunknown" test.
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.
support. Now "make check" will succeed even if libpng is compiled with
-DPNG_NO_READ or -DPNG_NO_WRITE. The tests performed are reduced, but the
basic reading and writing of a PNG file is always tested by one or more of
the tests.
ignore all unknown chunks and all known chunks except for IHDR, PLTE, tRNS,
IDAT, and IEND. Previously it only meant ignore all unknown chunks, the
same as num_chunks == 0. Revised png_image_skip_unused_chunks() to
provide a list of chunks to be processed instead of a list of chunks to
ignore. Revised contrib/gregbook/readpng2.c accordingly.
The compiler performs an optimization which is safe; however it then warns
about it. Changing the type of 'palette_number' in pngvalid.c removes the
warning.
This is necessary because the VS2010 output window otherwise simply loses
the error messages on error (they weren't flushed to the window before
the process exited, apparently!)
all potentially valid ICC profiles and reject obviously invalid ones.
It now uses png_error() to do so rather than casually writing a PNG
without the necessary color data.
generator. The generator generates images that test the full range of sample
values, allow the error numbers in pngstest to be tuned and checked. makepng
also allows generation of images with extra chunks, although this is
still work-in-progress.
store intermediate files, or intermediate in-memory data, while processing
image data with the simplified API. The option makes the files larger
but faster to write and read. pngstest now uses this by default; this
can be disabled with the --slow option.
Fixed a memory overwrite bug in simplified read of RGB PNG with
non-linear gamma Also bugs in the error checking in pngread.c and changed
quite a lot of the checks in pngstest.c to be correct; either correctly
written or not over-optimistic. The pngstest changes are insufficient to
allow all possible RGB transforms to be passed; pngstest cmppixel needs
to be rewritten to make it clearer which errors it allows and then changed
to permit known inaccuracies.
The API is extremely inaccurate for sRGB conversions because it uses an 8-bit
intermediate linear value and it does not use the sRGB transform, so it
suffers from the known instability in gamma transforms for values close
to 0 (see Poynton). The net result is that the calculation has a maximum
error of 14.99/255; 0.5/255^(1/2.2). pngstest now uses 15 for the
permitted 8-bit error. This may still not be enough because of arithmetic
error.