mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-01-28 11:05:49 +03:00
If plugin has already been imported and registered the extension, return early
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
7f38f980dd
commit
096c479cfb
|
|
@ -406,6 +406,9 @@ def _load_plugin_for_extension(ext: str | bytes) -> bool:
|
|||
"""Load only the plugin needed for a specific file extension."""
|
||||
if isinstance(ext, bytes):
|
||||
ext = ext.decode()
|
||||
if ext in EXTENSION:
|
||||
return True
|
||||
|
||||
plugin = _EXTENSION_PLUGIN.get(ext.lower())
|
||||
if plugin is None:
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user