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

how to save image in the markdown #162

Open
charliedream1 opened this issue Dec 20, 2024 · 5 comments
Open

how to save image in the markdown #162

charliedream1 opened this issue Dec 20, 2024 · 5 comments

Comments

@charliedream1
Copy link

The image in the markdown is represented as this: . How can I save images?

@Misnad
Copy link

Misnad commented Dec 21, 2024

Can you show an example?

@charliedream1
Copy link
Author

from markitdown import MarkItDown

md = MarkItDown()
result = md.convert("test.pdf")
print(result.text_content)

md_file = 'text.md'
with open(md_file, 'w') as f:
       f.write(result.text_content)

I'm write code like this. In file text.md, only text saved, the image part shows like [](.data/image:base64...), I couldn't find this figure.

  • How to get this base64 image directly from function md.convert("test.xlsx")?
  • How to save images?

@corolair-hazem
Copy link

up

@infogulch
Copy link

I have documents with embedded images that I would like to convert to markdown, so this feature would be helpful for me.

Currently when exporting it exports like this (exact quote):

![LABEL - TMG.jpg](data:image/jpeg;base64...)

I could see two resolutions:

  1. Complete the embedded image data ![](data:image/png;base64...). I think this would work display correctly when rendering markdown.
  2. Add an option to export embedded images as files in a particular directory and create relative links to them.

@oliviermills
Copy link

Same problem, base64 data shoul be in the data-url or file saved, neither are there.. just ![](data:image/png;base64...) ie.. "..." were the base64 image data should be

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

5 participants