[Image-SIG] PATCH: transform(EXTENT) doesn't work for negative x offsets

Fredrik Lundh fredrik@effbot.org
Wed, 28 Mar 2001 18:15:52 +0200


the transform(EXTENT) and transform(AFFINE) methods
can produce bogus results under certain circumstances.

for EXTENT, this can happen if you're using NEAREST
resampling, and x0 in the (x0, y0, x1, y1) bounding box
is negative.

I've attached a patch.

Cheers /F

--- libImaging\Geometry.c~      Thu Feb 08 22:10:57 2001
+++ libImaging\Geometry.c       Wed Mar 28 17:26:05 2001
@@ -595,7 +596,7 @@
        if (yi >= 0 && yi < imIn->ysize) {\
            in = imIn->image[yi];\
            for (x = xmin; x < xmax; x++)\
-               *out++ = in[xintab[x]];\
+               out[x] = in[xintab[x]];\
        }\
        yo += a[5];\
     }