Added new "png_structrp" typedef. Because of the
way libpng works both png_info and png_struct are always accessed via a
single pointer. This means adding C99 'restrict' to the pointer gives
the compiler some opportunity to optimize the code. This change allows that.
Previously it was disabled whenever internal fixed point arithmetic was
selected, which meant it didn't exist even on systems where FP was available
but not preferred.
casts. The compression_type parameter is always assigned to, so must
be non-NULL. The cast of the profile length potentially truncated the
value unnecessarily on a 16-bit int system, so the cast of the (byte)
compression type to (int) is specified by ANSI-C anyway.
It is too risky. Exactly how png_ptr->zbuf is used is under control of the
individual chunk implementation and there could easily be significant changes
within a major release.
the namespace. Added png_get_current_row_number and
png_get_current_pass_number for the
benefit of the user transform callback.
Added png_process_data_pause and png_process_data_skip for the benefit of
progressive readers that need to stop data processing or want to optimize
skipping of unread data (e.g. if the reader marks a chunk to be skipped.)
literal pointers declare them (John Bowler).
Many APIs did not change their arguments but were not declared using
PNG_CONST. This change corrects this. In a few cases APIs that return
constant string literal pointers have also been changed to declare this.
Unlike the argument change this may require app changes; however the
results could never be written to (the app would crash on some platforms
where strings are not writable), so this seems advisable.
that were recently introduced, mostly resulting from
safe but uncast assignments to shorter integers. Also added a zlib
VStudio release library project because the latest zlib Official Windows
build does not include such a thing.
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)