Skip to content

feat: add SVG image support#1115

Open
kameronbrooks wants to merge 1 commit into
scanny:masterfrom
kameronbrooks:master
Open

feat: add SVG image support#1115
kameronbrooks wants to merge 1 commit into
scanny:masterfrom
kameronbrooks:master

Conversation

@kameronbrooks

Copy link
Copy Markdown

Summary

This PR adds native SVG support to the image insertion pipeline so SVG files can be used with the existing picture APIs.

Reason

PowerPoint supports SVG images natively, but python-pptx did not recognize .svg files or generate the XML required to embed them correctly.

Changes

  • Add SVG content type and extension handling
  • Add SVG-specific image part support
  • Parse SVG dimensions from document metadata
  • Generate native PowerPoint SVG picture XML
  • Route add_picture() and related insertion paths through the SVG flow when the source file is an SVG

Result

SVG images can now be inserted using the existing picture APIs without changing the public usage pattern for raster images.

Changed Files

SlideShapes.add_picture() does not support SVG files #1112

@AlexanderWillner

Copy link
Copy Markdown

lgtm - works for me, thanks for the PR

@f1amingo

f1amingo commented Jul 9, 2026

Copy link
Copy Markdown

This feature is exactly what I need — I've been working around the lack of SVG support in python-pptx for a while. The changes look clean and well-scoped.

Any timeline on when this might get reviewed and merged? Happy to help test or review if that would move things along.

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.

3 participants