Skip to content

Commit

Permalink
🐍 (Plugin): Add is_animated field to image even if animation has not …
Browse files Browse the repository at this point in the history
…supported (#72)
  • Loading branch information
Isotr0py authored Oct 7, 2024
1 parent 95542a1 commit b228d51
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pillow_jxl/JpegXLImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down
2 changes: 2 additions & 0 deletions test/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down

0 comments on commit b228d51

Please sign in to comment.