mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-15 23:01:59 +03:00
Merge branch 'main' into context_manager
This commit is contained in:
commit
55fe987a62
|
@ -388,7 +388,6 @@ def test_apng_save(tmp_path: Path) -> None:
|
|||
|
||||
with Image.open(test_file) as im:
|
||||
assert isinstance(im, PngImagePlugin.PngImageFile)
|
||||
|
||||
im.load()
|
||||
assert not im.is_animated
|
||||
assert im.n_frames == 1
|
||||
|
@ -405,7 +404,6 @@ def test_apng_save(tmp_path: Path) -> None:
|
|||
|
||||
with Image.open(test_file) as im:
|
||||
assert isinstance(im, PngImagePlugin.PngImageFile)
|
||||
|
||||
im.load()
|
||||
assert im.is_animated
|
||||
assert im.n_frames == 2
|
||||
|
|
|
@ -729,10 +729,10 @@ class TestFileJpeg:
|
|||
|
||||
@pytest.mark.skipif(not djpeg_available(), reason="djpeg not available")
|
||||
def test_load_djpeg(self) -> None:
|
||||
with Image.open(TEST_FILE) as im:
|
||||
assert isinstance(im, JpegImagePlugin.JpegImageFile)
|
||||
im.load_djpeg()
|
||||
assert_image_similar_tofile(im, TEST_FILE, 5)
|
||||
with Image.open(TEST_FILE) as img:
|
||||
assert isinstance(img, JpegImagePlugin.JpegImageFile)
|
||||
img.load_djpeg()
|
||||
assert_image_similar_tofile(img, TEST_FILE, 5)
|
||||
|
||||
@pytest.mark.skipif(not cjpeg_available(), reason="cjpeg not available")
|
||||
def test_save_cjpeg(self, tmp_path: Path) -> None:
|
||||
|
|
|
@ -814,7 +814,6 @@ class TestFileLibTiff(LibTiffTestCase):
|
|||
def test_multipage_compression(self) -> None:
|
||||
with Image.open("Tests/images/compression.tif") as im:
|
||||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
|
||||
im.seek(0)
|
||||
assert im._compression == "tiff_ccitt"
|
||||
assert im.size == (10, 10)
|
||||
|
|
|
@ -121,6 +121,7 @@ class TestFileTiff:
|
|||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
|
||||
outfile = tmp_path / "temp.tif"
|
||||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
im.save(outfile, save_all=True, append_images=[im], tiffinfo=im.tag_v2)
|
||||
|
||||
def test_bigtiff_save(self, tmp_path: Path) -> None:
|
||||
|
@ -393,6 +394,8 @@ class TestFileTiff:
|
|||
def test___str__(self) -> None:
|
||||
filename = "Tests/images/pil136.tiff"
|
||||
with Image.open(filename) as im:
|
||||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
|
||||
# Act
|
||||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
ret = str(im.ifd)
|
||||
|
|
|
@ -132,7 +132,6 @@ def test_write_metadata(tmp_path: Path) -> None:
|
|||
"""Test metadata writing through the python code"""
|
||||
with Image.open("Tests/images/hopper.tif") as img:
|
||||
assert isinstance(img, TiffImagePlugin.TiffImageFile)
|
||||
|
||||
f = tmp_path / "temp.tiff"
|
||||
del img.tag[278]
|
||||
img.save(f, tiffinfo=img.tag)
|
||||
|
|
|
@ -32,7 +32,6 @@ def test_sanity(tmp_path: Path) -> None:
|
|||
def test_iterator() -> None:
|
||||
with Image.open("Tests/images/multipage.tiff") as im:
|
||||
assert isinstance(im, TiffImagePlugin.TiffImageFile)
|
||||
|
||||
i = ImageSequence.Iterator(im)
|
||||
for index in range(im.n_frames):
|
||||
assert i[index] == next(i)
|
||||
|
@ -45,7 +44,6 @@ def test_iterator() -> None:
|
|||
def test_iterator_min_frame() -> None:
|
||||
with Image.open("Tests/images/hopper.psd") as im:
|
||||
assert isinstance(im, PsdImagePlugin.PsdImageFile)
|
||||
|
||||
i = ImageSequence.Iterator(im)
|
||||
for index in range(1, im.n_frames):
|
||||
assert i[index] == next(i)
|
||||
|
|
Loading…
Reference in New Issue
Block a user