glide icon indicating copy to clipboard operation
glide copied to clipboard

[avif-integration:4.13.2] gif can't play

Open markz-code opened this issue 3 years ago • 3 comments
trafficstars

after implementation "com.github.bumptech.glide:avif-integration:4.13.2", gif can't play, avif seems to conflict with gif

markz-code avatar May 12 '22 12:05 markz-code

Can you elaborate on what the "conflict" is?

Can you also please provide your build.gradle, GlideModule and the Glide usage code snippet?

vigneshvg avatar May 17 '22 21:05 vigneshvg

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);

guozhiqiang123 avatar Jun 17 '22 08:06 guozhiqiang123

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);
    }
}

yvonnelyf avatar Jul 20 '22 02:07 yvonnelyf

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}

WizzXu avatar Aug 25 '22 03:08 WizzXu

after i add asGif(), it normal

markz-code avatar Aug 31 '22 12:08 markz-code