Skip to content

feat(frontend): Wizard - replace save-svg-as-png with a local converter - #540

Open
marcalexiei wants to merge 1 commit into
stats-organization:masterfrom
marcalexiei:wizard-svg-to-png
Open

feat(frontend): Wizard - replace save-svg-as-png with a local converter#540
marcalexiei wants to merge 1 commit into
stats-organization:masterfrom
marcalexiei:wizard-svg-to-png

Conversation

@marcalexiei

Copy link
Copy Markdown

Dropped the unmaintained (from June 2020) and untyped save-svg-as-png for wizard/components/Card/downloadSvgAsPng.ts:
XMLSerializer ➡️ data URL ➡️ <img> ➡️ <canvas> ➡️ toBlob.
The card SVGs are self-contained, so the library's style-inlining bought nothing.

Display.tsx now reaches the card through a ref forwarded via CardImage to SvgInline, rather than getElementById("svg-wrapper").

Verified against the old library before removing it: both paths converted the stats and repo cards at scale: 2, and the PNGs were diffed pixel by pixel in Chromium (via LLM).
Dimensions match exactly; the few differing pixels are the library's, which copies rules matching nothing in the SVG out of the host page's stylesheets, and the injected font declaration shifts the glyphs.

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

@marcalexiei is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

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