From fa6e3a34b539c3953c2caf80973fbac84840427c Mon Sep 17 00:00:00 2001 From: TwistedUmbrellaX <1173913+AbandonedCart@users.noreply.github.com> Date: Sat, 23 Mar 2024 21:07:02 -0400 Subject: [PATCH] fix: prefer caching the final version (#283) While caching the original and the final seems like an ideal way to reduce overhead, you cache an original copy of the image and the modified copy of the image to only ever load the modified copy. The size is set, meaning you are not reusing the original image. There is no reason to cache it. --- app/src/main/java/ani/dantotsu/Functions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ani/dantotsu/Functions.kt b/app/src/main/java/ani/dantotsu/Functions.kt index 73754465..c8962104 100644 --- a/app/src/main/java/ani/dantotsu/Functions.kt +++ b/app/src/main/java/ani/dantotsu/Functions.kt @@ -1298,7 +1298,7 @@ fun blurImage(imageView: ImageView, banner: String?) { val url = PrefManager.getVal(PrefName.ImageUrl).ifEmpty { banner } Glide.with(context as Context) .load(GlideUrl(url)) - .diskCacheStrategy(DiskCacheStrategy.ALL).override(400) + .diskCacheStrategy(DiskCacheStrategy.RESOURCE).override(400) .apply(RequestOptions.bitmapTransform(BlurTransformation(radius, sampling))) .into(imageView) }