From dc3bf9ceacb7048a97ceb8b7aa80bfccc8a05ca5 Mon Sep 17 00:00:00 2001 From: Maxim Lysak <101627549+maxmnemonic@users.noreply.github.com> Date: Mon, 7 Apr 2025 17:36:56 +0200 Subject: [PATCH] fix(pptx): check if picture shape has an image attached (#1316) Check if picture shape has an image attached in pptx backend Signed-off-by: Maksym Lysak Co-authored-by: Maksym Lysak --- docling/backend/mspowerpoint_backend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docling/backend/mspowerpoint_backend.py b/docling/backend/mspowerpoint_backend.py index a752e8d..2de0da1 100644 --- a/docling/backend/mspowerpoint_backend.py +++ b/docling/backend/mspowerpoint_backend.py @@ -392,9 +392,10 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB self.handle_tables(shape, parent_slide, slide_ind, doc, slide_size) if shape.shape_type == MSO_SHAPE_TYPE.PICTURE: # Handle Pictures - self.handle_pictures( - shape, parent_slide, slide_ind, doc, slide_size - ) + if hasattr(shape, "image"): + self.handle_pictures( + shape, parent_slide, slide_ind, doc, slide_size + ) # If shape doesn't have any text, move on to the next shape if not hasattr(shape, "text"): return