Merge branch '8.8'

This commit is contained in:
John Cupitt 2019-08-27 14:49:42 +01:00
commit 2f6cc1fad9
2 changed files with 15 additions and 19 deletions

View File

@ -27,6 +27,7 @@
- better feof() handling in GIF load - better feof() handling in GIF load
- clip coding and interpretation on vips image read - clip coding and interpretation on vips image read
- check image bounds for GIF load - check image bounds for GIF load
- prevent over-pre-shrink in thumbnail [kleisauke]
24/5/19 started 8.8.1 24/5/19 started 8.8.1
- improve realpath() use on older libc - improve realpath() use on older libc

View File

@ -22,6 +22,8 @@
* - don't force import CMYK, since colourspace knows about it now * - don't force import CMYK, since colourspace knows about it now
* 24/4/19 * 24/4/19
* - support multi-page (animated) images * - support multi-page (animated) images
* 27/8/19 kleisauke
* - prevent over-pre-shrink in thumbnail
*/ */
/* /*
@ -464,36 +466,24 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
factor = 1.0; factor = 1.0;
if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) ) { if( vips_isprefix( "VipsForeignLoadJpeg", thumbnail->loader ) )
factor = vips_thumbnail_find_jpegshrink( thumbnail, factor = vips_thumbnail_find_jpegshrink( thumbnail,
thumbnail->input_width, thumbnail->input_height ); thumbnail->input_width, thumbnail->input_height );
g_info( "loading jpeg with factor %g pre-shrink", factor );
}
else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) || else if( vips_isprefix( "VipsForeignLoadTiff", thumbnail->loader ) ||
vips_isprefix( "VipsForeignLoadOpenslide", vips_isprefix( "VipsForeignLoadOpenslide",
thumbnail->loader ) ) { thumbnail->loader ) )
factor = vips_thumbnail_find_pyrlevel( thumbnail, factor = vips_thumbnail_find_pyrlevel( thumbnail,
thumbnail->input_width, thumbnail->input_height ); thumbnail->input_width, thumbnail->input_height );
else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) )
g_info( "loading pyr level %g", factor );
}
else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) ) {
factor = 1.0 / factor = 1.0 /
vips_thumbnail_calculate_common_shrink( thumbnail, vips_thumbnail_calculate_common_shrink( thumbnail,
thumbnail->input_width, thumbnail->input_width,
thumbnail->page_height ); thumbnail->page_height );
else if( vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) )
g_info( "loading PDF with factor %g pre-scale", factor );
}
else if( vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) ) {
factor = 1.0 / factor = 1.0 /
vips_thumbnail_calculate_common_shrink( thumbnail, vips_thumbnail_calculate_common_shrink( thumbnail,
thumbnail->input_width, thumbnail->input_width,
thumbnail->input_height ); thumbnail->input_height );
g_info( "loading SVG with factor %g pre-scale", factor );
}
else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) { else if( vips_isprefix( "VipsForeignLoadHeif", thumbnail->loader ) ) {
/* 'factor' is a gboolean which enables thumbnail load instead /* 'factor' is a gboolean which enables thumbnail load instead
* of image load. * of image load.
@ -507,14 +497,19 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
factor = 0.0; factor = 0.0;
} }
else if( vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) { else if( vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) )
factor = 1.0 / factor = 1.0 /
vips_thumbnail_calculate_common_shrink( thumbnail, vips_thumbnail_calculate_common_shrink( thumbnail,
thumbnail->input_width, thumbnail->input_width,
thumbnail->page_height ); thumbnail->page_height );
g_info( "loading webp with factor %g pre-scale", factor ); /* We don't want to pre-shrink so much that we send an axis to 0.
} */
if( factor > thumbnail->input_width ||
factor > thumbnail->input_height )
factor = 1.0;
g_info( "loading with factor %g pre-shrink", factor );
if( !(im = class->open( thumbnail, factor )) ) if( !(im = class->open( thumbnail, factor )) )
return( NULL ); return( NULL );