From 2241f744d99302681cbf9aed67136a38d9e28eed Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 30 Sep 2013 21:57:19 -0700 Subject: [PATCH] extents test --- Tests/test_image_transform.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index 73d98e721..0de86dc16 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -2,6 +2,19 @@ from tester import * from PIL import Image +def test_extent(): + im = lena('RGB') + (w,h) = im.size + transformed = im.transform(im.size, Image.EXTENT, + (0,0, + w/2,h/2), # ul -> lr + Image.BILINEAR) + + + scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h)) + + assert_image_similar(transformed, scaled, 10) # undone -- precision? + def test_quad(): # one simple quad transform, equivalent to scale & crop upper left quad im = lena('RGB')