Skip to content

feat: add SVG image support#1115

Open
kameronbrooks wants to merge 1 commit intoscanny:masterfrom
kameronbrooks:master
Open

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

Conversation

@kameronbrooks
Copy link

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

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