glide
glide copied to clipboard
AVIF support not working properly
Glide Version: 4.13.0, 4.13.1
Integration libraries: okHttp - 4.9.0
Device/Android Version: Samsung Fold/A12
Issue details / Repro steps / Use case background: Added avif integration dependency but getting black instead of transparency for the PNGs.

Similar issue has been created on AOMediaCodec which is being used by Glide - https://github.com/AOMediaCodec/libavif/issues/876
Glide load line / GlideModule
(if any) / list Adapter code (if any):
RequestBuilder<Bitmap> mainRequestBuilder = GlideApp.with(imageView)
.asBitmap()
.load(mainURL)
.thumbnail(GlideApp.with(imageView).asBitmap().load(thumbUrl).apply(requestOptions))
.apply(requestOptions)
.listener(new MyImageLoadListener(listener));
Have also tested the AVIF on Glide's sample app too, getting the same error.
Layout XML:
<FrameLayout xmlns:android="...
Stack trace / LogCat:
paste stack trace and/or log here
Hi,
Are you trying to load an AVIF file or a PNG file? If you are loading a PNG file, the AVIF integration should have no effect on how that is loaded. The file that you have attached seems to be a PNG file.
Hey @vigneshvg, cdn providers convert the images into the requested format so they are giving us the avif formats only, but glide is not able to handle the transparency I guess. I read that AVIF is suitable for transparency as well.
Hey @vigneshvg, cdn providers convert the images into the requested format so they are giving us the avif formats only, but glide is not able to handle the transparency I guess. I read that AVIF is suitable for transparency as well.
The AVIF glide extension should be able to handle AVIF images with alpha transparency as it outputs to an RGBA_8888 Bitmap.
I am still not sure if you are trying to load an AVIF image or a PNG image. If it is an AVIF image, is there any way you can attach the image so that i can take a look at why it is not loading?
Sure, here's a test AVIF file - https://raw.githubusercontent.com/ZAsheesh/Test/main/a.avif
Sure, here's a test AVIF file - https://raw.githubusercontent.com/ZAsheesh/Test/main/a.avif
Thank you, i will take a look.
Sure, here's a test AVIF file - https://raw.githubusercontent.com/ZAsheesh/Test/main/a.avif
I am able to load this image file successfully with the Glide AVIF integration. Is there a specific error message that you see?
yeahh it's working fine on 4.13.1
@vigneshvg noticed that the image caching is different in 4.13.0 and 4.13.1. If I am on 4.13.1 then if i move back to 4.13.0 then i am getting loading issues unless i clear the image cache manually. Can you please check for the compatibility or at least mention that somewhere?
Tagged release 4.13.2 should fix AVIF related issues: https://github.com/bumptech/glide/releases/tag/v4.13.2
Seems like v4.13.2 was released on May 4, 2022 - @vigneshvg @tronku should this issue be closed now?