Merge pull request #2929 from gmasil/bugfix/fix-missing-thumbnails-for-animated-webp-files

fix missing thumbnails for animated webp files
This commit is contained in:
Tibor Kaputa 2023-08-02 11:07:23 +02:00 committed by GitHub
commit fe6beacc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -18,6 +18,7 @@ import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.DecodeFormat import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.load.engine.DiskCacheStrategy import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.load.engine.GlideException 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.CenterCrop
import com.bumptech.glide.load.resource.bitmap.RoundedCorners import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions
@ -545,9 +546,10 @@ fun Context.loadJpg(
if (cropThumbnails) options.centerCrop() else options.fitCenter() if (cropThumbnails) options.centerCrop() else options.fitCenter()
var builder = Glide.with(applicationContext) var builder = Glide.with(applicationContext)
.asBitmap()
.load(path) .load(path)
.apply(options) .apply(options)
.transition(DrawableTransitionOptions.withCrossFade()) .transition(BitmapTransitionOptions.withCrossFade())
if (roundCorners != ROUNDED_CORNERS_NONE) { 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 val cornerSize = if (roundCorners == ROUNDED_CORNERS_SMALL) R.dimen.rounded_corner_radius_small else R.dimen.rounded_corner_radius_big