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>
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>
Fixed point APIs are now supported throughout (no missing APIs).
Internal fixed point arithmetic support exists for all internal floating
point operations.
sCAL validates the floating point strings it is passed.
Safe, albeit rudimentary, Watcom support is provided by PNG_API_RULE==2
Two new APIs exist to get the number of passes without turning on the
PNG_INTERLACE transform and to get the number of rows in the current
pass.
A new test program, pngvalid.c, validates the gamma code.
Errors in the 16 bit gamma correction (overflows) have been corrected.
cHRM chunk testing is done consistently (previously the floating point
API bypassed it, because the test really didn't work on FP, now the test
is performed on the actual values to be stored in the PNG file so it
works in the FP case too.)
Most floating point APIs now simply call the fixed point APIs after
converting the values to the fixed point form used in the PNG file.
The standard headers no longer include zlib.h, which is currently only
required for pngstruct.h and can therefore be internal.
(Patches by John Bowler)
In all prior versions of libpng most configuration options
controlled by compiler #defines had to be repeated by the
application code that used libpng. This patch changes this
so that compilation options that can only be changed at build
time are frozen in the build. Options that are compiler
dependent (and those that are system dependent) are evaluated
each time - pngconf.h holds these. Options that can be changed
per-file in the application are in png.h. Frozen options are
in the new installed header file pnglconf.h
for DEF file generation.
PNG_CALLBACK added to make callback definitions uniform. PNGAPI split
into PNGCAPI (base C form), PNGAPI (exports) and PNGCBAPI (callbacks),
and appropriate changes made to all files. Cygwin builds re-hinged to
allow procedure call standard changes and to remove the need for the DEF
file (fixes build on Cygwin).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe) or to glennrp at users.sourceforge.net
Glenn R-P