Skip to content

Commit c036185

Browse files
hugovkradarhere
andauthored
Ensure lower before checking if ext in EXTENSION
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1 parent 34814d8 commit c036185

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/PIL/Image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@ def _import_plugin_for_extension(ext: str | bytes) -> bool:
406406
"""Import only the plugin needed for a specific file extension."""
407407
if isinstance(ext, bytes):
408408
ext = ext.decode()
409+
ext = ext.lower()
409410
if ext in EXTENSION:
410411
return True
411412

412-
plugin = _EXTENSION_PLUGIN.get(ext.lower())
413+
plugin = _EXTENSION_PLUGIN.get(ext)
413414
if plugin is None:
414415
return False
415416

0 commit comments

Comments
 (0)