feat: extract and describe embedded images in PPTX files#6
Closed
olearydj wants to merge 2 commits intoMichaelliv:mainfrom
Closed
feat: extract and describe embedded images in PPTX files#6olearydj wants to merge 2 commits intoMichaelliv:mainfrom
olearydj wants to merge 2 commits intoMichaelliv:mainfrom
Conversation
The PPTX converter now extracts p:pic elements from slide shape trees, resolves image data via slide-level relationships, and passes images to the describe callback for AI-powered descriptions when configured. Without an API key, images produce placeholder text with shape name and alt text (if available). With a configured provider, each embedded image is sent for description using the same pipeline as standalone image files. Adds 12 tests and a PPTX fixture covering text extraction, image placeholders, alt text, describe callback invocation, and error fallback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Recursively collect p:pic elements from p:grpSp groups, not just top-level shapes. Grouped images (common after users group objects in PowerPoint) were previously skipped entirely. - Handle package-absolute relationship targets (e.g. /ppt/media/image1.png) in addition to relative targets. Previously these resolved to invalid zip paths and were silently dropped. - Update test fixture with a grouped image (slide 4) - Add 2 regression tests for grouped image extraction Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 tasks
8b26128 to
c178e8c
Compare
Owner
|
thanks @olearydj! i've added pptx image extraction following the same pattern as the pdf converter. images get extracted to a temp dir by default, or to a custom path with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The PPTX converter currently extracts text from
p:sp(shape) elements but ignoresp:pic(picture) elements in the slide shape tree. This PR adds embedded image extraction and wires it to the existingdescribecallback, giving PPTX files the same AI-powered image description capability that standalone image files already have.Changes
optionsparameter in the PPTX converter'sconvertmethodp:picelements, resolve the embedded image data from the zipoptions.describe(buffer, mimetype)when a provider is configuredBehavior
Without API key: images produce
*[Image: Shape Name — alt text]*placeholders (or just*[Image: Shape Name]*if no alt text exists).With configured provider: each embedded image is sent for AI description using the same pipeline as standalone image files, producing
**[Image: Shape Name]**followed by the description.Error handling: if the describe callback throws, the converter falls back to placeholder text rather than failing the entire conversion.
Test plan
bun test— 70 tests pass (58 existing + 12 new), 0 failures🤖 Generated with Claude Code