Developer-Mike / obsidian-docxer

🚀 Boost your productivity by previewing and converting Word files easily to markdown.
GNU General Public License v3.0
52 stars 3 forks source link

Can not generate image attachments when docx images contain Chinese Alt Text #3

Closed probe301 closed 5 months ago

probe301 commented 5 months ago

Thank you for developing the plugin!

For docx files with only text, everything works fine. However, with .docx files that contain images, sometimes it is found that image attachments cannot be generated.

A failed example looks like this:

a snippet from the document.xml inside .docx file:

<w:drawing>
    <wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="27942325" wp14:editId="791510E3">
        <wp:extent cx="5274310" cy="3090545"/>
        <wp:effectExtent l="0" t="0" r="2540" b="0"/>
        <wp:docPr id="1823953991" name="图片 1" descr="一些中文替代描述"/>
        <wp:cNvGraphicFramePr>
            <a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/>
        </wp:cNvGraphicFramePr>
        <a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main">
            <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
                <pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture">
                    <pic:nvPicPr>
                        <pic:cNvPr id="0" name="Picture 1" descr="一些中文替代描述"/>
                        <pic:cNvPicPr>
                            <a:picLocks noChangeAspect="1" noChangeArrowheads="1"/>
......
</w:drawing>

This image with descr="一些中文替代描述" attempts to generate an unamed .png file and then fails.

P.S. If I change the AltText to English in the .docx file, everything works normally.

Developer-Mike commented 5 months ago

Good call! I'll fix it as soon as possible.

Developer-Mike commented 5 months ago

This issue got fixed in version 1.0.3 👍🏻