fix up affine

now passes valgrind with both vips7 and vips8 interfaces
This commit is contained in:
John Cupitt 2013-01-02 12:52:36 +00:00
parent fbfaac319a
commit 05324ca33c
6 changed files with 18 additions and 20 deletions

12
TODO
View File

@ -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

View File

@ -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;

View File

@ -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.
*/

View File

@ -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 ) ||

View File

@ -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 );
}

View File

@ -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.