From 7e2015c75f35b07e8a050d9fbb4d8db0a472fedb Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 11 Nov 2020 21:05:57 +1100 Subject: [PATCH] init() if one of the formats is unrecognised --- src/PIL/Image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index f9a5d82fdc4..8d3f6b0aa27 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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)