GlideWebpDecoder is a Glide integration library for decoding and displaying webp images on Android platforms. It is based on libwebp project and takes some implementation from Fresco and GlideWebpSupport as references.
- play animated webp images on all Android versions
- show transparent or lossless webp images on Android devices lower than 4.2.1 (BitmapFactory support webp decode on 4.2+ android system so we have no need to handle)
Library is available in jcenter. If you are build with Gradle, just add the following dependencies to your build.gradle
file
// webpdecoder
compile 'com.zlc.glide:webpdecoder:0.0.5'
// glide 4.2
compile 'com.github.bumptech.glide:glide:4.2.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
Then you are free to use GlideWebpDecoder just like use other Glide integration library.
Notice: if you want to upgrade Glide version to 4.4, please use webpdecoder 0.0.4;
The library use native code to decode webp, so you should put the following lines to your proguard.cfg
and keep the jni interface.
-keep public class com.bumptech.glide.integration.webp.WebpImage { *; }
-keep public class com.bumptech.glide.integration.webp.WebpFrame { *; }
-keep public class com.bumptech.glide.integration.webp.WebpBitmapFactory { *; }
The Library is Apache-2.0, part code is BSD-licensed see Fresco for detail.