From 0bc79772c820a44a9f287fa38bbecdd912fdc24f Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 11 Aug 2011 09:01:57 -0500 Subject: [PATCH] [devel] Revised commentary about png_rgb_to_gray coefficents and fixed spelling (truely -> truly) in comments. --- pngrtran.c | 5 +++++ pngset.c | 2 +- pngvalid.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pngrtran.c b/pngrtran.c index 67813b51a..74e80cb1b 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -3093,6 +3093,11 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) * * Y = (6968 * R + 23434 * G + 2366 * B)/32768 * + * Starting with libpng-1.5.4, if the image being converted has the + * sRGB chunk, then the sRGB numbers are used by default: + * + * Y = 0.33000*R + 0.60000*G + 0.06000*B + * * The calculation is to be done in a linear colorspace. * * Other integer coefficents can be used via png_set_rgb_to_gray(). diff --git a/pngset.c b/pngset.c index 7eaad7dd4..08d8ff483 100644 --- a/pngset.c +++ b/pngset.c @@ -99,7 +99,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point * possible for 1/gamma to overflow the limit of 21474 and this means the * gamma value must be at least 5/100000 and hence at most 20000.0. For * safety the limits here are a little narrower. The values are 0.00016 to - * 6250.0, which are truely ridiculous gammma values (and will produce + * 6250.0, which are truly ridiculous gammma values (and will produce * displays that are all black or all white.) */ if (file_gamma < 16 || file_gamma > 625000000) diff --git a/pngvalid.c b/pngvalid.c index 138bfd0cb..9da69ddd6 100644 --- a/pngvalid.c +++ b/pngvalid.c @@ -2104,7 +2104,7 @@ modifier_progressive_read(png_modifier *pm, png_structp pp, png_infop pi) png_error(pp, "store state damaged (progressive)"); /* This is another Horowitz and Hill random noise generator. In this case - * the aim is to stress the progressive reader with truely horrible variable + * the aim is to stress the progressive reader with truly horrible variable * buffer sizes in the range 1..500, so a sequence of 9 bit random numbers * is generated. We could probably just count from 1 to 32767 and get as * good a result.