Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg image isn't shown in app #133

Closed
gahoo opened this issue Aug 20, 2020 · 6 comments · Fixed by #345
Closed

svg image isn't shown in app #133

gahoo opened this issue Aug 20, 2020 · 6 comments · Fixed by #345
Labels
a:feature New feature or request

Comments

@gahoo
Copy link

gahoo commented Aug 20, 2020

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
Copy link
Member

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

@jmattheis jmattheis added the a:feature New feature or request label Aug 24, 2020
@Sternagfonkel
Copy link
Contributor

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.

@jmattheis
Copy link
Member

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

@Sternagfonkel
Copy link
Contributor

Okay, then I'll give it a try.

@cyb3rko
Copy link
Contributor

cyb3rko commented Apr 22, 2024

Picasso was replaced with Coil in #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
Copy link
Member

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Development

Successfully merging a pull request may close this issue.

4 participants