Skip to content
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

[Coil 3] Frequent ImageDecoder$DecodeException: Input was incomplete when I try to load an image from PokeAPI #2612

Open
iesedobleac opened this issue Oct 30, 2024 · 4 comments

Comments

@iesedobleac
Copy link

iesedobleac commented Oct 30, 2024

Describe the bug

I've seen that this bug was opened a month or so ago and fixed, but I've reproduced it again in Kotlin Multiplatform with Jetpack Compose. I've checked that it loads fine on iOS and Desktop, but it doesn't load fine on Android.

To Reproduce

Simply mount an AsyncImage and see that the image does not load and in the logs it gives the error mentioned in the title of the issue, anyway I add it in its corresponding section.

The url that doesn't load is https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/10.png but if we try to load any other url (just increase the number before the .png to change the image) it does, I don't know what's so special about that one.

Logs/Screenshots

I 🚨 Failed - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/other/official-artwork/10.png - android.graphics.ImageDecoder$DecodeException: Input was incomplete.

Version

I'm using 3.0.0-rc2 although it also happened in 3.0.0-rc1.

@colinrtwhite
Copy link
Member

colinrtwhite commented Oct 30, 2024

@iesedobleac I think this bug was only an issue for content:// URIs - not images loaded from the network.

For this bug I tried loading the URL in an AsyncImage in the samples:compose app in this repo, but couldn't reproduce. Do you have a code sample that reproduces this?

@iesedobleac
Copy link
Author

iesedobleac commented Oct 31, 2024

@iesedobleac I think this bug was only an issue for content:// URIs - not images loaded from the network.

For this bug I tried loading the URL in an AsyncImage in the samples:compose app in this repo, but couldn't reproduce. Do you have a code sample that reproduces this?

Mmmm that's weird... I'll pass you the link to the repository of the app, I just tried it again 5 minutes ago and the same thing keeps happening, so let's see if it's a casuistry of how I have the code, although it's very basic:

https://github.com/iesedobleac/pokedex-multiplatform

In the App class it has placed the Builder with the logger so you can see by console how it loads all the images except for that one, but in other platforms (iOS and Desktop) it loads them correctly...

The AsyncImage is inside HomeScreen, it has nothing more than the model with the url, a contentDescription to null and a modifier to assign a size to it, I haven't done anything more than that.

@revonateB0T
Copy link
Contributor

Have you configured diskcache? If true, that may because you have a truncated image cache file. If not, StaticImageDecoder is definitely not used for image from network as it doesn't accept stream image source.

@iesedobleac
Copy link
Author

iesedobleac commented Oct 31, 2024

Have you configured diskcache? If true, that may because you have a truncated image cache file. If not, StaticImageDecoder is definitely not used for image from network as it doesn't accept stream image source.

No, I'm not using cache for this configuration, so I discard this. The thing is that it loads the rest of the images except this one, which is the one that gives this error, I don't know why.

Here you can see that where it says "Caterpie" is not loading the image and if I look at the Android logcat logs, the error it gives is the one I put in the main post, but it only happens in Android, it doesn't happen in iOS or Desktop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants