gotify / android

An app for creating push notifications for new messages posted to gotify/server.
MIT License
960 stars 153 forks source link

svg image isn't shown in app #133

Closed gahoo closed 6 months ago

gahoo commented 4 years ago

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":"![banana](https://www.svgrepo.com/show/42310/banana.svg)",
  "priority":0,
  "extras": {
    "client::display": {
      "contentType": "text/markdown"
    }
  }
}'

gotify/android v2.0.14; gotify/server v2.0.14

jmattheis commented 4 years ago

Yeah, seems good. Probably this must be added: https://noties.io/Markwon/docs/v4/image/#svgmediadecoder

Sternagfonkel commented 3 years ago

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:

jmattheis commented 3 years ago

Hey @Sternagfonkel I'd be okay with replacing Picasso with Coil.

Sternagfonkel commented 3 years ago

Okay, then I'll give it a try.

cyb3rko commented 6 months ago

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?

jmattheis commented 6 months ago

Yes.