mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-24 19:14:23 +00:00
Proper test for 2 page tiff file
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
parent
2aab66288b
commit
bccb644772
BIN
tests/data/tiff/2206.01062.tif
vendored
Normal file
BIN
tests/data/tiff/2206.01062.tif
vendored
Normal file
Binary file not shown.
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user