modify the test image

This commit is contained in:
Alexander 2019-12-17 02:25:40 +03:00
parent a027897f74
commit b35cbef234

View File

@ -57,10 +57,11 @@ class TestImageThumbnail(PillowTestCase):
def test_DCT_scaling_edges(self):
# Make an image with red borders and size (N * 8) + 1 to cross DCT grid
im = Image.new("RGB", (257, 257), "red")
im.paste(Image.new("RGB", (255, 255)), (1, 1))
im.paste(Image.new("RGB", (235, 235)), (11, 11))
thumb = fromstring(tostring(im, "JPEG", quality=99, subsampling=0))
thumb.thumbnail((32, 32), Image.BICUBIC)
ref = im.resize((32, 32), Image.BICUBIC)
self.assert_image_similar(thumb, ref, 2)
# This is still JPEG, some error is present. Without the fix it is 11.5
self.assert_image_similar(thumb, ref, 1.5)