Skip to content

Commit 90ba70d

Browse files
committed
Check image format
1 parent 5c5ed1d commit 90ba70d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Tests/test_file_jxl_animated.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from PIL import Image
5+
from PIL import GifImagePlugin, Image, JpegXlImagePlugin
66

77
from .helper import assert_image_equal, skip_unless_feature
88

@@ -13,10 +13,12 @@ def test_n_frames() -> None:
1313
"""Ensure that jxl format sets n_frames and is_animated attributes correctly."""
1414

1515
with Image.open("Tests/images/jxl/hopper.jxl") as im:
16+
assert isinstance(im, JpegXlImagePlugin.JpegXlImageFile)
1617
assert im.n_frames == 1
1718
assert not im.is_animated
1819

1920
with Image.open("Tests/images/jxl/iss634.jxl") as im:
21+
assert isinstance(im, JpegXlImagePlugin.JpegXlImageFile)
2022
assert im.n_frames == 41
2123
assert im.is_animated
2224

@@ -39,6 +41,8 @@ def test_seek() -> None:
3941

4042
with Image.open("Tests/images/jxl/traffic_light.jxl") as im1:
4143
with Image.open("Tests/images/jxl/traffic_light.gif") as im2:
44+
assert isinstance(im1, JpegXlImagePlugin.JpegXlImageFile)
45+
assert isinstance(im2, GifImagePlugin.GifImageFile)
4246
assert im1.n_frames == im2.n_frames
4347
assert im1.is_animated
4448

0 commit comments

Comments
 (0)