Skip to content

feat(jats): embed local figure images - #4041

Open
teachershuang wants to merge 2 commits into
docling-project:mainfrom
teachershuang:hongkaigu/jats-embedded-images
Open

feat(jats): embed local figure images#4041
teachershuang wants to merge 2 commits into
docling-project:mainfrom
teachershuang:hongkaigu/jats-embedded-images

Conversation

@teachershuang

@teachershuang teachershuang commented Aug 21, 2026

Copy link
Copy Markdown

Summary

  • preserve local images referenced by direct <fig><graphic xlink:href="..."> elements in file-based JATS documents
  • attach decoded images as ImageRef values on the generated PictureItem while preserving captions
  • keep stream inputs and unavailable, remote, or unsafe references as placeholders, and confine local paths to the JATS document directory

Part of #3583.

Testing

  • conda run -n docling-contrib python -m pytest -q tests/test_backend_jats.py (42 passed)
  • focused image-resource tests with pytest-cov (8 passed; every executable line added in jats_backend.py covered)
  • conda run -n docling-contrib python -m pytest -q tests/test_backend_optional_dependencies.py tests/test_input_doc.py (29 passed)
  • changed-file prek hooks: trailing whitespace, EOF, merge conflict, large files, Ruff lint/format, ty, Tach, module coverage, and 1500-line limit
  • repository read-only checks: Ruff format/lint, ty (warning-mode exit 0), Tach, module coverage, dprint, and locked dependency resolution
  • the standalone default 1000-line max-lines check reports existing over-limit files on current origin/main; the changed-file 1500-line hook passes

Scope

Remote URL fetching, inline graphics, and nested <alternatives> graphics remain out of scope for this focused change.

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Signed-off-by: teachershuang <guhongkaiailaopo@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @teachershuang, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling/backend/xml/jats_backend.py 88.88% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: teachershuang <guhongkaiailaopo@gmail.com>
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.

1 participant