mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-09-24 04:56:57 +03:00
Clear C image when MPO frame image size changes
This commit is contained in:
parent
abfdbdd6ce
commit
9ba1029d51
|
@ -108,9 +108,11 @@ def test_frame_size() -> None:
|
|||
# in the SOF marker of the second frame
|
||||
with Image.open("Tests/images/sugarshack_frame_size.mpo") as im:
|
||||
assert im.size == (640, 480)
|
||||
im.load()
|
||||
|
||||
im.seek(1)
|
||||
assert im.size == (680, 480)
|
||||
im.load()
|
||||
|
||||
im.seek(0)
|
||||
assert im.size == (640, 480)
|
||||
|
|
|
@ -193,6 +193,8 @@ def SOF(self: JpegImageFile, marker: int) -> None:
|
|||
n = i16(self.fp.read(2)) - 2
|
||||
s = ImageFile._safe_read(self.fp, n)
|
||||
self._size = i16(s, 3), i16(s, 1)
|
||||
if self._im is not None and self.size != self.im.size:
|
||||
self._im = None
|
||||
|
||||
self.bits = s[0]
|
||||
if self.bits != 8:
|
||||
|
|
Loading…
Reference in New Issue
Block a user