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

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
@DresdenGman

Copy link
Copy Markdown
Author

Friendly follow-up: the CLA is signed and the focused fix for duplicate cross-page Markdown images is ready for review. The patch includes regression coverage for repeated image names and page-local image handling. Please let me know if the implementation or test scope should be adjusted.

@DresdenGman

Copy link
Copy Markdown
Author

Hi, just a brief second note on this one — I sent a short follow-up back in August and wanted to make sure it had not been missed. There is no rush at all on my side, and the PR still merges cleanly. If it needs a rebase onto the current release branch, or any changes to the fix or the tests, I am happy to make them. Thanks for your time.

This branch has not been deployed

No deployments
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