Upsample integral nearest neighour with zoom for accuracy.
This mirrors logic from sharp, allowing it to migrate to resize. See https://github.com/lovell/sharp/issues/752
This commit is contained in:
parent
808a54d23e
commit
ea6d496484
@ -238,7 +238,17 @@ vips_resize_build( VipsObject *object )
|
||||
return( -1 );
|
||||
vips_object_local( object, interpolate );
|
||||
|
||||
if( hscale > 1.0 &&
|
||||
if( resize->kernel == VIPS_KERNEL_NEAREST &&
|
||||
hscale == VIPS_FLOOR( hscale ) &&
|
||||
vscale == VIPS_FLOOR( vscale ) ) {
|
||||
/* Fast, integral nearest neighbour enlargement
|
||||
*/
|
||||
if( vips_zoom( in, &t[4], VIPS_FLOOR( hscale ),
|
||||
VIPS_FLOOR( vscale ), NULL ) )
|
||||
return( -1 );
|
||||
in = t[4];
|
||||
}
|
||||
else if( hscale > 1.0 &&
|
||||
vscale > 1.0 ) {
|
||||
g_info( "residual scale %g x %g", hscale, vscale );
|
||||
if( vips_affine( in, &t[4],
|
||||
|
Loading…
Reference in New Issue
Block a user