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.
This commit is contained in:
parent
85ef4b3c12
commit
fa6e3a34b5
1 changed files with 1 additions and 1 deletions
|
@ -1298,7 +1298,7 @@ fun blurImage(imageView: ImageView, banner: String?) {
|
||||||
val url = PrefManager.getVal<String>(PrefName.ImageUrl).ifEmpty { banner }
|
val url = PrefManager.getVal<String>(PrefName.ImageUrl).ifEmpty { banner }
|
||||||
Glide.with(context as Context)
|
Glide.with(context as Context)
|
||||||
.load(GlideUrl(url))
|
.load(GlideUrl(url))
|
||||||
.diskCacheStrategy(DiskCacheStrategy.ALL).override(400)
|
.diskCacheStrategy(DiskCacheStrategy.RESOURCE).override(400)
|
||||||
.apply(RequestOptions.bitmapTransform(BlurTransformation(radius, sampling)))
|
.apply(RequestOptions.bitmapTransform(BlurTransformation(radius, sampling)))
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue