Skip to content

Commit 8501adc

Browse files
committed
Fix test
1 parent ec5f1cb commit 8501adc

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎Tests/test_file_libtiff.py‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,23 +399,21 @@ def test_non_bytes(
399399
"tiffinfo",
400400
(
401401
{TiffImagePlugin.IMAGEWIDTH: 1 << 27},
402-
{TiffImagePlugin.IMAGELENGTH: 1 << 27},
403402
{TiffImagePlugin.SAMPLESPERPIXEL: 3},
404-
{TiffImagePlugin.PLANAR_CONFIGURATION: 2},
405403
),
406404
)
407405
def test_geometry_tags(
408406
self, tiffinfo: dict[int, int], monkeypatch: pytest.MonkeyPatch, tmp_path: Path
409407
) -> None:
410-
# The geometry of the image is used, not the geometry from tiffinfo.
411-
# Otherwise libtiff would read past the end of the row buffer.
408+
# libtiff reads a scanline of the size described by the IMAGEWIDTH,
409+
# SAMPLESPERPIXEL and BITSPERSAMPLE tags from a buffer that only holds one
410+
# row of the image, so a tag describing a larger row must be rejected.
412411
monkeypatch.setattr(TiffImagePlugin, "WRITE_LIBTIFF", True)
413412

414413
out = tmp_path / "temp.tif"
415414
im = hopper("L")
416-
im.save(out, tiffinfo=tiffinfo)
417-
418-
assert_image_equal_tofile(im, out)
415+
with pytest.raises(OSError, match="encoder error -8"):
416+
im.save(out, tiffinfo=tiffinfo)
419417

420418
def test_inknames_tag(
421419
self, monkeypatch: pytest.MonkeyPatch, tmp_path: Path

0 commit comments

Comments
 (0)