Ensure vips_thumbnail doesn't send an axis to 0 (#2416)
This commit is contained in:
parent
b62287a792
commit
632badabe1
@ -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 );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user