-
Notifications
You must be signed in to change notification settings - Fork 659
Open
Description
async def read_pptx(f: io.BytesIO, client: AioBaseClient | AsyncClient) -> list[str]:
presentation = pptx.Presentation(f)
text = []
for slide in presentation.slides:
page = []
for shape in slide.shapes:
if hasattr(shape, "text_frame"):
page.append(shape.text_frame.text)
elif shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
img = io.BytesIO(shape.image.blob)readers.py:395: in read_pptx
img = io.BytesIO(shape.image.blob)
.venv/lib/python3.12/site-packages/pptx/shapes/picture.py:190: in image
return slide_part.get_image(rId)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pptx.parts.slide.SlidePart object at 0x17b840a10>, rId = 'rId2'
def get_image(self, rId: str) -> Image:
"""Return an |Image| object containing the image related to this slide by *rId*.
Raises |KeyError| if no image is related by that id, which would generally indicate a
corrupted .pptx file.
"""
> return cast("ImagePart", self.related_part(rId)).image
E AttributeError: 'Part' object has no attribute 'image'
.venv/lib/python3.12/site-packages/pptx/parts/slide.py:41: AttributeErrorWhen I convert the file to a .zip and extract the images, I see that the file is a .tif. Seems similar to #929.
Metadata
Metadata
Assignees
Labels
No labels