invidget icon indicating copy to clipboard operation
invidget copied to clipboard

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

Open Galaxy-Coding opened this issue 3 years ago • 6 comments

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.

Galaxy-Coding avatar Jun 30 '21 23:06 Galaxy-Coding

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.

pedrofracassi avatar Jul 04 '21 14:07 pedrofracassi

I'm more than happy to accept it.

jaxxibae avatar Jul 04 '21 16:07 jaxxibae

Good luck!

pedrofracassi avatar Jul 05 '21 11:07 pedrofracassi

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

Galaxy-Coding avatar Jul 06 '21 15:07 Galaxy-Coding

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

jaxxibae avatar Jul 06 '21 15:07 jaxxibae

My bad. Didn’t see #42.

Galaxy-Coding avatar Jul 06 '21 15:07 Galaxy-Coding