Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image.content_type and Image.ext incorrect for EMF files? #1042

Open
allefeld opened this issue Jan 18, 2025 · 0 comments
Open

Image.content_type and Image.ext incorrect for EMF files? #1042

allefeld opened this issue Jan 18, 2025 · 0 comments

Comments

@allefeld
Copy link

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 ssine/pptx2md#73 which relies on that. That seems hacky though, and a fix in python-pptx would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant