Drop GlideWebp

The benefit of rendering some corner-case webp images is negligible
compared to issues related to the slow update policy of the library,
such as recently in relevance to CVE-2023-4863 (but also previously
for updating glide versions).

Fixes https://github.com/SchildiChat/SchildiChat-android/issues/210

Change-Id: I3809e2b48e595809fed1a6f4e405cdf178126cdb
This commit is contained in:
SpiritCroc 2023-09-28 09:39:44 +02:00
parent bf6f71c2b5
commit 29c921eb96
4 changed files with 2 additions and 9 deletions

View File

@ -147,7 +147,6 @@ ext.libs = [
'glideImageLoader' : "com.github.piasy:GlideImageLoader:$bigImageViewer",
'progressPieIndicator' : "com.github.piasy:ProgressPieIndicator:$bigImageViewer",
'glideImageViewFactory' : "com.github.piasy:GlideImageViewFactory:$bigImageViewer",
'glideWebpDecoder' : "com.github.zjupure:webpdecoder:2.3.$glide",
'flowBinding' : "io.github.reactivecircus.flowbinding:flowbinding-android:$flowBinding",
'flowBindingAppcompat' : "io.github.reactivecircus.flowbinding:flowbinding-appcompat:$flowBinding",
'flowBindingMaterial' : "io.github.reactivecircus.flowbinding:flowbinding-material:$flowBinding"

View File

@ -88,7 +88,6 @@ ext.groups = [
'com.github.piasy',
'com.github.shyiko.klob',
'com.github.rubensousa',
'com.github.zjupure',
'com.google',
'com.google.android',
'com.google.api.grpc',

View File

@ -218,7 +218,6 @@ dependencies {
implementation libs.github.bigImageViewer
implementation libs.github.glideImageLoader
implementation libs.github.glideImageViewFactory
implementation libs.github.glideWebpDecoder
// implementation 'com.github.MikeOrtiz:TouchImageView:3.0.2'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'

View File

@ -24,14 +24,13 @@ import android.widget.ImageView
import androidx.core.view.isGone
import androidx.core.view.isVisible
import androidx.core.view.updateLayoutParams
import com.bumptech.glide.integration.webp.decoder.WebpDrawable
import com.bumptech.glide.integration.webp.decoder.WebpDrawableTransformation
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.Transformation
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.request.target.CustomViewTarget
import com.bumptech.glide.request.target.Target
import im.vector.app.R
@ -183,10 +182,7 @@ class ImageContentRenderer @Inject constructor(
})
request = if (animate && mode == Mode.ANIMATED_THUMBNAIL) {
// Glide seems to already do some dp to px calculation for animated gifs?
val animatedCornerTransformation = RoundedCorners(cornerRoundnessDp)
request.optionalTransform(animatedCornerTransformation)
.transform(WebpDrawable::class.java, WebpDrawableTransformation(animatedCornerTransformation))
//request.apply(RequestOptions.bitmapTransform(RoundedCorners(3)))
request.optionalTransform(RoundedCorners(cornerRoundnessDp))
} else {
request.dontAnimate()
.optionalTransform(cornerTransformation)