glide
glide copied to clipboard
[avif-integration:4.13.2] gif can't play
trafficstars
after implementation "com.github.bumptech.glide:avif-integration:4.13.2", gif can't play, avif seems to conflict with gif
Can you elaborate on what the "conflict" is?
Can you also please provide your build.gradle, GlideModule and the Glide usage code snippet?
I have the same problem!
implementation "com.github.bumptech.glide:glide:4.13.0"
kapt "com.github.bumptech.glide:compiler:4.13.0"
I use like this:
Glide.with(context)
.asGif()
.load(R.mipmap.audio_player)
.into(binding.imgPlayer);
don't prepend avif decoder
@Excludes(AvifGlideModule.class)
@GlideModule
public class MyAppGlideModule extends AppGlideModule {
@Override
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
AvifByteBufferBitmapDecoder byteBufferBitmapDecoder = new AvifByteBufferBitmapDecoder(glide.getBitmapPool());
registry.append(ByteBuffer.class, Bitmap.class, byteBufferBitmapDecoder);
AvifStreamBitmapDecoder streamBitmapDecoder = new AvifStreamBitmapDecoder(registry.getImageHeaderParsers(), byteBufferBitmapDecoder, glide.getArrayPool());
registry.append(InputStream.class, Bitmap.class, streamBitmapDecoder);
}
}
When I load Gif with Glide,I get this error
Glide.with(MainActivity3.this).asGif().load(url).into(avifImageView);
Error Message
Glide: Load failed for https://m.360buyimg.com/img/jfs/t1/129036/4/30192/13427/62fc95fcEdbf170b1/a4ad061bb3788b71.gif.avif with size [660x660]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
Cause (1 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->GifDrawable->GifDrawable}, DATA_DISK_CACHE, https://m.360buyimg.com/img/jfs/t1/129036/4/30192/13427/62fc95fcEdbf170b1/a4ad061bb3788b71.gif.avif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->GifDrawable}
Cause (2 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->GifDrawable->GifDrawable}, DATA_DISK_CACHE, https://m.360buyimg.com/img/jfs/t1/129036/4/30192/13427/62fc95fcEdbf170b1/a4ad061bb3788b71.gif.avif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->GifDrawable}
Cause (3 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{DirectByteBuffer->GifDrawable->GifDrawable}, REMOTE, https://m.360buyimg.com/img/jfs/t1/129036/4/30192/13427/62fc95fcEdbf170b1/a4ad061bb3788b71.gif.avif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{DirectByteBuffer->GifDrawable->GifDrawable}
Cause (4 of 4): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->GifDrawable->GifDrawable}, REMOTE, https://m.360buyimg.com/img/jfs/t1/129036/4/30192/13427/62fc95fcEdbf170b1/a4ad061bb3788b71.gif.avif
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->GifDrawable}
after i add asGif(), it normal