Skip to content

Embed local SVG images as image/svg+xml - #2352

Merged
hansthen merged 1 commit into
python-visualization:mainfrom
NotAFlightRisk:fix-svg-image-mime
Nov 17, 2026
Merged

hansthen merged 1 commit into
python-visualization:mainfrom
NotAFlightRisk:fix-svg-image-mime

Conversation

@NotAFlightRisk

Copy link
Copy Markdown
Contributor

This embeds local .svg files as image/svg+xml, so an SVG actually shows up when you use it for a CustomIcon or ImageOverlay. At the moment it goes in as data:image/svg;base64,..., which isn't a registered type, and Chromium won't draw it. On 1.0.0 a 40x30 SVG marker and overlay both come out blank (0x0), and they're 40x30 with this change.

Other extensions are left as they are. PNG and JPEG get away with the bare extension because Chromium sniffs raster image bytes (even image/jpg renders), but it doesn't do that for SVG.

@hansthen

Copy link
Copy Markdown
Collaborator

@NotAFlightRisk Can you run black (our autoformatter) on your change and check in again?

@hansthen
hansthen merged commit ff73025 into python-visualization:main Nov 17, 2026
14 of 15 checks passed

This branch was previously deployed

1 inactive deployment
pypi — 90a21af1 Deployed Nov 16, 2026 by NotAFlightRisk via packages #2099
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.

2 participants

⌂ Proxy