Skip to content

Commit 9fd4450

Browse files
authored
Merge pull request #1 from radarhere/tom/bufferedio
Moved test
2 parents 82dfbc3 + 925db45 commit 9fd4450

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

Tests/test_file_libtiff.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,25 @@ def test_exif_transpose(self) -> None:
10981098

10991099
assert_image_similar(base_im, im, 0.7)
11001100

1101+
@pytest.mark.parametrize(
1102+
"test_file",
1103+
[
1104+
"Tests/images/old-style-jpeg-compression-no-samplesperpixel.tif",
1105+
"Tests/images/old-style-jpeg-compression.tif",
1106+
],
1107+
)
1108+
def test_buffering(self, test_file: str) -> None:
1109+
# load exif first
1110+
with Image.open(open(test_file, "rb", buffering=1048576)) as im:
1111+
exif = dict(im.getexif())
1112+
1113+
# load image before exif
1114+
with Image.open(open(test_file, "rb", buffering=1048576)) as im2:
1115+
im2.load()
1116+
exif_after_load = dict(im2.getexif())
1117+
1118+
assert exif == exif_after_load
1119+
11011120
@pytest.mark.valgrind_known_error(reason="Backtrace in Python Core")
11021121
def test_sampleformat_not_corrupted(self) -> None:
11031122
# Assert that a TIFF image with SampleFormat=UINT tag is not corrupted

Tests/test_libtiff_file_position.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)