diff --git a/ANNOUNCE b/ANNOUNCE index b8e9ce8bb..7f9a92db4 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -538,6 +538,7 @@ Version 1.6.0beta31 [October 26, 2012] has been changed to allow an external CMS to be used. This code is temporarily disabled until a suitable set of test cases using one or more external CMS implementations have been implemented. + Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 58cbd10ef..2ff5e7eea 100644 --- a/CHANGES +++ b/CHANGES @@ -4290,6 +4290,7 @@ Version 1.6.0beta31 [October 26, 2012] has been changed to allow an external CMS to be used. This code is temporarily disabled until a suitable set of test cases using one or more external CMS implementations have been implemented. + Make builds -DPNG_NO_READ_GAMMA compile (the unit tests still fail). Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/contrib/libtests/pngvalid.c b/contrib/libtests/pngvalid.c index 7d39161a8..9edae396b 100644 --- a/contrib/libtests/pngvalid.c +++ b/contrib/libtests/pngvalid.c @@ -2004,6 +2004,7 @@ static double abserr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) return pm->maxabs8; } +#ifdef PNG_READ_GAMMA_SUPPORTED static double calcerr(PNG_CONST png_modifier *pm, int in_depth, int out_depth) { /* Error in the linear composition arithmetic - only relevant when @@ -2120,6 +2121,7 @@ static int output_quantization_factor(PNG_CONST png_modifier *pm, int in_depth, else return 1; } +#endif /* PNG_READ_GAMMA_SUPPORTED */ /* One modification structure must be provided for each chunk to be modified (in * fact more than one can be provided if multiple separate changes are desired @@ -2808,6 +2810,7 @@ srgb_modification_init(srgb_modification *me, png_modifier *pm, png_byte intent) pm->modifications = &me->this; } +#ifdef PNG_READ_GAMMA_SUPPORTED typedef struct sbit_modification { png_modification this; @@ -2874,6 +2877,7 @@ sbit_modification_init(sbit_modification *me, png_modifier *pm, png_byte sbit) me->this.next = pm->modifications; pm->modifications = &me->this; } +#endif /* PNG_READ_GAMMA_SUPPORTED */ #endif /* PNG_READ_TRANSFORMS_SUPPORTED */ /***************************** STANDARD PNG FILES *****************************/ diff --git a/pngrtran.c b/pngrtran.c index 33a1d23fc..c67298357 100644 --- a/pngrtran.c +++ b/pngrtran.c @@ -3284,7 +3284,7 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) if (row_info->bit_depth == 8) { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) +#ifdef PNG_READ_GAMMA_SUPPORTED /* Notice that gamma to/from 1 are not necessarily inverses (if * there is an overall gamma correction). Prior to 1.5.5 this code * checked the linearized values for equality; this doesn't match @@ -3361,7 +3361,7 @@ png_do_rgb_to_gray(png_structrp png_ptr, png_row_infop row_info, png_bytep row) else /* RGB bit_depth == 16 */ { -#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) +#ifdef PNG_READ_GAMMA_SUPPORTED if (png_ptr->gamma_16_to_1 != NULL && png_ptr->gamma_16_from_1 != NULL) { png_bytep sp = row; @@ -3535,12 +3535,12 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr) png_const_uint_16pp gamma_16_from_1 = png_ptr->gamma_16_from_1; png_const_uint_16pp gamma_16_to_1 = png_ptr->gamma_16_to_1; int gamma_shift = png_ptr->gamma_shift; + int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0; #endif png_bytep sp; png_uint_32 i; png_uint_32 row_width = row_info->width; - int optimize = (png_ptr->flags & PNG_FLAG_OPTIMIZE_ALPHA) != 0; int shift; png_debug(1, "in png_do_compose");