Android: Specific Avif image fails to load
Description
Hello, I'm having a peculiar issue where a very specific image is not loading in on Android.
- Avif format
- Other Avif format images do work correctly
- Converting the image to other formats "fixes" the issue, although this is not an actionable solution
- Regardless of URI / File source type.
By digging into this a bit, it looks like Glide is failing to load the image. Yet, there's nothing suggesting why this is happening.
From the sample project, you'll see how there's simply a blank space where the image is supposed to be:
Steps to Reproduce
No response
Link to public reproduction project repository
https://github.com/armanimichael/maui-image-sample
Version with bug
8.0.61 SR6.1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
No response
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
- Images don't load correctly on Android (#6464), similarity score: 0.75
- <Image> cannot load image from URL on Android (#6295), similarity score: 0.74
- Image from byte[] source doesn't work on Android (#6256), similarity score: 0.74
- [regression/8.0.0-preview.6.8686] Image not loading (#16364), similarity score: 0.73
- Loading image using ImageSource.FromFile not working on Android (#6583), similarity score: 0.73
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
I can repro this issue at Android platform on the latest 17.11.0 Preview 2.1(8.0.61).
I've opened an issue on the appropriate repository to add the NuGet package for AVIF support.
When available also remember about: https://github.com/bumptech/glide/issues/5140#issuecomment-1550067008
@armanimichael @albyrock87
Does AVIF work on other platofrms?
@moljac on iOS it does work, I have to information regarding other platforms
@armanimichael @albyrock87
Are you sure that just by adding new package this will be resolved?
@moljac unfortunately I couldn't try this due to the missing NuGet package.
I'll try to see if I can create a java app in order to verify this.
My assumption is simply based on Glide's documentation. To fix this issue we need the NuGet and then we have to modify the Gradle configuration so that Glide "sees" that plugin. Automatic plugin loading is also explained in Glide docs.
@moljac unfortunately I couldn't try this due to the missing NuGet package.
No. No. There is no nuget. Sorry for confusion
I'll try to see if I can create a java app in order to verify this.
Please do not waste your time. I created new bindings, but dependecy package is using some crazy versioning format which is not SemVer 2 nor Nuget legacy, so I need to fix tooling 1st.
My assumption is simply based on Glide's documentation. To fix this issue we need the NuGet and then we have to modify the Gradle configuration so that Glide "sees" that plugin.
This "seeing" part worries me. There is no Gradle when using nuget package. Hopefully we don't have to add too much. We'll see after bindings are ready.
Automatic plugin loading is also explained in Glide docs.
Plugin in Maven usually indicates that MSBuild tasks (tricks and hacks) will be needed.
@albyrock87
NuGet package has been published:
https://www.nuget.org/packages/Xamarin.Android.Glide.AVIF.Integration
Tried adding nuget package, but did not work.
Repro sample[s]:
PR created
https://github.com/dotnet/maui/pull/25376
@armanimichael @albyrock87
Nuget was published and I created PR https://github.com/dotnet/maui/pull/25376 that should fix this issue, but (as always) does not work.
I am working on native android minimal repro sample to see if there is something else needed. Namely I am afraid we might also need
https://mvnrepository.com/artifact/com.github.bumptech.glide/compiler
But not 100% sure.
In the PR there is also sample code
src/Controls/samples/Controls.Sample.Sandbox/MainPage.xaml
with images from your sample.
Nuget is added to the Core
src/Core/src/Core.csproj
thanks