don't set shrink too low

This commit is contained in:
John Cupitt 2014-08-04 21:25:19 +01:00
parent f1df91eebb
commit e4996d8dce
2 changed files with 5 additions and 1 deletions

View File

@ -353,6 +353,7 @@ vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate,
bicubic_int_tab<unsigned char, 0, UCHAR_MAX>(
out, p, bands, lskip,
cxi, cyi );
/*
Handy for benchmarking
@ -360,11 +361,13 @@ vips_interpolate_bicubic_interpolate( VipsInterpolate *interpolate,
bicubic_float_tab<unsigned char>(
out, p, bands, lskip,
cxf, cyf );
bicubic_notab<unsigned char>(
out, p, bands, lskip,
x - ix, y - iy );
*/
break;
case VIPS_FORMAT_CHAR:

View File

@ -229,7 +229,8 @@ calculate_shrink( VipsImage *im, double *residual,
*
* We want to shrink by less for interpolators with larger windows.
*/
int shrink = floor( factor2 ) / VIPS_MAX( window_size / 2, 1 );
int shrink = VIPS_MAX( 1,
floor( factor2 ) / VIPS_MAX( 1, window_size / 2 ) );
if( residual &&
direction == VIPS_DIRECTION_HORIZONTAL ) {