raise linpng size limit
By default libpng is limited to 1m pixels per axis. Raise this to VIPS_MAX_COORD, ie. 10m pixels.
This commit is contained in:
parent
f75b3c1ee9
commit
6b475c92a2
@ -7,6 +7,7 @@
|
|||||||
- remove stray trailing comma from iiif3 dirnames [whalehub]
|
- remove stray trailing comma from iiif3 dirnames [whalehub]
|
||||||
- fix TTF load [chregu]
|
- fix TTF load [chregu]
|
||||||
- revise GIF save alpha threshold [jfcalvo]
|
- revise GIF save alpha threshold [jfcalvo]
|
||||||
|
- raise libpng pixel size limit from 1m to 10m pixels [jskrzypek]
|
||||||
|
|
||||||
21/11/21 started 8.12.1
|
21/11/21 started 8.12.1
|
||||||
- fix insert [chregu]
|
- fix insert [chregu]
|
||||||
|
@ -83,6 +83,8 @@
|
|||||||
* - read out background, if we can
|
* - read out background, if we can
|
||||||
* 29/8/21 joshuamsager
|
* 29/8/21 joshuamsager
|
||||||
* - add "unlimited" flag to png load
|
* - add "unlimited" flag to png load
|
||||||
|
* 13/1/22
|
||||||
|
* - raise libpng pixel size limit to VIPS_MAX_COORD
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -304,6 +306,10 @@ read_new( VipsSource *source, VipsImage *out,
|
|||||||
PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE );
|
PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE );
|
||||||
#endif /*FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION*/
|
#endif /*FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION*/
|
||||||
|
|
||||||
|
/* libpng has a default soft limit of 1m pixels per axis.
|
||||||
|
*/
|
||||||
|
png_set_user_limits( read->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD );
|
||||||
|
|
||||||
if( vips_source_rewind( source ) )
|
if( vips_source_rewind( source ) )
|
||||||
return( NULL );
|
return( NULL );
|
||||||
png_set_read_fn( read->pPng, read, vips_png_read_source );
|
png_set_read_fn( read->pPng, read, vips_png_read_source );
|
||||||
@ -1046,7 +1052,8 @@ write_vips( Write *write,
|
|||||||
if( vips_image_pio_input( in ) )
|
if( vips_image_pio_input( in ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
if( compress < 0 || compress > 9 ) {
|
if( compress < 0 ||
|
||||||
|
compress > 9 ) {
|
||||||
vips_error( "vips2png",
|
vips_error( "vips2png",
|
||||||
"%s", _( "compress should be in [0,9]" ) );
|
"%s", _( "compress should be in [0,9]" ) );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
@ -1085,6 +1092,10 @@ write_vips( Write *write,
|
|||||||
|
|
||||||
interlace_type = interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE;
|
interlace_type = interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE;
|
||||||
|
|
||||||
|
/* libpng has a default soft limit of 1m pixels per axis.
|
||||||
|
*/
|
||||||
|
png_set_user_limits( write->pPng, VIPS_MAX_COORD, VIPS_MAX_COORD );
|
||||||
|
|
||||||
png_set_IHDR( write->pPng, write->pInfo,
|
png_set_IHDR( write->pPng, write->pInfo,
|
||||||
in->Xsize, in->Ysize, bitdepth, color_type, interlace_type,
|
in->Xsize, in->Ysize, bitdepth, color_type, interlace_type,
|
||||||
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT );
|
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT );
|
||||||
|
Loading…
Reference in New Issue
Block a user