AnimatedWebPDecoder
A decoder implementation for Coil to support animated WebP format on Android of which sdk version < 28
Install / Use
/learn @skgmn/AnimatedWebPDecoderREADME
Introduction
An implementation of Coil's Decoder to support animated WebP on Android of which sdk version is less than 28. It depends on libwebp as a native library.
Setup
In your settings.gradle
dependencyResolutionManagement {
repositories {
maven {
url "https://maven.pkg.github.com/skgmn/AnimatedWebPDecoder"
credentials {
username <Your GitHub ID>
password <Your GitHub Personal Access Token>
}
}
}
}
In your app/build.gradle
dependencies {
implementation "com.github.skgmn:animatedwebpdecoder:0.1.2"
}
How to use
Simply add AnimatedWebPDecoder to your ImageLoader.Builder. As stated in here, it is recommended to use with io.coil-kt:coil-gif.
val imageLoader = ImageLoader.Builder(context)
.componentRegistry {
if (SDK_INT >= 28) {
add(ImageDecoderDecoder(context))
} else {
add(AnimatedWebPDecoder())
}
}
.build()
Proguard rules
As it uses native library, it also needs proguard rules. Add these rules to your proguard-rules.pro.
-keep class com.github.skgmn.webpdecoder.libwebp.LibWebPAnimatedDecoder {
java.nio.ByteBuffer byteBuffer;
native <methods>;
}
-keep class com.github.skgmn.webpdecoder.libwebp.LibWebPAnimatedDecoder$Metadata {
*;
}
Related Skills
openhue
333.7kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
333.7kElevenLabs text-to-speech with mac-style say UX.
weather
333.7kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.4kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
