[devel] Eliminated useless call to png_check_cHRM() from pngset.c

in png_set_gAMA_and_cHRM() where we supply the cHRM constants and
therefore we know they are OK.
This commit is contained in:
Glenn Randers-Pehrson 2009-09-24 19:49:13 -05:00
parent 4071d1ed7e
commit 85b0237adc
3 changed files with 13 additions and 18 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.0beta82 - September 24, 2009 Libpng 1.4.0beta82 - September 25, 2009
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -558,9 +558,10 @@ version 1.4.0beta81 [September 23, 2009]
Changed all "#if [!]defined(X)" to "if[n]def X" where possible. Changed all "#if [!]defined(X)" to "if[n]def X" where possible.
Eliminated unused png_ptr->row_buf_size Eliminated unused png_ptr->row_buf_size
version 1.4.0beta82 [September 24, 2009] version 1.4.0beta82 [September 25, 2009]
Move redundant IHDR checking into new png_check_IHDR() in png.c Moved redundant IHDR checking into new png_check_IHDR() in png.c
and report all errors found in the IHDR data. and report all errors found in the IHDR data.
Eliminated useless call to png_check_cHRM() from pngset.c
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -2244,9 +2244,10 @@ version 1.4.0beta81 [September 23, 2009]
Changed all "#if [!]defined(X)" to "if[n]def X" where possible. Changed all "#if [!]defined(X)" to "if[n]def X" where possible.
Eliminated unused png_ptr->row_buf_size Eliminated unused png_ptr->row_buf_size
version 1.4.0beta82 [September 24, 2009] version 1.4.0beta82 [September 25, 2009]
Move redundant IHDR checking into new png_check_IHDR() in png.c Moved redundant IHDR checking into new png_check_IHDR() in png.c
and report all errors found in the IHDR data. and report all errors found in the IHDR data.
Eliminated useless call to png_check_cHRM() from pngset.c
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct /* pngset.c - storage of image information into info struct
* *
* Last changed in libpng 1.4.0 [September 24, 2009] * Last changed in libpng 1.4.0 [September 25, 2009]
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -557,22 +557,15 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
blue_y = (float).06; blue_y = (float).06;
#endif #endif
#ifdef PNG_CHECK_cHRM_SUPPORTED
if (png_check_cHRM_fixed(png_ptr,
int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
int_green_y, int_blue_x, int_blue_y))
#endif
{
#ifdef PNG_FIXED_POINT_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED
png_set_cHRM_fixed(png_ptr, info_ptr, png_set_cHRM_fixed(png_ptr, info_ptr,
int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
int_green_y, int_blue_x, int_blue_y); int_green_y, int_blue_x, int_blue_y);
#endif #endif
#ifdef PNG_FLOATING_POINT_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED
png_set_cHRM(png_ptr, info_ptr, png_set_cHRM(png_ptr, info_ptr,
white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
#endif #endif
}
#endif /* cHRM */ #endif /* cHRM */
} }
#endif /* sRGB */ #endif /* sRGB */