luberda-molinet / FFImageLoading

Image loading, caching & transforming library for Xamarin and Windows
MIT License
1.42k stars 377 forks source link

Xamarin.forms 4.1 and ffimage image loading issue #1323

Open softsan opened 5 years ago

softsan commented 5 years ago

Description

Xamarin.forms 4.1 and ffimage latest doesn't work properly. in my app when first start of app all images are loading. but if i navigate to another page and come back to main page, my images are not loading. However, if i downgrade Xamarin.forms to 3.6 then its working fine.

Steps to Reproduce

Expected Behavior

It should load images everytime

Actual Behavior

Doesn't load images everytime. Only loads it on first time.

Basic Information

Screenshots

Reproduction Link / Code

candidodmv commented 5 years ago

I'm with troubles to try set SvgImageSource in contentPage IconImageSource. Svg files not appearing

karthic1986 commented 5 years ago

I also have the same issue with the latest Xamarin.forms 4.1

Fahad-Ali-Qureshi commented 5 years ago

I have also this issue. Sometimes image appear and sometimes won't. Tested on Android 6, 7, 8.1

Xamarin.Forms 4.1.0.618606 Xamarin.FFImageloading 2.4.11.982 Xamarin.FFImageloading.Forms 2.4.11.982 Xamarin.FFImageloading.Transformations 2.4.11.982

karthic1986 commented 5 years ago

I also have the same issue with the latest Xamarin.forms 4.1

now my side works perfectly.. I make some coding mistake (No issue with ffimage)

Fahad-Ali-Qureshi commented 5 years ago

I have also this issue. Sometimes image appear and sometimes won't. Tested on Android 6, 7, 8.1

Xamarin.Forms 4.1.0.618606 Xamarin.FFImageloading 2.4.11.982 Xamarin.FFImageloading.Forms 2.4.11.982 Xamarin.FFImageloading.Transformations 2.4.11.982

Downgrading FFImageloading to version 2.4.9.961 now working with Xamarin.Forms 4.1.0.618606. But, little bit hanging while loading images.

padotj commented 5 years ago

I also have this issue. Using 2.4.11.982 and after downgrading to 2.4.9.961. Tested using Xamarin.Forms 4.1.0.618606 on iOS 12.

One caveat. I also use a custom HttpClient in the image service to pass a user agent. I’m using ffimageloading to present url ImageSource a from Shopify’s CDN.

I most often experience this after returning from sleep.

I notice that when the ffimageloading.cachedimage stops working, none of the events are fired either. I have handlers on DownloadStart, Success, Finish, and Errors.

I also use loading and error placeholder images. When the app first starts, or before the controls stop working, my loading placeholder will show as expected. Afterwards, nothing.

jdluzen commented 5 years ago

I'm new to FFImageLoading, so I initially thought it was something that I was doing, but I am getting something similar to this too on XF 4.2.0.709249. So far it only happens in the debugger on app startup. My guess is that it's some kind of race condition. All of my images are local.

EmilAlipiev commented 5 years ago

I'm with troubles to try set SvgImageSource in contentPage IconImageSource. Svg files not appearing

Since when is IconImageSource is supported with this library? how do you even do that? can you show an example?

candidodmv commented 5 years ago

Hello @EmilAlipiev ! Xamarin.Forms has unified it's API for ImageSource, due to this, now it's possible to use several ways to manage images in Xamairn application. To this, you must use an custom 'ImageHandler' that is provided from 3rd party libraries like FFImageLoading instructions can be found here https://github.com/luberda-molinet/FFImageLoading/wiki/Xamarin.Forms-Advanced#iimageviewhandler--iimagesourcehandler

After this you will be able to set SvgImageSource provided by FFImageLoading in any kind of Xamarin.Forms controls has image property, but there are some bugs, so you can face some trouble depending where you want to apply svg as image source.

You can find more details in these links (and others that i didn't find): https://github.com/xamarin/Xamarin.Forms/issues/6477 https://github.com/luberda-molinet/FFImageLoading/issues/1297

EmilAlipiev commented 4 years ago

@candidodmv i dont see CachedImageRenderer.InitImageViewHandler() as mentioned in the documentation. is it somehow replaced with just Init() ? if yes, i dont understand how it works. i tried using Button ImageSource but it doesnt work for me. do you have any sample how it should work?

candidodmv commented 4 years ago

@EmilAlipiev CachedImageRenderer.InitImageViewHandler() it's not a replace for FFImageLoading.Init(), you must call after the default plugin initialization. I don't have a sample code on the hand to share, but I believe that you can easy find searching on github.

ppvictory commented 4 years ago

I too am affected by this bug. Unfortunately I do not have any reproduction steps, but it seems to occur on versions of XF from 3.6-4.2 used with FFImageloading 2.10.972 and greater. As per the advice here, downgrading to 2.4.9.961 fixes the issue.