From 0f43b49cbda8bd6c23cf7d384fec878c32afe6aa Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Mon, 31 May 2021 13:39:15 +0200 Subject: [PATCH] Use original URL instead of thumbnail URL for GIFs - GIFs tend to be small enough to download directly - Sometimes, thumbnails don't support animating Change-Id: I9848d05f2f1565570f341847209712b9e4abfbac --- .../home/room/detail/timeline/item/MessageImageVideoItem.kt | 4 +++- .../im/vector/app/features/media/ImageContentRenderer.kt | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt index 9d7caa828c..a5f51d289d 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/detail/timeline/item/MessageImageVideoItem.kt @@ -77,7 +77,9 @@ abstract class MessageImageVideoItem : AbsMessageItem resolveUrl(data) Mode.THUMBNAIL -> contentUrlResolver.resolveThumbnail(data.url, size.width, size.height, ContentUrlResolver.ThumbnailMethod.SCALE) } @@ -348,6 +352,7 @@ class ImageContentRenderer @Inject constructor(private val localFilesHelper: Loc finalHeight = height finalWidth = width } + Mode.ANIMATED_THUMBNAIL, Mode.THUMBNAIL -> { finalHeight = min(maxImageWidth * height / width, maxImageHeight) finalWidth = finalHeight * width / height