remove repack code from affine

just done in compat wrapper now
This commit is contained in:
John Cupitt 2013-11-29 23:20:32 +00:00
parent 223cb02305
commit 29eed7b2b5
3 changed files with 19 additions and 26 deletions

4
TODO
View File

@ -1,7 +1,3 @@
- some vips8 operators repack labq after processing ... new policy: accept any
format and never repack
- seen some leaks from
vips dzsave --layout google wtc.jpg x

View File

@ -4241,14 +4241,22 @@ static int
im__affinei( VipsImage *in, VipsImage *out,
VipsInterpolate *interpolate, VipsTransformation *trn )
{
VipsImage *x;
VipsImage **t = (VipsImage **)
vips_object_local_array( VIPS_OBJECT( out ), 2 );
VipsArea *oarea;
gboolean repack;
oarea = (VipsArea *) vips_array_int_newv( 4,
trn->oarea.left, trn->oarea.top,
trn->oarea.width, trn->oarea.height );
if( vips_affine( in, &x,
/* vips7 affine would repack labq and im_benchmark() depends upon
* this.
*/
repack = in->Coding == IM_CODING_LABQ;
if( vips_affine( in, &t[0],
trn->a, trn->b, trn->c, trn->d,
"interpolate", interpolate,
"oarea", oarea,
@ -4258,15 +4266,18 @@ im__affinei( VipsImage *in, VipsImage *out,
vips_area_unref( oarea );
return( -1 );
}
vips_area_unref( oarea );
in = t[0];
if( im_copy( x, out ) ) {
g_object_unref( x );
return( -1 );
if( repack ) {
if( vips_colourspace( in, &t[1],
VIPS_INTERPRETATION_LABQ, NULL ) )
return( -1 );
in = t[1];
}
g_object_unref( x );
if( vips_image_write( in, out ) )
return( -1 );
return( 0 );
}

View File

@ -384,7 +384,6 @@ vips_affine_build( VipsObject *object )
vips_object_local_array( object, 4 );
VipsImage *in;
gboolean repack;
VipsDemandStyle hint;
int window_size;
int window_offset;
@ -464,13 +463,11 @@ vips_affine_build( VipsObject *object )
return( -1 );
}
/* Unpack labq for processing ... we repack after, see below.
/* Unpack labq for processing.
*/
repack = FALSE;
if( in->Coding == VIPS_CODING_LABQ ) {
if( vips_LabQ2LabS( in, &t[0], NULL ) )
return( -1 );
repack = TRUE;
in = t[0];
}
@ -505,17 +502,6 @@ vips_affine_build( VipsObject *object )
in, affine ) )
return( -1 );
if( repack ) {
VipsImage *x;
if( vips_LabS2LabQ( resample->out, &x, NULL ) )
return( -1 );
VIPS_UNREF( resample->out );
resample->out = x;
}
/* Finally: can now set Xoffset/Yoffset.
*/
resample->out->Xoffset = affine->trn.odx - affine->trn.oarea.left;