From aabf66a7a419ac10df71b600e37801c2cdb58ea7 Mon Sep 17 00:00:00 2001 From: homm Date: Mon, 10 Nov 2014 02:11:12 +0300 Subject: [PATCH] fix tests: use `im.transform` directly when result is compared with other transform operations. --- Tests/test_image_transform.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index c4111d0b6..4306e9b43 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -44,7 +44,9 @@ class TestImageTransform(PillowTestCase): w//2, h//2, w//2, 0), Image.BILINEAR) - scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0, 0, w, h)) + scaled = im.transform((w, h), Image.AFFINE, + (.5, 0, 0, 0, .5, 0), + Image.BILINEAR) self.assert_image_equal(transformed, scaled) @@ -61,9 +63,9 @@ class TestImageTransform(PillowTestCase): w, h, w, 0))], # ul -> ccw around quad Image.BILINEAR) - # transformed.save('transformed.png') - - scaled = im.resize((w//2, h//2), Image.BILINEAR) + scaled = im.transform((w//2, h//2), Image.AFFINE, + (2, 0, 0, 0, 2, 0), + Image.BILINEAR) checker = Image.new('RGBA', im.size) checker.paste(scaled, (0, 0)) @@ -128,7 +130,8 @@ class TestImageTransform(PillowTestCase): foo = [ Image.new('RGBA', (1024, 1024), (a, a, a, a)) - for a in range(1, 65)] + for a in range(1, 65) + ] # Yeah. Watch some JIT optimize this out. foo = None