From 74dbebfd1ace891bd6367498b3251d5b435d9782 Mon Sep 17 00:00:00 2001 From: Mattijs Ugen <144798+akaIDIOT@users.noreply.github.com> Date: Fri, 18 Feb 2022 14:13:25 +0100 Subject: [PATCH] Call init() in _getencoder() --- src/PIL/Image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 4dccaebab..225dfe2b7 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -403,6 +403,9 @@ def _getdecoder(mode, decoder_name, args, extra=()): elif not isinstance(args, tuple): args = (args,) + if _initialized < 2: + init() + try: decoder = DECODERS[decoder_name] except KeyError: