Loading does not change mode

This commit is contained in:
Andrew Murray 2024-09-18 20:27:35 +10:00
parent f1e86965f6
commit 84e275d906

View File

@ -322,7 +322,7 @@ class ImageFile(Image.Image):
def load_prepare(self) -> None: def load_prepare(self) -> None:
# create image memory if necessary # 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) self.im = Image.core.new(self.mode, self.size)
# create palette (optional) # create palette (optional)
if self.mode == "P": if self.mode == "P":