Fix crash for huge inline pictures

Change-Id: I9968e7fd95aa11d524a57c2186d518262fed5aa0
This commit is contained in:
SpiritCroc 2022-06-16 12:37:42 +02:00
parent fd34eba596
commit 2631d5c3a2

View File

@ -98,7 +98,8 @@ class EventHtmlRenderer @Inject constructor(
if (url.isMxcUrl()) {
val contentUrlResolver = activeSessionHolder.getActiveSession().contentUrlResolver()
val imageUrl = contentUrlResolver.resolveFullSize(url)
return Glide.with(context).load(imageUrl)
// Override size to avoid crashes for huge pictures
return Glide.with(context).load(imageUrl).override(500)
}
// We don't want to support other url schemes here, so just return a request for null
return Glide.with(context).load(null as String?)