mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-01-28 11:05:49 +03:00
Ensure lower before checking if ext in EXTENSION
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
34814d8d2f
commit
c036185514
|
|
@ -406,10 +406,11 @@ def _import_plugin_for_extension(ext: str | bytes) -> bool:
|
|||
"""Import only the plugin needed for a specific file extension."""
|
||||
if isinstance(ext, bytes):
|
||||
ext = ext.decode()
|
||||
ext = ext.lower()
|
||||
if ext in EXTENSION:
|
||||
return True
|
||||
|
||||
plugin = _EXTENSION_PLUGIN.get(ext.lower())
|
||||
plugin = _EXTENSION_PLUGIN.get(ext)
|
||||
if plugin is None:
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user