-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVIF Image Rendering Issues on Android 12+: Black Backgrounds #5140
Comments
@vigneshvg, do you think the platform decoder is having trouble decoding AVIF images? Including the glide avif integration library fixes this issue (it is now using the decoder provided by the integration library). |
The platform decoder does NOT support alpha transparency. The platform decoder also has other limitations (it only supports 8-bit and 10-bit YUV420 AVIF images). Android 14 removes some of those limitations (but transparent images are not supported still). If you need to use transparent images (or any other AVIF feature not supported by the platform), you would have to use the AVIF Glide Integration library. Also, note that the underlying decoder used by the integration library had a bug with transparent images which was fixed in #5128. There hasn't been a Glide release with that patch included yet. So you may want to update your local Hope that helps. Please let me know if you have any other questions. |
Wait, there is an addon-library of loading AVIF via Glide even on old versions of Android? |
Yes there is! That is exactly what the Glide AVIF integration library does (i.e.) if you use the integration library, it will bundle an AVIF decoder along with your app and it will work the same irrespective of the version of Android that the app is running on.
It is fairly straightforward if you are already using Glide. See here for details: https://bumptech.github.io/glide/int/avif.html
I don't know the exact answer for this. It uses libavif underneath. So you would have to check about the licensing yourself. |
@vigneshvg Thank you. Hope to check it out some time. |
Glide Version: 4.14.2
Integration libraries: none
Device/Android Version: Samsung Galaxy M52 / Android 13
Use case background:
Android 12 introduces support for AVIF images. So starting Android 12, Glide should be able to decode AVIFs without avif-integration library. However, when used without the avif integration library, the avif images are sometimes not rendered or rendered with a black background (the image has transparent parts).
I also tested this on a Pixel 6 Pro running Android 12. The image did not render.
I am not sure whether this is a platform issue or an issue with the way glide processes avif images but I do see the devices have a decoder that supports video/av01 format.
The sample project can be found here.
The text was updated successfully, but these errors were encountered: