mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Added #ifdef PNG_WRITE_sRGB_SUPPORTED, etc., tests where needed in
png_image_write_main() in pngwrite.c (bug report from Yuriy Levchenko).
This commit is contained in:
parent
f1736a636b
commit
7fdb594e73
3
ANNOUNCE
3
ANNOUNCE
@ -41,6 +41,9 @@ Version 1.6.2beta01 [April 14, 2013]
|
|||||||
Version 1.6.2beta02 [April 17, 2013]
|
Version 1.6.2beta02 [April 17, 2013]
|
||||||
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
|
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
|
||||||
written by libpng-1.6.0 and 1.6.1.
|
written by libpng-1.6.0 and 1.6.1.
|
||||||
|
Levchenko).
|
||||||
|
Added #ifdef PNG_WRITE_sRGB_SUPPORTED, etc., tests where needed in
|
||||||
|
png_image_write_main() in pngwrite.c (bug report from Yuriy Levchenko).
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
2
CHANGES
2
CHANGES
@ -4489,6 +4489,8 @@ Version 1.6.2beta01 [April 14, 2013]
|
|||||||
Version 1.6.2beta02 [April 17, 2013]
|
Version 1.6.2beta02 [April 17, 2013]
|
||||||
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
|
Added contrib/tools/fixitxt.c, to repair the erroneous iTXt chunk length
|
||||||
written by libpng-1.6.0 and 1.6.1.
|
written by libpng-1.6.0 and 1.6.1.
|
||||||
|
Added #ifdef PNG_WRITE_sRGB_SUPPORTED, etc., tests where needed in
|
||||||
|
png_image_write_main() in pngwrite.c (bug report from Yuriy Levchenko).
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
|||||||
@ -2074,9 +2074,12 @@ png_image_write_main(png_voidp argument)
|
|||||||
|
|
||||||
if (write_16bit)
|
if (write_16bit)
|
||||||
{
|
{
|
||||||
|
#ifdef PNG_WRITE_gAMA_SUPPORTED
|
||||||
/* The gamma here is 1.0 (linear) and the cHRM chunk matches sRGB. */
|
/* The gamma here is 1.0 (linear) and the cHRM chunk matches sRGB. */
|
||||||
png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR);
|
png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_LINEAR);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_cHRM_SUPPORTED
|
||||||
if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
|
if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
|
||||||
png_set_cHRM_fixed(png_ptr, info_ptr,
|
png_set_cHRM_fixed(png_ptr, info_ptr,
|
||||||
/* color x y */
|
/* color x y */
|
||||||
@ -2086,15 +2089,20 @@ png_image_write_main(png_voidp argument)
|
|||||||
/* blue */ 15000, 6000
|
/* blue */ 15000, 6000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_sRGB_SUPPORTED
|
||||||
else if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
|
else if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
|
||||||
png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL);
|
png_set_sRGB(png_ptr, info_ptr, PNG_sRGB_INTENT_PERCEPTUAL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PNG_WRITE_gAMA_SUPPORTED
|
||||||
/* Else writing an 8-bit file and the *colors* aren't sRGB, but the 8-bit
|
/* Else writing an 8-bit file and the *colors* aren't sRGB, but the 8-bit
|
||||||
* space must still be gamma encoded.
|
* space must still be gamma encoded.
|
||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
|
png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Write the file header. */
|
/* Write the file header. */
|
||||||
png_write_info(png_ptr, info_ptr);
|
png_write_info(png_ptr, info_ptr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user