Updated image comparison

This commit is contained in:
Andrew Murray 2021-10-19 16:08:23 +11:00
parent cb5c8f6f86
commit e6ffeac66f
5 changed files with 3 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -155,7 +155,6 @@ class TestImageFont:
draw.text((10, 10), txt, font=ttf) draw.text((10, 10), txt, font=ttf)
draw.rectangle((10, 10, 10 + size[0], 10 + size[1])) draw.rectangle((10, 10, 10 + size[0], 10 + size[1]))
# Epsilon ~.5 fails with FreeType 2.7
assert_image_similar_tofile( assert_image_similar_tofile(
im, "Tests/images/rectangle_surrounding_text.png", 2.5 im, "Tests/images/rectangle_surrounding_text.png", 2.5
) )
@ -216,8 +215,7 @@ class TestImageFont:
draw = ImageDraw.Draw(im) draw = ImageDraw.Draw(im)
draw.text((0, 0), TEST_TEXT, font=ttf) draw.text((0, 0), TEST_TEXT, font=ttf)
# Epsilon ~.5 fails with FreeType 2.7 assert_image_similar_tofile(im, "Tests/images/multiline_text.png", 0.01)
assert_image_similar_tofile(im, "Tests/images/multiline_text.png", 6.2)
# Test that text() can pass on additional arguments # Test that text() can pass on additional arguments
# to multiline_text() # to multiline_text()
@ -232,9 +230,8 @@ class TestImageFont:
draw = ImageDraw.Draw(im) draw = ImageDraw.Draw(im)
draw.multiline_text((0, 0), TEST_TEXT, font=ttf, align=align) draw.multiline_text((0, 0), TEST_TEXT, font=ttf, align=align)
# Epsilon ~.5 fails with FreeType 2.7
assert_image_similar_tofile( assert_image_similar_tofile(
im, "Tests/images/multiline_text" + ext + ".png", 6.2 im, "Tests/images/multiline_text" + ext + ".png", 0.01
) )
def test_unknown_align(self): def test_unknown_align(self):
@ -289,8 +286,7 @@ class TestImageFont:
draw = ImageDraw.Draw(im) draw = ImageDraw.Draw(im)
draw.multiline_text((0, 0), TEST_TEXT, font=ttf, spacing=10) draw.multiline_text((0, 0), TEST_TEXT, font=ttf, spacing=10)
# Epsilon ~.5 fails with FreeType 2.7 assert_image_similar_tofile(im, "Tests/images/multiline_text_spacing.png", 2.5)
assert_image_similar_tofile(im, "Tests/images/multiline_text_spacing.png", 6.2)
def test_rotated_transposed_font(self): def test_rotated_transposed_font(self):
img_grey = Image.new("L", (100, 100)) img_grey = Image.new("L", (100, 100))