From 0109b39f58e01918cdced718acc0ad0b1aa5bc0b Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Sun, 3 Feb 2013 10:18:10 +0000 Subject: [PATCH] [trunk] update convert about png writing with additional metadata (thanks winfried) --- src/bin/jp2/convert.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c index dad3f8b0..98d900ad 100644 --- a/src/bin/jp2/convert.c +++ b/src/bin/jp2/convert.c @@ -3408,6 +3408,9 @@ int imagetopng(opj_image_t * image, const char *write_idf) color_type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + png_set_gamma(png, 2.2, 1./2.2); + png_set_sRGB(png, info, PNG_sRGB_INTENT_PERCEPTUAL); /*=============================*/ png_write_info(png, info); /*=============================*/ @@ -3524,6 +3527,9 @@ int imagetopng(opj_image_t * image, const char *write_idf) PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); png_set_sBIT(png, info, &sig_bit); + + png_set_gamma(png, 2.2, 1./2.2); + png_set_sRGB(png, info, PNG_sRGB_INTENT_PERCEPTUAL); /*=============================*/ png_write_info(png, info); /*=============================*/