[libpng16] Edited new commentary in png.c
This commit is contained in:
parent
f229d4df3a
commit
747b554a86
20
png.c
20
png.c
@ -1896,14 +1896,14 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
"intent outside defined range");
|
"intent outside defined range");
|
||||||
|
|
||||||
/* At this point the tag table can't be checked because it hasn't necessarily
|
/* At this point the tag table can't be checked because it hasn't necessarily
|
||||||
* been loaded, however various header fields can be checked. These checks
|
* been loaded; however, various header fields can be checked. These checks
|
||||||
* are for values permitted by the PNG spec in an ICC profile; the PNG spec
|
* are for values permitted by the PNG spec in an ICC profile; the PNG spec
|
||||||
* restricts the profiles than can be passed in an iCCP chunk (they must be
|
* restricts the profiles that can be passed in an iCCP chunk (they must be
|
||||||
* appropriate to processing PNG data!)
|
* appropriate to processing PNG data!)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Data checks (could be skipped). These checks must be independent of the
|
/* Data checks (could be skipped). These checks must be independent of the
|
||||||
* version number, however the version number doesn't accomodate changes in
|
* version number; however, the version number doesn't accomodate changes in
|
||||||
* the header fields (just the known tags and the interpretation of the
|
* the header fields (just the known tags and the interpretation of the
|
||||||
* data.)
|
* data.)
|
||||||
*/
|
*/
|
||||||
@ -1921,10 +1921,10 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||||||
* and 4)."
|
* and 4)."
|
||||||
*
|
*
|
||||||
* This code does not check the color type because png_set_iCCP may be called
|
* This code does not check the color type because png_set_iCCP may be called
|
||||||
* before png_set_IHDR on write and because, anyway, the spec is
|
* before png_set_IHDR on write and because, anyway, the PNG spec is
|
||||||
* fundamentally flawed: RGB profiles can be used quite meaningfully for
|
* fundamentally flawed: RGB profiles can be used quite meaningfully for
|
||||||
* grayscale images and both RGB and palette images may only have gray colors
|
* grayscale images and both RGB and palette images might only have gray
|
||||||
* in them, so gray profiles may be appropriate.
|
* colors in them, so gray profiles may be appropriate.
|
||||||
*/
|
*/
|
||||||
temp = png_get_uint_32(profile+16); /* data colour space field */
|
temp = png_get_uint_32(profile+16); /* data colour space field */
|
||||||
if (temp != 0x52474220 /* 'RGB ' */ && temp != 0x47524159 /* 'GRAY' */)
|
if (temp != 0x52474220 /* 'RGB ' */ && temp != 0x47524159 /* 'GRAY' */)
|
||||||
@ -2011,7 +2011,7 @@ static const struct
|
|||||||
PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0,
|
PNG_MD5(0x34562abf, 0x994ccd06, 0x6d2c5721, 0xd0d68c5d), 0,
|
||||||
"2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc")
|
"2007/07/25 00:05:37", 60960, "sRGB_v4_ICC_preference.icc")
|
||||||
|
|
||||||
/* The following profiles have no known MD5 checksum, if there is a match
|
/* The following profiles have no known MD5 checksum. If there is a match
|
||||||
* on the (empty) MD5 the other fields are used to attempt a match and
|
* on the (empty) MD5 the other fields are used to attempt a match and
|
||||||
* a warning is produced. The first two of these profiles have a 'cprt' tag
|
* a warning is produced. The first two of these profiles have a 'cprt' tag
|
||||||
* which suggests that they were also made by Hewlett Packard.
|
* which suggests that they were also made by Hewlett Packard.
|
||||||
@ -2033,10 +2033,10 @@ static int
|
|||||||
png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
|
png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
|
||||||
png_const_bytep profile, uLong adler)
|
png_const_bytep profile, uLong adler)
|
||||||
{
|
{
|
||||||
/* The quick check is to verify just the MD5 signature and trust to the
|
/* The quick check is to verify just the MD5 signature and trust the
|
||||||
* rest of the data. Because the profile has already been verified for
|
* rest of the data. Because the profile has already been verified for
|
||||||
* correctness this is safe. png_colorspace_set_sRGB will check the 'intent'
|
* correctness this is safe. png_colorspace_set_sRGB will check the 'intent'
|
||||||
* field too, so if the profile has been editted with an intent not defined
|
* field too, so if the profile has been edited with an intent not defined
|
||||||
* by sRGB (but maybe defined by a later ICC specification) the read of
|
* by sRGB (but maybe defined by a later ICC specification) the read of
|
||||||
* the profile will fail at that point.
|
* the profile will fail at that point.
|
||||||
*/
|
*/
|
||||||
@ -2142,7 +2142,7 @@ png_icc_set_gAMA_and_cHRM(png_const_structrp png_ptr,
|
|||||||
uLong adler, int preferred)
|
uLong adler, int preferred)
|
||||||
{
|
{
|
||||||
# ifdef PNG_sRGB_SUPPORTED
|
# ifdef PNG_sRGB_SUPPORTED
|
||||||
/* 1) Is this profile one of the known ICC sRGB profiles? If it is just
|
/* 1) Is this profile one of the known ICC sRGB profiles? If it is, just
|
||||||
* set the sRGB information.
|
* set the sRGB information.
|
||||||
*/
|
*/
|
||||||
if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler))
|
if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler))
|
||||||
|
Loading…
Reference in New Issue
Block a user