python-pptx
python-pptx copied to clipboard
Image.content_type and Image.ext incorrect for EMF files?
I encountered this issue with a particular pptx file, which I was trying to convert using pptx2md which is based on python-pptx.
It appears that if an embedded image file is of type enhanced metafile (file with extension emf in ppt/media), if the PowerPoint file is read with python-pptx, the corresponding Image object has content_type = 'image/x-wmf' and ext = 'wmf'. Within pptx2md, this lead to extracted images being written with the wrong extension, which then cannot be read e.g. by Inkscape. I found that in such cases, filename = 'image.emf', and I contributed a PR https://github.com/ssine/pptx2md/pull/73 which relies on that. That seems hacky though, and a fix in python-pptx would be better.