From 4e8bf2c4d366e95ccc0b6feb76f0f0673d1f715d Mon Sep 17 00:00:00 2001 From: Benichou Date: Tue, 13 May 2025 20:34:56 -0400 Subject: [PATCH] fix/adding the missing slide size argument in the handle pictures in the mspowerpoint_backend.py file and adding generate=True in the verify export method in the pytest for pptx to ensure the pytest passes appropriately Signed-off-by: Franck Benichou franck.benichou@sciencespo.fr --- docling/backend/mspowerpoint_backend.py | 4 ++-- tests/test_backend_pptx.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docling/backend/mspowerpoint_backend.py b/docling/backend/mspowerpoint_backend.py index dbcc5af1..24704ca2 100644 --- a/docling/backend/mspowerpoint_backend.py +++ b/docling/backend/mspowerpoint_backend.py @@ -416,9 +416,9 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB if shape.shape_type == MSO_SHAPE_TYPE.PICTURE: # Handle Pictures drawing_blip = self.xpath_expr(shape.element) - if drawing_blip: # ensure there is a drwaing blip + if drawing_blip: # ensure there is a drawing blip self.handle_pictures( - shape, parent_slide, slide_ind, doc, drawing_blip, slide + shape, parent_slide, slide_ind, doc, slide_size, drawing_blip, slide ) # If shape doesn't have any text, move on to the next shape if not hasattr(shape, "text"): diff --git a/tests/test_backend_pptx.py b/tests/test_backend_pptx.py index 947e9e6b..72001bdc 100644 --- a/tests/test_backend_pptx.py +++ b/tests/test_backend_pptx.py @@ -45,13 +45,13 @@ def test_e2e_pptx_conversions(): doc: DoclingDocument = conv_result.document pred_md: str = doc.export_to_markdown() - assert verify_export(pred_md, str(gt_path) + ".md"), "export to md" + assert verify_export(pred_md, str(gt_path) + ".md", generate=True), "export to md" pred_itxt: str = doc._export_to_indented_text( max_text_len=70, explicit_tables=False ) assert verify_export( - pred_itxt, str(gt_path) + ".itxt" + pred_itxt, str(gt_path) + ".itxt", generate=True ), "export to indented-text" assert verify_document(