fix test suite

This commit is contained in:
John Cupitt 2015-11-11 15:00:15 +00:00
parent 4c51f5b36d
commit f32ab06a1c
2 changed files with 11 additions and 4 deletions

4
TODO
View File

@ -3,6 +3,10 @@
yes, what about the case where float mask sums to zero, we'll /0 when scaling
the output mask
not sure the fix is right, think again
maybe look at change in sum? add difference to scale?
- looks like we have a race in tiled threadcache? see
https://github.com/jcupitt/libvips/issues/347

View File

@ -233,12 +233,15 @@ im_vips2imask( IMAGE *in, const char *filename )
int_ratio += out->coeff[x + width * y];
int_ratio /= out->scale;
/* And adjust the scale to get as close to a match as we can.
/* And adjust the scale to get as close to a match as we can. This
* won't work for masks which sum to zero, obviously :-(
*/
if( double_ratio != 0.0 ) {
out->scale = VIPS_RINT( out->scale * int_ratio / double_ratio );
if( out->scale == 0 ) {
out->scale = 1;
}
}
/* We should probably do the same for offset, somehow.
*/