Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reload Image.core the same way as in TiffImagePlugin(PIL 11+) #294

Merged
merged 2 commits into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pillow_heif/as_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def seek(self, frame: int):
return
self.__frame = frame
self._init_from_heif_file(frame)

if pil_version[:3] != "10.":
# Pillow 11.0+
Comment on lines +96 to +97
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also trigger for Pillow 9.0 and earlier.

# We need to create a new core image object on second and
# subsequent frames in the image. Image may be different size/mode.
# https://github.com/python-pillow/Pillow/issues/8439
self.im = Image.core.new(self._mode, self._size) # pylint: disable=too-many-function-args

_exif = getattr(self, "_exif", None) # Pillow 9.2+ do no reload exif between frames.
if _exif is not None and getattr(_exif, "_loaded", None):
_exif._loaded = False # pylint: disable=protected-access
Expand Down
Loading