Skip to content

Fix duplicate Markdown images across pages - #5190

Open
DresdenGman wants to merge 1 commit into
PaddlePaddle:release/3.7from
DresdenGman:agent/page-aware-markdown-images
Open

Fix duplicate Markdown images across pages#5190
DresdenGman wants to merge 1 commit into
PaddlePaddle:release/3.7from
DresdenGman:agent/page-aware-markdown-images

Conversation

@DresdenGman

Copy link
Copy Markdown

What this changes

  • scopes Markdown image filenames by page for multi-page documents
  • keeps the existing filenames for single-page results
  • updates both Markdown references and the returned image mapping
  • preserves page metadata when PaddleOCR-VL concatenates page results
  • adds regressions for regular image blocks and images embedded in tables

Root cause

Image paths were derived only from the block label and coordinates. Two images at the same coordinates on different PDF pages therefore shared one dictionary key and output filename, causing the later image to overwrite the earlier one.

Validation

  • two isolated regression tests covering same-coordinate images on two pages
  • python3 -m compileall on all changed Python files
  • Ruff checks and formatting checks on the new converter, mixin, and test changes
  • git diff --check

The full PaddleX test suite was not run locally because this checkout is intentionally sparse and does not contain the complete optional runtime dependencies.

Fixes PaddlePaddle/PaddleOCR#18305

@CLAassistant

CLAassistant commented Aug 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@DresdenGman
DresdenGman marked this pull request as ready for review August 13, 2026 09:39
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

Successfully merging this pull request may close these issues.

save_to_markdown overwrites images with same coordinates on different pages

2 participants