mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-25 00:34:14 +03:00
Merge pull request #5037 from radarhere/formats
init() if one of the formats is unrecognised
This commit is contained in:
commit
0bb6a19cbf
|
@ -2905,6 +2905,8 @@ def open(fp, mode="r", formats=None):
|
|||
|
||||
def _open_core(fp, filename, prefix, formats):
|
||||
for i in formats:
|
||||
if i not in OPEN:
|
||||
init()
|
||||
try:
|
||||
factory, accept = OPEN[i]
|
||||
result = not accept or accept(prefix)
|
||||
|
|
Loading…
Reference in New Issue
Block a user