Skip to content

feat(ppt): pictures from the BLIP store, real slide size, slide names#610

Open
andiwand wants to merge 2 commits into
feat/ppt-character-formattingfrom
feat/ppt-images
Open

feat(ppt): pictures from the BLIP store, real slide size, slide names#610
andiwand wants to merge 2 commits into
feat/ppt-character-formattingfrom
feat/ppt-images

Conversation

@andiwand

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

Stacked on #609 (same files; base is feat/ppt-character-formatting).

Adds pictures to the legacy .ppt decoder, plus two small fidelity wins from the AGENTS.md open-work list.

Pictures

  • A shape's OfficeArtFOPT is now parsed for pib (real picture shapes) and fillBlip (picture fills — how LibreOffice-exported .ppt places pictures); both are one-based indexes into the OfficeArtBStoreContainer of the document's drawing group.
  • Each OfficeArtFBSE locates its BLIP in the /Pictures (delay) stream at foDelay (embedded BLIPs are handled too). JPEG and PNG BLIPs become an image element under the shape's frame, served to the renderer as an in-memory odr::File → rendered as a base64 <img>. WMF/EMF/PICT/DIB/TIFF are skipped (documented open work).
  • The drawing's optional non-grouped shape ([MS-ODRAW] 2.2.13) is now read (open-work §1.2) — picture fills live there in practice.
  • Shapes flagged fBackground (OfficeArtFSP) get a full-slide anchor when they carry none and are ordered before the slide's other shapes so they render underneath.

Micro-wins

  • Slide size now comes from the DocumentAtom (master units → inches) instead of the hardcoded 10"×7.5" — style-various-1.ppt renders at its real 11.02"×8.27" size (open-work §2.1).
  • slide_name returns "Slide N" in presentation order (open-work §2.6).

Validation & tests

OldMs.ppt_style_various extended: slide 6 ("title6 – background image") now asserts a leading full-slide frame holding an image element whose bytes are the PNG from /Pictures; frame count 12 → 13. All OldMs.* and ppt HtmlOutputTests pass.

Note: the 2025-09-11 photo-deck fixture keeps rendering without photos — its pictures live on per-slide masters, which are skipped entirely (documented open work).

https://claude.ai/code/session_01R9Z3kyUaHNkJacAEggevHH

Resolve each shape's pib (picture shape) or fillBlip (picture fill, the
LibreOffice pattern) property through the OfficeArtBStoreContainer and
the /Pictures delay stream, and emit JPEG/PNG BLIPs as image elements
under the shape's frame, served as in-memory files. Background shapes
(OfficeArtFSP.fBackground) get a full-slide anchor and render below the
other shapes. The drawing's optional non-grouped shape ([MS-ODRAW]
2.2.13) is now read too - picture fills live there.

Also: slide size from the DocumentAtom instead of hardcoded 10x7.5in,
and slide_name returns "Slide N".

WMF/EMF/PICT/DIB/TIFF BLIPs and pictures on master slides remain open
(documented in AGENTS.md).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R9Z3kyUaHNkJacAEggevHH

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43863a237f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +257 to +259
[[nodiscard]] std::string image_href(
[[maybe_unused]] const ElementIdentifier element_id) const override {
return {};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Assign PPT images a non-empty resource path

When callers set HtmlConfig::embed_images = false, the generic image renderer asks the resource locator for a URL based on image.href(). Returning an empty string here makes every PPT image resource use an empty path, so the generated HTML gets src="" and bring_offline() cannot write distinct image assets. This only shows up in non-embedded image output, but that is a supported renderer configuration.

Useful? React with 👍 / 👎.

With HtmlConfig::embed_images = false the generic renderer uses
image.href() as the resource path, so the empty href produced src=""
and bring_offline could not write distinct image assets. Pictures have
no container path in the file; synthesize one from the one-based BLIP
store index plus the extension matching the image bytes
("Pictures/<index>.png|.jpg"). Addresses review feedback on #610.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AEvWWwe1EyeWH7ANHoAvPH
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