coffeebank / coffee-maubot

Matrix bot plugins for Maubot 🍢 Add link previews, choose, and other tools to your Matrix chat ☕
https://coffeebank.github.io/coffee-maubot
11 stars 5 forks source link

urlpreview: convert svgs to png #34

Open ajkessel opened 5 months ago

ajkessel commented 5 months ago

Element clients don't support SVG format images, so urlpreview returns a broken image if the previewed image is SVG. This patch, which adds to my upload image patch, converts SVGs to PNG before uploading. This would require an additional python library (cairosvg) which is not installed by default, so perhaps it could be set to only import the library and perform the conversion when the library is present, rather than throwing an exception. better_image_support.patch