Skip to content

Commit

Permalink
Merge pull request #5037 from radarhere/formats
Browse files Browse the repository at this point in the history
init() if one of the formats is unrecognised
  • Loading branch information
hugovk committed Nov 11, 2020
2 parents 2d6e51e + 7e2015c commit 0bb6a19
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 0bb6a19

Please sign in to comment.