Proper test for 2 page tiff file

Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
Christoph Auer 2025-07-23 08:39:06 +02:00
parent 2aab66288b
commit bccb644772
2 changed files with 23 additions and 0 deletions

BIN
tests/data/tiff/2206.01062.tif vendored Normal file

Binary file not shown.

View File

@ -243,3 +243,26 @@ def _make_input_doc_from_stream(doc_stream):
backend=PdfFormatOption().backend, # use default
)
return in_doc
def test_tiff_two_pages():
tiff_path = Path("./tests/data/tiff/2206.01062.tif")
doc = InputDocument(
path_or_stream=tiff_path,
format=InputFormat.IMAGE,
backend=PdfFormatOption().backend, # use default backend
)
assert doc.valid is True
assert doc.page_count == 2
# Expect two full-page rectangles
rects_page1 = doc._backend.load_page(0).get_bitmap_rects()
rects_page2 = doc._backend.load_page(0).get_bitmap_rects()
page1_rect = next(rects_page1)
page2_rect = next(rects_page2)
assert page1_rect.t == page2_rect.t == 0
assert page1_rect.l == page2_rect.l == 0
assert page1_rect.r == page2_rect.r == 612.0
assert page1_rect.b == page2_rect.b == 792.0