From 62baf977fb542220c4c53cb3e24f0ce557c703a7 Mon Sep 17 00:00:00 2001 From: aagaidiu Date: Fri, 25 Nov 2016 15:56:24 -0800 Subject: [PATCH] EMF/WMF comparison: use assert_image_similar() --- Tests/test_file_wmf.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Tests/test_file_wmf.py b/Tests/test_file_wmf.py index bdfca80de..2b075c26f 100644 --- a/Tests/test_file_wmf.py +++ b/Tests/test_file_wmf.py @@ -5,17 +5,6 @@ from io import BytesIO class TestFileWmf(PillowTestCase): - def as_png(self, im): - # Pass the image through PNG save/load - out = BytesIO() - im.save(out, "PNG") - test_bytes = out.tell() - out.seek(0) - im = Image.open(out) - im.bytes = test_bytes # for testing only - im.load() - return im - def test_load_raw(self): # Test basic EMF open and rendering @@ -26,7 +15,7 @@ class TestFileWmf(PillowTestCase): # Compare to reference rendering imref = Image.open('Tests/images/drawing_emf_ref.png') imref.load() - self.assert_image_equal(self.as_png(im), imref) + self.assert_image_similar(im, imref, 0) # Test basic WMF open and rendering im = Image.open('Tests/images/drawing.wmf') @@ -36,7 +25,7 @@ class TestFileWmf(PillowTestCase): # Compare to reference rendering imref = Image.open('Tests/images/drawing_wmf_ref.png') imref.load() - self.assert_image_equal(self.as_png(im), imref) + self.assert_image_similar(im, imref, 0) if __name__ == '__main__':