SwitchbladeBot / invidget

SVG invite widgets that look just like the ones on the Discord client!
http://invidget.switchblade.xyz/
MIT License
116 stars 23 forks source link

[Feature] Add an option to convert svg to png in url parameters #40

Open Galaxy-Coding opened 3 years ago

Galaxy-Coding commented 3 years ago

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.

pedrofracassi commented 3 years ago

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.

jaxxibae commented 3 years ago

I'm more than happy to accept it.

pedrofracassi commented 3 years ago

Good luck!

Galaxy-Coding commented 3 years ago

@jaxxibae I believe the NPM package called sharp can do that job easily.

jaxxibae commented 3 years ago

We're using sharp, and the PR is already open, I'm just freaking because the guild icon isn't being rendered

Galaxy-Coding commented 3 years ago

My bad. Didn’t see #42.