Skip to content

wpd-codec: lift image boxes as ContentImageBlock - #1180

Merged
Mearman merged 1 commit into
mainfrom
fix/927-wpd-structure
Sep 10, 2026
Merged

wpd-codec: lift image boxes as ContentImageBlock#1180
Mearman merged 1 commit into
mainfrom
fix/927-wpd-structure

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

Closes #927's live remainder. Much of the issue's original list had already landed under concurrent sessions (text/equation boxes, merge codes, table formulas, style packets -- all verified untouched); this PR lifts the one remaining parse-without-lift structure the schema has a home for:

  • image boxes: a magic-driven scan (PNG chunk walk to IEND, JPEG marker walk to EOI -- no container spec exists in the format for them) lifts the exact structural span as a frame-sized ContentImageBlock at its absolute-page position, with a small hand-written base64 keeping it Worker-isomorphic

The remaining structures are boundaries with stated reasons: WPG vector graphics are a distinct binary vector format outside ContentImageBlock's kinds (decoding it is a project the scale of the reader itself), native OLE objects are an OLE server's native stream rather than a nested document package (the same boundary ooxml.js draws for OLE1), and headers/footers/footnotes/endnotes are blocked on #1128 -- which is precisely that schema design's own tracking issue.

Closes #927 (the page-furniture/notes remainder lives in #1128).

@Mearman
Mearman marked this pull request as ready for review September 10, 2026 03:35
@Mearman

Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@Mearman
Mearman enabled auto-merge (rebase) September 10, 2026 03:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ⚠️ Failed 2026-09-10T03:55:19.060456Z 97f48fc Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

An image box's content prefix names a packet whose container spelling
this reader has no specification for, so the lift is magic-driven: the
packet's raw bytes are scanned by signature and structural walk (the
PNG chunk chain to IEND, the JPEG marker segments to EOI), never by
guessing at a container header, and exactly that span lifts as a
ContentImageBlock sized by the box's own frame -- with an
absolute-from-page-edge position carried as the image's floatPosition.
A WPG vector graphic or OLE payload stays honestly reported through
wpd/box-content-unresolved rather than approximated. The base64 encoder
is hand-written (no Buffer, no atob) keeping the package
Worker-isomorphic.
@Mearman
Mearman force-pushed the fix/927-wpd-structure branch from 97f48fc to 8e40360 Compare September 10, 2026 04:12
@Mearman
Mearman merged commit 79da2f3 into main Sep 10, 2026
22 checks passed
@Mearman
Mearman deleted the fix/927-wpd-structure branch September 10, 2026 04:13
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wpd-codec leaves most non-text WordPerfect structure unlifted: boxes, graphics, page furniture, notes, and OLE

1 participant