Moved test

This commit is contained in:
Andrew Murray 2024-11-20 22:40:29 +11:00
parent cb1653f627
commit 925db45526
2 changed files with 19 additions and 25 deletions

View File

@ -1098,6 +1098,25 @@ class TestFileLibTiff(LibTiffTestCase):
assert_image_similar(base_im, im, 0.7)
@pytest.mark.parametrize(
"test_file",
[
"Tests/images/old-style-jpeg-compression-no-samplesperpixel.tif",
"Tests/images/old-style-jpeg-compression.tif",
],
)
def test_buffering(self, test_file: str) -> None:
# load exif first
with Image.open(open(test_file, "rb", buffering=1048576)) as im:
exif = dict(im.getexif())
# load image before exif
with Image.open(open(test_file, "rb", buffering=1048576)) as im2:
im2.load()
exif_after_load = dict(im2.getexif())
assert exif == exif_after_load
@pytest.mark.valgrind_known_error(reason="Backtrace in Python Core")
def test_sampleformat_not_corrupted(self) -> None:
# Assert that a TIFF image with SampleFormat=UINT tag is not corrupted

View File

@ -1,25 +0,0 @@
from __future__ import annotations
import pytest
from PIL import Image
@pytest.mark.parametrize(
"test_file",
[
"Tests/images/old-style-jpeg-compression-no-samplesperpixel.tif",
"Tests/images/old-style-jpeg-compression.tif",
],
)
def test_libtiff_exif_loading(test_file) -> None:
# loading image before exif
im1 = Image.open(open(test_file, "rb", buffering=1048576))
im1.load()
exif1 = dict(im1.getexif())
# loading exif before image
im2 = Image.open(open(test_file, "rb", buffering=1048576))
exif2 = dict(im2.getexif())
assert exif1 == exif2