Hello stackoverflow users.
I am trying to download an image from the powerpoint presentation and then to process it(to recognize numbers on it at certain coordinates).
My problem is that I can download an image from pptx data only in .wmf format, and I cannot convert it. I have tried all possible solutions already.
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
pptx_path = "name_pptx.pptx"
prs = Presentation(pptx_path)
desired_slide = prs.slides[6 - 1]
for shape in desired_slide.shapes:
if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
image_file_bytes = shape.image.blob
file_extension = shape.image.ext # at this point format is .wfm
Interesting that in Powerpoint I can select a desired .jpeg extension when saving a file.