mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-16 18:24:45 +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
9fb00976fc
commit
b44c5adb5d
10
PIL/Image.py
10
PIL/Image.py
|
@ -2478,6 +2478,16 @@ def register_extension(id, extension):
|
||||||
EXTENSION[extension.lower()] = id.upper()
|
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.
|
# Simple display support. User code may override this.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user