Skip to content

Commit

Permalink
init() if one of the formats is unrecognised
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Nov 11, 2020
1 parent 2d6e51e commit 7e2015c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/PIL/Image.py
Expand Up @@ -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)
Expand Down

0 comments on commit 7e2015c

Please sign in to comment.