From 7546e1fb178118bf638e2186b94701d4db6ffb4c Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 30 Sep 2013 22:32:50 -0700 Subject: [PATCH] Py3. sigh --- Tests/test_image_transform.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index 3a9a3f51f..56a0d9d71 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -7,7 +7,7 @@ def test_extent(): (w,h) = im.size transformed = im.transform(im.size, Image.EXTENT, (0,0, - w/2,h/2), # ul -> lr + w//2,h//2), # ul -> lr Image.BILINEAR) @@ -20,8 +20,8 @@ def test_quad(): im = lena('RGB') (w,h) = im.size transformed = im.transform(im.size, Image.QUAD, - (0,0,0,h/2, - w/2,h/2,w/2,0), # ul -> ccw around quad + (0,0,0,h//2, + w//2,h//2,w//2,0), # ul -> ccw around quad Image.BILINEAR) scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h)) @@ -33,29 +33,29 @@ def test_mesh(): im = lena('RGBA') (w,h) = im.size transformed = im.transform(im.size, Image.MESH, - [((0,0,w/2,h/2), # box + [((0,0,w//2,h//2), # box (0,0,0,h, w,h,w,0)), # ul -> ccw around quad - ((w/2,h/2,w,h), # box + ((w//2,h//2,w,h), # box (0,0,0,h, 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.resize((w//2, h//2), Image.BILINEAR) checker = Image.new('RGBA', im.size) checker.paste(scaled, (0,0)) - checker.paste(scaled, (w/2,h/2)) + checker.paste(scaled, (w//2,h//2)) assert_image_equal(transformed, checker) # now, check to see that the extra area is (0,0,0,0) - blank = Image.new('RGBA', (w/2,h/2), (0,0,0,0)) + blank = Image.new('RGBA', (w//2,h//2), (0,0,0,0)) - assert_image_equal(blank, transformed.crop((w/2,0,w,h/2))) - assert_image_equal(blank, transformed.crop((0,h/2,w/2,h))) + assert_image_equal(blank, transformed.crop((w//2,0,w,h//2))) + assert_image_equal(blank, transformed.crop((0,h//2,w//2,h))) def test_blank_fill():