summaryrefslogtreecommitdiff
path: root/pngwrite.c
diff options
context:
space:
mode:
authorJohn Bowler <jbowler@acm.org>2013-04-17 21:27:47 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2013-04-17 21:27:47 -0500
commite4413a735bd7e9dfbe73b30b89a9b348f6c136fc (patch)
treebd4d6fe91cb1daac21e55cf958222eb7054ea022 /pngwrite.c
parent7fdb594e73746dcea3a11953da361466bbb1d4dc (diff)
downloadlibpng-e4413a735bd7e9dfbe73b30b89a9b348f6c136fc.tar.gz
[libpng16] Disallow storing sRGB information when the sRGB is not supported.
Reverted previous attempt to allow gAMA and sRGB non-support with the simplified API.
Diffstat (limited to 'pngwrite.c')
-rw-r--r--pngwrite.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/pngwrite.c b/pngwrite.c
index 196e8c0f7..c8b717a79 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Last changed in libpng 1.6.1 [March 28, 2013]
+ * Last changed in libpng 1.6.2 [(PENDING RELEASE)]
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -2074,12 +2074,9 @@ png_image_write_main(png_voidp argument)
if (write_16bit)
{
-#ifdef PNG_WRITE_gAMA_SUPPORTED
/* The gamma here is 1.0 (linear) and the cHRM chunk matches sRGB. */
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))
png_set_cHRM_fixed(png_ptr, info_ptr,
/* color x y */
@@ -2089,20 +2086,15 @@ png_image_write_main(png_voidp argument)
/* blue */ 15000, 6000
);
}
-#endif
-#ifdef PNG_WRITE_sRGB_SUPPORTED
else if (!(image->flags & PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB))
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
* space must still be gamma encoded.
*/
else
png_set_gAMA_fixed(png_ptr, info_ptr, PNG_GAMMA_sRGB_INVERSE);
-#endif
/* Write the file header. */
png_write_info(png_ptr, info_ptr);