-
Notifications
You must be signed in to change notification settings - Fork 760
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
Support inline images in the timeline #5877
Conversation
KonfettiView is crashing on API 21, independently from this change. If I uncomment KonfettiView, this change seems fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
I like the example you provided :)
I am wondering what will happen if the image is large. We have issue (like #2642 for instance) which is not fixed, and I am wondering if we could have the same trouble here.
GlideImagesPlugin.create(object : GlideImagesPlugin.GlideStore { | ||
override fun load(drawable: AsyncDrawable): RequestBuilder<Drawable> { | ||
val url = drawable.destination | ||
if (url.startsWith("mxc://")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat: You could use this handy extension fun String.isMxcUrl()
: https://github.com/vector-im/element-android/blob/main/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/MatrixUrls.kt#L31
(crash about Konfetti has been handled by #5926 and the fix will be available in 1.4.14) |
I can confirm that huge images are an issue here :( |
Forgot to bump, but huge image crashes appear to be fixed with 11c9eb9 . I don't know right now if there is a better way than putting a somewhat arbitrary size in there, but it doesn't appear to have any noticeable negative effect on image quality for me. |
Thanks for the update. Should be fine to merge this PR now, can I ask you to fix the conflict please? |
vector/src/main/java/im/vector/app/features/html/EventHtmlRenderer.kt
Outdated
Show resolved
Hide resolved
Match the code style below, that also does individual calls for multiple plugins.
Done! |
(Fixing the conflict again) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update! Will squash and merge.
Type of change
Content
Add GlideImagesPlugin for handling images in markwon, as suggested in #351 .
Motivation and context
#351
Screenshots / GIFs
Tests
On desktop, send a message with inline image, e.g.
/html <img src="mxc://..." alt="alt" title="title" height="128" />
Tested devices
Checklist
Signed-off-by: Tobias Büttner dev@spiritcroc.de