Merge branch '8.11'

This commit is contained in:
John Cupitt 2021-09-05 12:00:20 +01:00
commit 6f9d3ecf91
1 changed files with 5 additions and 4 deletions

View File

@ -443,6 +443,11 @@ vips_thumbnail_calculate_shrink( VipsThumbnail *thumbnail,
*hshrink = VIPS_MAX( 1, *hshrink );
*vshrink = VIPS_MAX( 1, *vshrink );
}
/* We don't want to shrink so much that we send an axis to 0.
*/
*hshrink = VIPS_MIN( *hshrink, input_width );
*vshrink = VIPS_MIN( *vshrink, input_height );
}
/* Just the common part of the shrink: the bit by which both axes must be
@ -461,10 +466,6 @@ vips_thumbnail_calculate_common_shrink( VipsThumbnail *thumbnail,
shrink = VIPS_MIN( hshrink, vshrink );
/* We don't want to shrink so much that we send an axis to 0.
*/
shrink = VIPS_MIN( shrink, VIPS_MIN( width, height ) );
return( shrink );
}