mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
fix/poetry_check Signed-off-by: Benichou <fbenichou@deloitte.ca>
This commit is contained in:
parent
4420c38936
commit
ed56086a65
@ -2,8 +2,6 @@ import logging
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Set, Union
|
from typing import Set, Union
|
||||||
from lxml import etree
|
|
||||||
from lxml.etree import XPath
|
|
||||||
|
|
||||||
from docling_core.types.doc import (
|
from docling_core.types.doc import (
|
||||||
BoundingBox,
|
BoundingBox,
|
||||||
@ -19,6 +17,8 @@ from docling_core.types.doc import (
|
|||||||
TableData,
|
TableData,
|
||||||
)
|
)
|
||||||
from docling_core.types.doc.document import ContentLayer
|
from docling_core.types.doc.document import ContentLayer
|
||||||
|
from lxml import etree
|
||||||
|
from lxml.etree import XPath
|
||||||
from PIL import Image, UnidentifiedImageError
|
from PIL import Image, UnidentifiedImageError
|
||||||
from pptx import Presentation
|
from pptx import Presentation
|
||||||
from pptx.enum.shapes import MSO_SHAPE_TYPE, PP_PLACEHOLDER
|
from pptx.enum.shapes import MSO_SHAPE_TYPE, PP_PLACEHOLDER
|
||||||
@ -315,6 +315,7 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB
|
|||||||
doc.add_picture(
|
doc.add_picture(
|
||||||
parent=parent_slide,
|
parent=parent_slide,
|
||||||
image=ImageRef.from_pil(image=pil_image, dpi=int(im_dpi)),
|
image=ImageRef.from_pil(image=pil_image, dpi=int(im_dpi)),
|
||||||
|
image=ImageRef.from_pil(image=pil_image, dpi=int(im_dpi)),
|
||||||
caption=None,
|
caption=None,
|
||||||
prov=prov,
|
prov=prov,
|
||||||
)
|
)
|
||||||
@ -416,15 +417,9 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB
|
|||||||
if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
|
if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
|
||||||
# Handle Pictures
|
# Handle Pictures
|
||||||
drawing_blip = self.xpath_expr(shape.element)
|
drawing_blip = self.xpath_expr(shape.element)
|
||||||
if drawing_blip: # ensure there is a drawing blip
|
if drawing_blip:
|
||||||
self.handle_pictures(
|
self.handle_pictures(
|
||||||
shape,
|
shape, parent_slide, slide_ind, doc, drawing_blip, slide
|
||||||
parent_slide,
|
|
||||||
slide_ind,
|
|
||||||
doc,
|
|
||||||
slide_size,
|
|
||||||
drawing_blip,
|
|
||||||
slide,
|
|
||||||
)
|
)
|
||||||
# If shape doesn't have any text, move on to the next shape
|
# If shape doesn't have any text, move on to the next shape
|
||||||
if not hasattr(shape, "text"):
|
if not hasattr(shape, "text"):
|
||||||
|
Loading…
Reference in New Issue
Block a user