mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06: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):
|
with pytest.raises(ValueError):
|
||||||
im.resize((10, 10), "unknown")
|
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):
|
def test_default_filter(self):
|
||||||
for mode in "L", "RGB", "I", "F":
|
for mode in "L", "RGB", "I", "F":
|
||||||
im = hopper(mode)
|
im = hopper(mode)
|
||||||
|
|
|
@ -2024,6 +2024,7 @@ class Image:
|
||||||
|
|
||||||
size = tuple(size)
|
size = tuple(size)
|
||||||
|
|
||||||
|
self.load()
|
||||||
if box is None:
|
if box is None:
|
||||||
box = (0, 0) + self.size
|
box = (0, 0) + self.size
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user