Closed maximepvrt closed 1 month ago
Currently toBase64Imagefunction use file extension to define MIME Type and the default is jpeg.
toBase64Image
https://avatars.githubusercontent.com/maximepvrt => it's a jpeg image => OK https://avatars.githubusercontent.com/shinGangan => it's a png image => KO
I use this code https://stackoverflow.com/questions/57976898/how-to-get-mime-type-from-base-64-string and I defined image/svg+xml as the default value because a svg file that can start with a multitude of things (<svg, <?xml, a comment, …)
image/svg+xml
<svg
<?xml
Fix #194, certainly #197
@harlan-zw 🙋
Thanks! I've merged in on https://github.com/nuxt-modules/og-image/pull/202 as I couldn't modify your branch.
Currently
toBase64Image
function use file extension to define MIME Type and the default is jpeg.https://avatars.githubusercontent.com/maximepvrt => it's a jpeg image => OK https://avatars.githubusercontent.com/shinGangan => it's a png image => KO
I use this code https://stackoverflow.com/questions/57976898/how-to-get-mime-type-from-base-64-string and I defined
image/svg+xml
as the default value because a svg file that can start with a multitude of things (<svg
,<?xml
, a comment, …)Fix #194, certainly #197