From b228d5135caaeb1fda4b4278062bc10507c33ce1 Mon Sep 17 00:00:00 2001 From: Isotr0py Date: Mon, 7 Oct 2024 11:38:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8D=20(Plugin):=20Add=20is=5Fanimated?= =?UTF-8?q?=20field=20to=20image=20even=20if=20animation=20has=20not=20sup?= =?UTF-8?q?ported=20(#72)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pillow_jxl/JpegXLImagePlugin.py | 3 +++ test/test_plugin.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pillow_jxl/JpegXLImagePlugin.py b/pillow_jxl/JpegXLImagePlugin.py index a07aa41..158738c 100644 --- a/pillow_jxl/JpegXLImagePlugin.py +++ b/pillow_jxl/JpegXLImagePlugin.py @@ -41,6 +41,9 @@ def _open(self): self._mode = self.rawmode else: self.mode = self.rawmode + # FIXME (Isotr0py): animation JXL hasn't supported yet + self.is_animated = False + self.n_frames = 1 self.tile = [] diff --git a/test/test_plugin.py b/test/test_plugin.py index 034881c..a94db8a 100644 --- a/test/test_plugin.py +++ b/test/test_plugin.py @@ -11,6 +11,8 @@ def test_decode(): assert img.size == (40, 50) assert img.mode == "RGBA" + assert not img.is_animated + assert img.n_frames == 1 @pytest.mark.parametrize("image", ["test/images/sample.png", "test/images/sample.jpg"])