From 67859c8fcbb77b0e85075a0eef6051d287855a0c Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Tue, 25 Jun 2013 18:50:55 -0500 Subject: [PATCH] [libpng15] Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18 as parameters for png_set_gamma(). These have been available since libpng-1.5.4. --- ANNOUNCE | 9 ++++++--- CHANGES | 5 ++++- example.c | 8 ++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2dca97489..b2f933697 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.17rc03 - June 18, 2013 +Libpng 1.5.17rc03 - June 25, 2013 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -49,13 +49,16 @@ Version 1.5.17beta01 [June 8, 2013] the confusion that would result by declaring the init function even when it is not used, so that it will always get prefixed. -Version 1.5.17rc01 [June 18, 2013] +Version 1.5.17rc01 [June 25, 2013] No changes. Version 1.5.17rc02 [June 18, 2013] Revised libpng.3 so that "doclifter" can process it. -Version 1.5.17rc03 [June 18, 2013] +Version 1.5.17rc03 [June 25, 2013] + Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18 + as parameters for png_set_gamma(). These have been available since + libpng-1.5.4. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 9d50cae19..f041e6f9a 100644 --- a/CHANGES +++ b/CHANGES @@ -4142,7 +4142,10 @@ Version 1.5.17rc01 [June 17, 2013] Version 1.5.17rc02 [June 18, 2013] Revised libpng.3 so that "doclifter" can process it. -Version 1.5.17rc03 [June 18, 2013] +Version 1.5.17rc03 [June 25, 2013] + Revised example.c to illustrate use of PNG_DEFAULT_sRGB and PNG_GAMMA_MAC_18 + as parameters for png_set_gamma(). These have been available since + libpng-1.5.4. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/example.c b/example.c index 86068ea1e..e3977ab24 100644 --- a/example.c +++ b/example.c @@ -259,9 +259,9 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ /* If we don't have another value */ else { - screen_gamma = 2.2; /* A good guess for a PC monitor in a dimly - lit room */ - screen_gamma = 1.7 or 1.0; /* A good guess for Mac systems */ + screen_gamma = PNG_DEFAULT_sRGB; /* A good guess for a PC monitor + in a dimly lit room */ + screen_gamma = PNG_GAMMA_MAC_18 or 1.0; /* Good guesses for Mac systems */ } /* Tell libpng to handle the gamma conversion for you. The final call @@ -273,7 +273,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */ int intent; if (png_get_sRGB(png_ptr, info_ptr, &intent)) - png_set_gamma(png_ptr, screen_gamma, 0.45455); + png_set_gamma(png_ptr, screen_gamma, PNG_DEFAULT_sRGB); else { double image_gamma;