Merge pull request #6190 from radarhere/load

This commit is contained in:
Hugo van Kemenade 2022-04-08 20:03:55 +03:00 committed by GitHub
commit ec9b0aba8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -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)

View File

@ -2024,6 +2024,7 @@ class Image:
size = tuple(size)
self.load()
if box is None:
box = (0, 0) + self.size
else: