qdsfdhvh/compose-imageloader

Missing local downloaded images (svg) on Android

VitalyPeryatin opened this issue · 10 comments

Some images are lost after recompose screen (for example returning back to screen with images)
image

Logger doesn't show any errors:
image
image

I use library such way:
image
image

mapper log has probilem and i fixed it #58. This missing image is display at the beginning and not displayed after return back? Can you try to give Icon or Image a fixed size and can it be displayed properly?

This missing image is display at the beginning and not displayed after return back?

Yes. All images are displayed at the begining, but some images are missed after return back. Approximately every second time after returning back 1 of 5 images are missed. Probably there is a problem with asynchronous work

Can you try to give Icon or Image a fixed size and can it be displayed properly?

If I set a fixed size for Icon or Image, svg file not displayed after returning back too

I use this library in my OpenSource project 1Coin, so you can check behavior of icon loading yourself (if it can help you)

I've read that the problem is roughly the following here, If the Icon not have a defiend size, it's might possible not to get a valid size here in time; I'll fix it, but maybe need one day.

For svg images, Icon and Image if no Modifier.size, the default SizeResolver in AsyncImagePainter may not fetch size.
It is recommended that prioritize the configuration of Modifier.size if you can, otherwise:

ImageRequest { size(SizeResolver(DpSize(24.dp, 24.dp))) } 

PS: 24.dp is Icon default size, I also set it as default in library if not fetch size.

1.2.10 Uploading in progress, try to see if it is solved

There is still a problem with the default svg size in library, I will fix later.

Bug is fixed. Thank you!

I would like to thank you. How can I donate to you?)

Thank you very much, I will enable GitHub Sponsor later