Skip to content

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

@allefeld

Description

@allefeld

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions