From 5e897341c6c5c1f0fdb8d95ca7e3643dc7e89d77 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 30 Sep 2013 21:21:53 -0700 Subject: [PATCH] Added mesh transform test --- Tests/test_image_transform.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Tests/test_image_transform.py b/Tests/test_image_transform.py index 7d4b6d9b3..73d98e721 100644 --- a/Tests/test_image_transform.py +++ b/Tests/test_image_transform.py @@ -2,4 +2,15 @@ from tester import * from PIL import Image -success() +def test_quad(): + # one simple quad transform, equivalent to scale & crop upper left 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 + Image.BILINEAR) + + scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h)) + + assert_image_equal(transformed, scaled, 10)