From 84e275d90629bfdf508f81a1142eddd5d5ea46e4 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 18 Sep 2024 20:27:35 +1000 Subject: [PATCH] Loading does not change mode --- src/PIL/ImageFile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 721319fd7..d69d84568 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -322,7 +322,7 @@ class ImageFile(Image.Image): def load_prepare(self) -> None: # create image memory if necessary - if self._im is None or self.im.mode != self.mode: + if self._im is None: self.im = Image.core.new(self.mode, self.size) # create palette (optional) if self.mode == "P":