This commit is contained in:
orlnub123 2020-02-09 00:19:53 +00:00 committed by Andrew Murray
parent 2e716de63d
commit 64c08f4dba

View File

@ -34,14 +34,14 @@ def test_aspect():
im.thumbnail((100, 100))
assert im.size == (100, 50)
im = Image.new("L", (256, 128))
im.thumbnail((100, 50))
assert im.size == (100, 50)
im = Image.new("L", (64, 64))
im.thumbnail((100, 100))
assert im.size == (64, 64)
im = Image.new("L", (128, 128))
im.thumbnail((100, 100))
assert im.size == (100, 100)
im = Image.new("L", (256, 162)) # ratio is 1.5802469136
im.thumbnail((33, 33))
assert im.size == (33, 21) # ratio is 1.5714285714
@ -52,7 +52,7 @@ def test_aspect():
im = Image.new("L", (145, 100)) # ratio is 1.45
im.thumbnail((50, 50))
assert im.size ==(50, 34) # ratio is 1.47058823529
assert im.size == (50, 34) # ratio is 1.47058823529
im = Image.new("L", (100, 145)) # ratio is 0.689655172414
im.thumbnail((50, 50))
@ -62,7 +62,7 @@ def test_aspect():
def test_float():
im = Image.new("L", (128, 128))
im.thumbnail((99.9, 99.9))
assert im.size == (100, 100)
assert im.size == (99, 99)
def test_no_resize():