thumbnail: avoid upsizing via libwebp (#2874)

This commit is contained in:
Kleis Auke Wolthuizen 2022-06-19 13:02:00 +02:00 committed by GitHub
parent c61b458904
commit 5b79a744a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -604,8 +604,16 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
thumbnail->input_width,
thumbnail->input_height );
}
else if( vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) {
factor = vips_thumbnail_calculate_common_shrink( thumbnail,
thumbnail->input_width,
thumbnail->page_height );
/* Avoid upsizing via libwebp.
*/
factor = VIPS_MAX( 1.0, factor );
}
else if( vips_isprefix( "VipsForeignLoadPdf", thumbnail->loader ) ||
vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ||
vips_isprefix( "VipsForeignLoadSvg", thumbnail->loader ) )
factor = vips_thumbnail_calculate_common_shrink( thumbnail,
thumbnail->input_width,