mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
EMF/WMF comparison: use assert_image_similar()
This commit is contained in:
parent
b06103acc7
commit
62baf977fb
|
@ -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__':
|
||||
|
|
Loading…
Reference in New Issue
Block a user