From c4a207fcfe1873f7fb362e2187e5749dd5b448b7 Mon Sep 17 00:00:00 2001 From: gmasil <54176035+gmasil@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:20:24 +0200 Subject: [PATCH] fix missing thumbnails for animated webp files --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index 075a0e4eb..f183fdbf5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -18,6 +18,7 @@ import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.GlideException +import com.bumptech.glide.load.resource.bitmap.BitmapTransitionOptions import com.bumptech.glide.load.resource.bitmap.CenterCrop import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions @@ -545,9 +546,10 @@ fun Context.loadJpg( if (cropThumbnails) options.centerCrop() else options.fitCenter() var builder = Glide.with(applicationContext) + .asBitmap() .load(path) .apply(options) - .transition(DrawableTransitionOptions.withCrossFade()) + .transition(BitmapTransitionOptions.withCrossFade()) if (roundCorners != ROUNDED_CORNERS_NONE) { val cornerSize = if (roundCorners == ROUNDED_CORNERS_SMALL) R.dimen.rounded_corner_radius_small else R.dimen.rounded_corner_radius_big