mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Expose registered file extensions
This adds a new method in Image (registered_extensions) that exposes the internal EXTENSION dictionary to consumers of the library
This commit is contained in:
parent
9dddca0be2
commit
67c1258cfc
10
PIL/Image.py
10
PIL/Image.py
|
@ -2512,6 +2512,16 @@ def register_extension(id, extension):
|
|||
EXTENSION[extension.lower()] = id.upper()
|
||||
|
||||
|
||||
def registered_extensions():
|
||||
"""
|
||||
Returns a dictionary containing all file extensions belonging
|
||||
to registered plugins
|
||||
"""
|
||||
if not bool(EXTENSION):
|
||||
init()
|
||||
return EXTENSION
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# Simple display support. User code may override this.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user