Skip to content

fix(ocr): handle PPTX SVG images without a rasterized fallback - #2404

Open
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
microsoft:mainfrom
lazerg:fix/issue-2399-ocr-pptx-svg-no-fallback
Open

fix(ocr): handle PPTX SVG images without a rasterized fallback#2404
Lazizbek Ergashev (lazerg) wants to merge 2 commits into
microsoft:mainfrom
lazerg:fix/issue-2399-ocr-pptx-svg-no-fallback

Conversation

@lazerg

Copy link
Copy Markdown
Contributor

PptxConverterWithOCR reads shape.image.blob directly, so a deck whose picture is an SVG with no rasterized fallback fails the whole conversion with ValueError: no embedded image. The core PptxConverter stopped doing that in #2233, where _get_image_info resolves the <asvg:svgBlip> relationship when shape.image raises.

The OCR converter now goes through the core converter for both the image blob and the picture check, so the SVG reaches the OCR service and everything else converts as before. Test uses the same fixture as the core regression test.

Fixes #2399.

Guard on the image blob rather than a nullable stream, build the stream
info once so both the LLM and OCR paths describe the image with its real
content type, and require markitdown>=0.1.7 for _get_image_info.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PPTX SVG OCR fix looks correct. The image handling now uses the core PptxConverter logic for SVGs without a rasterized fallback, and the added regression test covers this case. The dependency version is also updated consistently. I don't see any blocking issues in this PR.

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.

OCR PPTX converter crashes on SVG images without a raster fallback

2 participants