Always decode non-animated images as bitmap

This closes https://github.com/FossifyOrg/Gallery/issues/148

TODO: Animate APNG thumbnails.
This commit is contained in:
Naveen 2024-04-16 19:18:21 +05:30
parent 86b22f828a
commit 87086c434c
No known key found for this signature in database
GPG key ID: 0E155DAD31671DA3

View file

@ -540,8 +540,9 @@ fun Context.loadImageBase(
options.optionalTransform(WebpDrawable::class.java, WebpDrawableTransformation(FitCenter())) options.optionalTransform(WebpDrawable::class.java, WebpDrawableTransformation(FitCenter()))
} }
// animation is only supported without rounded corners // animation is only supported without rounded corners and the file must be a GIF or WEBP.
if (animate && roundCorners == ROUNDED_CORNERS_NONE) { // Glide doesn't support animated AVIF: https://bumptech.github.io/glide/int/avif.html
if (animate && roundCorners == ROUNDED_CORNERS_NONE && (path.isGif() || path.isWebP())) {
// this is required to make glide cache aware of changes // this is required to make glide cache aware of changes
options.decode(Drawable::class.java) options.decode(Drawable::class.java)
} else { } else {