Conversation
|
@pedrofracassi help |
| res.setHeader('Content-Type', 'image/svg+xml') | ||
| res.send(inviteSVG) | ||
|
|
||
| switch (req.query.format.toLowerCase()) { |
There was a problem hiding this comment.
This will cause the request to fail if format is not passed
There was a problem hiding this comment.
One could fix the other issue as well (don't recall the #) to handle failed requests gracefully
There was a problem hiding this comment.
Ok, I've just realized the fuck up, don't mind me. Will fix it soon.
|
How are we placing the icon in the image? Does this problem have something to do with sharp not being able to fetch the icon? Do we use base64? |
|
I think sharp isn't converting that |
|
Any updates on this PR? Maybe the make an issue in the sharp Github. |
|
No need to send them an issue, I just haven't got the time yet to pick this back up, I'll probably pick it up today. EDIT: Thanks @pedrofracassi for the suggestion, I'll test it when I can. |
|
Also @almeidx when format isn't specified, should it default to SVG? |
To avoid breaking changes to the API, yes |
|
@pedrofracassi Your suggestion didn't work. I wasn't able to convert the jpeg/gif file which is our guild icon inside the SVG, w/o using other libs, and I don't want to add more dependencies to this project. |
|
You guys could always use ReSVG v2 added the ability to render images from external links |
|
Tested ReSVG and it did work |
mostly likely due to #82 |

When
?format=<png|svg>is present, it'll automatically convert the image to one of the two formats.If not specified, will return a SVG image.