Skip to content

Why remove image dataurl, That`s useful #51

Closed

Description

@fab617
        # Remove dataURIs
        if src.startswith("data:"):
            src = src.split(",")[0] + "..."

When I convet a DOCX file, I noticed that every image lost. by trace code , docx converted to html properly and image store in html as dataurl, but when html convert to markdown, you removed that in def convert_img at line 120 whitout any config. Every image lost without any alert.

Activity

  1. afourney commented on Dec 16, 2024

    @afourney
    Member

    Perhaps we can make this optional, but the reason they are removed is because we were feeding the text_content into LLMs (the primary motivation for development), and the base64-encoded images would overwhelm the context windows.

  2. added
    question
    on Dec 17, 2024
  3. ColorfulCoco commented on Dec 18, 2024

    @ColorfulCoco

    也许我们可以将其设为可选,但删除它们的原因是我们将text_content提供给 LLM(开发的主要动机),而 base64 编码的图像会压倒上下文窗口。

    Perhaps we can make this optional, but the reason they are removed is because we were feeding the text_content into LLMs (the primary motivation for development), and the base64-encoded images would overwhelm the context windows.

    When I convert a PDF to Markdown using the following code, it only outputs the textual information without any image information.
    md = MarkItDown(llm_client=client, llm_model="qwen-long")
    result = md.convert("")
    print(result.text_content)

  4. fab617 commented on Dec 18, 2024

    @fab617
    Author

    Perhaps we can make this optional, but the reason they are removed is because we were feeding the text_content into LLMs (the primary motivation for development), and the base64-encoded images would overwhelm the context windows.

    I see, maybe we could make another copy without images and feed it to LLMs, so user can get the full document.

  5. afourney commented on Mar 21, 2025

    @afourney
    Member

    Fixed in #1140

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

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions