Skip to content

Word/ODT/EPUB import: embedded images are lost (link written, file never extracted) #1

Description

@ikwach

What happens

Importing a .docx that contains a picture, via File → Import (Word, HTML…)…, produces a Markdown link to an image file that is never written to disk:

![](media/image1.jpg)

There is no media/ folder and no image1.jpg. The image is silently lost and the document shows a broken image.

Steps

  1. Take any Word document with one picture in it. (Ours was a Google Doc downloaded via File → Download → Microsoft Word.)
  2. In Constly, File → Import (Word, HTML…)…, pick the file.
  3. The picture is a broken link.

Expected

The image is extracted next to the document, and the link points at it.

Cause

The import runs Pandoc without --extract-media, so Pandoc emits the reference it would have written but never writes the file. Running the same conversion by hand with the flag works:

pandoc mydoc.docx -t gfm -o mydoc.md --extract-media=./media

On our test document that gives a 1 KB .md next to a real 217 KB .jpg.

Affects

Any import format that can carry embedded images: docx, odt, rtf, epub.

Workaround

Run the Pandoc command above yourself until this is fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions