Skip to content

Only load image in ImageFile load_prepare() if palette is dirty - #10238

Open
radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:load_prepare
Open

radarhere wants to merge 1 commit into
python-pillow:mainfrom
radarhere:load_prepare

Conversation

@radarhere

Copy link
Copy Markdown
Member

Change

Pillow/src/PIL/ImageFile.py

Lines 452 to 454 in 3f6d442

# create palette (optional)
if self.mode == "P":
Image.Image.load(self)

to only run if the palette is present and dirty, since that is what is needed to update the palette.
if self._im is not None and self.palette and self.palette.dirty:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant