invidget
invidget copied to clipboard
[Feature] Add an option to convert svg to png in url parameters
It would be cool that if someone added ?format=png
to the end of the URL, the image is automatically converted to a PNG file. I might do a PR later on that if I have time
Edit: This is necessary when sending messages to discord, as discord does not allow embedded SVG for security reasons.
I believe i tried that when originally developing invidget, but ended up not doing it due to the lack of a good library to convert it. Most libraries wouldn't render fonts or images correctly.
If anybody wants to pick this up, feel free to, though.
I'm more than happy to accept it.
Good luck!
@jaxxibae I believe the NPM package called sharp can do that job easily.
We're using sharp, and the PR is already open, I'm just freaking because the guild icon isn't being rendered
My bad. Didn’t see #42.