diff --git a/ChangeLog b/ChangeLog index fd460dc9..0620a683 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,7 @@ - convolution functions support complex images - im_blend() can have any format condition image and it's converted to uchar - security fix for vips-7.23 wrapper script (thanks Jay) +- im_affine() has a larger safety margin 12/5/10 started 7.22.2 - the conditional image of ifthenelse can be any format, a (!=0) is added if diff --git a/TODO b/TODO index c7db4459..fa908e26 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,5 @@ + - maybe im_draw_smudge() is too slow :-( also, we had a sanity failure with it, argh diff --git a/libvips/resample/im_affine.c b/libvips/resample/im_affine.c index 9d8e17e7..3c5e4489 100644 --- a/libvips/resample/im_affine.c +++ b/libvips/resample/im_affine.c @@ -260,12 +260,11 @@ affinei_gen( REGION *or, void *seq, void *a, void *b ) /* That does round-to-nearest, because it has to stop rounding errors * growing images unexpectedly. We need round-down, so we must * add half a pixel along the left and top. But we are int :( so add 1 - * pixel. + * pixel. + * + * Add an extra line along the right and bottom as well, for rounding. */ - need.top -= 1; - need.left -= 1; - need.width += 1; - need.height += 1; + im_rect_marginadjust( &need, 1 ); /* Now go to space (2) above. */