mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[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.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
53f7051b1b
commit
b98681b49a
@@ -1442,8 +1442,8 @@ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr,
|
||||
#ifdef PNG_iCCP_SUPPORTED
|
||||
PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
|
||||
png_colorspacerp colorspace, png_const_charp name,
|
||||
png_uint_32 profile_length, png_const_bytep profile, int preferred,
|
||||
int color_type), PNG_EMPTY);
|
||||
png_uint_32 profile_length, png_const_bytep profile, int color_type),
|
||||
PNG_EMPTY);
|
||||
/* The 'name' is used for information only */
|
||||
|
||||
/* Routines for checking parts of an ICC profile. */
|
||||
@@ -1461,8 +1461,7 @@ PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr,
|
||||
png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY);
|
||||
PNG_INTERNAL_FUNCTION(int,png_icc_set_gAMA_and_cHRM,(
|
||||
png_const_structrp png_ptr, png_colorspacerp colorspace,
|
||||
png_const_charp name, png_const_bytep profile, uLong adler, int preferred),
|
||||
PNG_EMPTY);
|
||||
png_const_charp name, png_const_bytep profile, uLong adler), PNG_EMPTY);
|
||||
/* 'adler' is the Adler32 checksum of the uncompressed profile data. It may
|
||||
* be zero to indicate that it is not available. It is used, if provided,
|
||||
* as a fast check on the profile when checking to see if it is sRGB. The
|
||||
|
||||
Reference in New Issue
Block a user