svg image isn't shown in app
SVG is not shown within the android app using markdown. On the server side it works as expected. And #107 remains in v2.0.14.
curl "https://myserver.com/message?token=<secret>" --header 'Content-Type: application/json' \
--data-raw '{
"title":"Test",
"message":"",
"priority":0,
"extras": {
"client::display": {
"contentType": "text/markdown"
}
}
}'
gotify/android v2.0.14; gotify/server v2.0.14
Yeah, seems good. Probably this must be added: https://noties.io/Markwon/docs/v4/image/#svgmediadecoder
I know this issue is a little older, but I spent a little time on it. The problem here is, that Picasso/Markwon Picasso Plugin, which currently handles the images in markdown messages, doesn't support svg. If the original images plugin, including the svg-decoder is used (as suggested), then all images in the markdown messages are handled by this plugin and not by the Picasso plugin anymore. That's because Markwon doesn't support multiple plugins that handle different type of images (or at least image loading). Potential solutions would be:
- Let the suggested images plugin handle the images including svg and drop Picasso in markdown messages. This might result in performance issues.
- Drop Picasso and try to use Coil instead (either only in markdown messages or in the whole app). Coil supports svg and there's a markwon plugin.
Hey @Sternagfonkel I'd be okay with replacing Picasso with Coil.
Okay, then I'll give it a try.
Picasso was replaced with Coil in https://github.com/gotify/android/pull/337.
SVG isn't supported by default, but it could be easily implemented by importing io.coil-kt:coil-svg
and the following code:
.components {
add(SvgDecoder.Factory())
}
Should we implement this?
Yes.