mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Load before getting size in resize()
This commit is contained in:
parent
4996f84fb3
commit
0b5cdba431
|
@ -264,6 +264,13 @@ class TestImageResize:
|
|||
with pytest.raises(ValueError):
|
||||
im.resize((10, 10), "unknown")
|
||||
|
||||
def test_load_first(self):
|
||||
# load() may change the size of the image
|
||||
# Test that resize() is calling it before getting the size
|
||||
with Image.open("Tests/images/g4_orientation_5.tif") as im:
|
||||
im = im.resize((64, 64))
|
||||
assert im.size == (64, 64)
|
||||
|
||||
def test_default_filter(self):
|
||||
for mode in "L", "RGB", "I", "F":
|
||||
im = hopper(mode)
|
||||
|
|
|
@ -2024,6 +2024,7 @@ class Image:
|
|||
|
||||
size = tuple(size)
|
||||
|
||||
self.load()
|
||||
if box is None:
|
||||
box = (0, 0) + self.size
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user