Merge pull request #151 from lovell/libpng-skip-profile-check

Prevent libpng verifying sRGB profiles
This commit is contained in:
John Cupitt 2014-08-09 16:58:09 +01:00
commit 858b6ca2db
1 changed files with 12 additions and 0 deletions

View File

@ -188,6 +188,12 @@ read_new( VipsImage *out, gboolean readbehind )
user_error_function, user_warning_function )) )
return( NULL );
#ifdef PNG_SKIP_sRGB_CHECK_PROFILE
/* Prevent libpng (>=1.6.11) verifying sRGB profiles.
*/
png_set_option( read->pPng, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON );
#endif /*PNG_SKIP_sRGB_CHECK_PROFILE*/
/* Catch PNG errors from png_create_info_struct().
*/
if( setjmp( png_jmpbuf( read->pPng ) ) )
@ -717,6 +723,12 @@ write_new( VipsImage *in )
user_error_function, user_warning_function )) )
return( NULL );
#ifdef PNG_SKIP_sRGB_CHECK_PROFILE
/* Prevent libpng (>=1.6.11) verifying sRGB profiles.
*/
png_set_option( write->pPng, PNG_SKIP_sRGB_CHECK_PROFILE, PNG_OPTION_ON );
#endif /*PNG_SKIP_sRGB_CHECK_PROFILE*/
/* Catch PNG errors from png_create_info_struct().
*/
if( setjmp( png_jmpbuf( write->pPng ) ) )