GlideHeifDecoder is a Glide integration library for decoding and displaying still images in HEIC and AVIF formats on Android platforms.It is based on libheif,in which makes use of libde265 for HEIC image decoding,dav1d for AVIF image decoding.
HEIF is a container format for storing individual images and image sequences.HEIC and AVIF are new image file formats employing HEVC (h.265) or AV1 image coding.They both use HEIF as the image container.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency.
dependencies {
implementation 'com.github.msisuzney:GlideHeifDecoder:0.5'
}
Add a subclass of com.bumptech.glide.module.AppGlideModule annotated by @GlideModule to your source directory file in application module,it will automatically load GlideHeifDecoder.
import com.bumptech.glide.annotation.GlideModule;
@GlideModule
public class AppGlideModule extends com.bumptech.glide.module.AppGlideModule {
}
Now, you can load images in HEIC and AVIF formats.
Glide.with(this).load(/*images in HEIC and AVIF formats */).into(iv);
The Library is distributed under Apache-2.0-license.