diff --git a/TODO b/TODO index bc95041c..637e10f0 100644 --- a/TODO +++ b/TODO @@ -1,15 +1,3 @@ -- im_benchmarkn segvs, im_affine wraopper is dropping a reference too early? - - try - - $ vips colourspace k2.jpg x.v - $ vips affine x.v x2.v "1 0 0 1.1" - Segmentation fault (core dumped) - - oo labq problem? - - - - quadratic doesn't work for order 3 start to get jaggies on lines --- the 3rd differential isn't being diff --git a/libvips/deprecated/vips7compat.c b/libvips/deprecated/vips7compat.c index f490a0bf..ae783e84 100644 --- a/libvips/deprecated/vips7compat.c +++ b/libvips/deprecated/vips7compat.c @@ -2941,6 +2941,8 @@ im_affinei( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, trn.b = b; trn.c = c; trn.d = d; + trn.idx = 0; + trn.idy = 0; trn.odx = odx; trn.ody = ody; @@ -2961,6 +2963,8 @@ im_affinei_all( VipsImage *in, VipsImage *out, VipsInterpolate *interpolate, trn.b = b; trn.c = c; trn.d = d; + trn.idx = 0; + trn.idy = 0; trn.odx = odx; trn.ody = ody; diff --git a/libvips/resample/affine.c b/libvips/resample/affine.c index b55af651..b6ab7b40 100644 --- a/libvips/resample/affine.c +++ b/libvips/resample/affine.c @@ -443,11 +443,10 @@ vips_affine_build( VipsObject *object ) if( vips__transform_calc_inverse( &affine->trn ) ) return( -1 ); + /* if( vips__transform_isidentity( &affine->trn ) ) return( vips_image_write( in, resample->out ) ); - - resample->out->Xsize = affine->trn.oarea.width; - resample->out->Ysize = affine->trn.oarea.height; + */ /* Check for coordinate overflow ... we want to be able to hold the * output space inside INT_MAX / TRANSFORM_SCALE. @@ -481,6 +480,12 @@ vips_affine_build( VipsObject *object ) return( -1 ); in = t[1]; + if( vips_image_copy_fields( resample->out, in ) ) + return( -1 ); + + resample->out->Xsize = affine->trn.oarea.width; + resample->out->Ysize = affine->trn.oarea.height; + /* Normally SMALLTILE ... except if this is a size up/down affine. */ if( affine->trn.b == 0.0 && @@ -498,7 +503,6 @@ vips_affine_build( VipsObject *object ) in, affine ) ) return( -1 ); - /* if( repack ) { VipsImage *x; @@ -509,7 +513,6 @@ vips_affine_build( VipsObject *object ) resample->out = x; } - */ /* Finally: can now set Xoffset/Yoffset. */ diff --git a/libvips/resample/quadratic.c b/libvips/resample/quadratic.c index 8b7b7f8b..75149224 100644 --- a/libvips/resample/quadratic.c +++ b/libvips/resample/quadratic.c @@ -240,6 +240,9 @@ vips_quadratic_build( VipsObject *object ) if( VIPS_OBJECT_CLASS( vips_quadratic_parent_class )->build( object ) ) return( -1 ); + if( vips_image_copy_fields( resample->out, resample->in ) ) + return( -1 ); + in = resample->in; if( vips_check_uncoded( class->nickname, in ) || diff --git a/libvips/resample/resample.c b/libvips/resample/resample.c index 7503bf81..39471e5a 100644 --- a/libvips/resample/resample.c +++ b/libvips/resample/resample.c @@ -69,9 +69,6 @@ vips_resample_build( VipsObject *object ) if( VIPS_OBJECT_CLASS( vips_resample_parent_class )->build( object ) ) return( -1 ); - if( vips_image_copy_fields( resample->out, resample->in ) ) - return( -1 ); - return( 0 ); } diff --git a/libvips/resample/shrink.c b/libvips/resample/shrink.c index 1882d04e..c20c7149 100644 --- a/libvips/resample/shrink.c +++ b/libvips/resample/shrink.c @@ -327,6 +327,9 @@ vips_shrink_build( VipsObject *object ) shrink->yshrink == 1.0 ) return( vips_image_write( resample->in, resample->out ) ); + if( vips_image_copy_fields( resample->out, resample->in ) ) + return( -1 ); + /* THINSTRIP will work, FATSTRIP will break seq mode. If you combine * shrink with conv you'll need to use a line cache to maintain * sequentiality.