Skip to content

format overrides file extension when saving#144

Merged
hugovk merged 3 commits intohugovk:lazyfrom
radarhere:lazy
Jan 24, 2026
Merged

format overrides file extension when saving#144
hugovk merged 3 commits intohugovk:lazyfrom
radarhere:lazy

Conversation

@radarhere
Copy link
Copy Markdown

@radarhere radarhere commented Jan 22, 2026

Suggestions for python-pillow#9398

  • Rearrange code
  • Rename _load_plugin_for_extension() to _import_plugin_for_extension(). It might be better to call this 'lazy importing', rather than 'lazy loading', as one might refer to the fact that we don't load() images on open() as 'lazy loading'
  • format overrides file extension in save(). If format is specified, then we don't need to import based on the extension
  • Added logger messages when importing based on extension, to match init()

@hugovk
Copy link
Copy Markdown
Owner

hugovk commented Jan 23, 2026

  • Rearrange code

32b370b

Let's avoid building that tuple, sometimes it's not needed, and the original set comparison is likely a bit faster in some cases.

@radarhere
Copy link
Copy Markdown
Author

Ok, I've removed that commit.

@hugovk hugovk merged commit 3968886 into hugovk:lazy Jan 24, 2026
54 of 55 checks passed
@hugovk
Copy link
Copy Markdown
Owner

hugovk commented Jan 24, 2026

Thank you!

@radarhere radarhere deleted the lazy branch January 24, 2026 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants