From c3c84d6148fb7bc47d09e8d6fdd3a966882c7568 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 13 Nov 2024 21:30:58 +1100 Subject: [PATCH] Set tile args to None --- src/PIL/AvifImagePlugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PIL/AvifImagePlugin.py b/src/PIL/AvifImagePlugin.py index 19143b33015..580763850fc 100644 --- a/src/PIL/AvifImagePlugin.py +++ b/src/PIL/AvifImagePlugin.py @@ -114,7 +114,7 @@ def load(self) -> Image.core.PixelAccess | None: if self.fp and self._exclusive_fp: self.fp.close() self.fp = BytesIO(data) - self.tile = [ImageFile._Tile("raw", (0, 0) + self.size, 0, self.mode)] + self.tile = [ImageFile._Tile("raw", (0, 0) + self.size, 0, None)] return super().load() @@ -172,7 +172,7 @@ def _save( advanced = info.get("advanced") if isinstance(advanced, dict): advanced = tuple([k, v] for (k, v) in advanced.items()) - if advanced is not None: + elif advanced is not None: try: advanced = tuple(advanced) except TypeError: @@ -186,7 +186,7 @@ def _save( ) raise ValueError(msg) advanced = tuple( - [(str(k).encode("utf-8"), str(v).encode("utf-8")) for k, v in advanced] + (str(k).encode("utf-8"), str(v).encode("utf-8")) for k, v in advanced ) # Setup the AVIF encoder