use ROI in precompute_coeffs

This commit is contained in:
homm 2016-11-24 06:11:36 +03:00
parent a1fedc0f8a
commit ef787bc3f5
2 changed files with 4 additions and 2 deletions

View File

@ -397,6 +397,8 @@ class CoreResampleRoiTest(PillowTestCase):
tile2 = im.resize(big_size, resample)\
.crop(o + (o[0] + size[0], o[1] + size[1]))
self.assert_image_equal(tile1, tile2)
if __name__ == '__main__':
unittest.main()

View File

@ -134,7 +134,7 @@ precompute_coeffs(int inSize, int in0, int in1, int outSize,
double *kk, *k;
/* prepare for horizontal stretch */
filterscale = scale = (double) inSize / outSize;
filterscale = scale = (double) (in1 - in0) / outSize;
if (filterscale < 1.0) {
filterscale = 1.0;
}
@ -163,7 +163,7 @@ precompute_coeffs(int inSize, int in0, int in1, int outSize,
}
for (xx = 0; xx < outSize; xx++) {
center = (xx + 0.5) * scale;
center = in0 + (xx + 0.5) * scale;
ww = 0.0;
ss = 1.0 / filterscale;
xmin = (int) floor(center - support);