Cardview: CachedImages (FFImageLoader) appear with wrong placeholder image in a CarouselView

Created on 10 Sep 2018  路  16Comments  路  Source: AndreiMisiukevich/CardView

Hello Andrei!
We have an application where we would like to use your plugin to show images to users in a CarouselView (just CV from now on) using CachedImages from FFImageLoading. The only issue is that when we have many pictures in a CV and view caching is on, pictures can show the wrong image as they were cached before. However when caching is off, the pictures are fine, but switching quickly between them crashes the app on iOS (the exception talks about the collection mutating while being enumerated). This property being off and causing this kind of issue is probably not the fault of your CV while the first problem could be caused by it.
I'm still not sure if the problem is here or in CachedImage, but maybe you can check your code out for possible issues regarding the caching mechanism.
Any kind of help would be appreciated.

3rd_party_bug question resolved

All 16 comments

Hi
What version of CardsView do you use?
What do you mean, when speak about caching? Is it CardsView IsViewCacheEnabled or FFImage?

Could you please provide me the small sample ? Also it would be great if you could test it with regular Xamarin Image

We are using version 1.5.8 currently (used it for it still having an ItemTapped event, definitely gonna update it as I saw giving it a TapGestureRecognizer works now).
By caching I mean IsViewCacheEnabled, since CachedImage does the caching automatically for us without setting any property.
The code that uses these features looks like this: https://pastebin.com/H67dXaeb (Here MediaItems contain the ImageSourceUrl and the PlaceholderImageSourceUrl)
Changing CachedImage to Xamarin Image fixed it mostly, but downloading the images everytime the user enters this page with the pictures would mean a problem for them especially if they use a cellular network. This is why we used the former method.
Hope this helps, and thanks for your quick response.

I think, you should to update to latest version
Add TapGesture by yourself and try these two approaches again )

Alright, I'm going to try it, then come back with the results.

Okay, so I checked out the new version. It didn't fix neither the crashing on iOS with IsImageViewCaching=false or the the problem with CachedImage placeholder images appearing on the wrong pictures on both platforms.
Also noticed that even while the mentioned property is off not all views appear in the CarouselView. For example the indicator shows there are 8 views in the CV while it only has 6 children views. This image can help to understand it:
image
It might be intentional, just thought I might ask it, since I feel like it is perhaps connected to my issue. What would happen if all the views would be present when IsImageViewCaching=false?

Sorry, i don't understand
You said that there are 6 items, but we see 8

Could you please create small sample project. i will appreciate it

Of course, here it is: CVBugSampleProject.zip
Also, the issue in the picture above is probably just a debugger problem, not caused by the code. Sometimes the Visual Studio debugger can show weird results.

Thank you, i will check it on weekend)

if somebody wants to debug it, i will be grateful))

Tried on iOS. It works fine
Is it Android issue?

Also, what does it mean "we see wrong images".
Does it mean, that we see wrong image during several seconds, then see right image?

So, you can try such workaround

image

But set MaxChildrenCount and DesiredMaxChildrenCount to 100 =)

So, every item will have own view =)

Okay, thank you. Will try it on monday, hope it will work in our app :)

Also the answer for your question is yes, you see the wrong one for 1 second then it fades to the correct picture

@tasger22 ok, i see)
you can see wrong image, because there are 4-5 views at all. They are shared among all items from itemsSource. I made it for better performance (we needn't create new view each position change).

Well, i think you can create ticket for FFImage (show loading preview if we change source)
As I see, FFImage shows LoadinPlaceholder only if it is first image loading..

@tasger22 ping me if it won't help you))
I will continue researching

Was this page helpful?
0 / 5 - 0 ratings

Related issues

troyvnit picture troyvnit  路  8Comments

ssotir picture ssotir  路  7Comments

JTOne123 picture JTOne123  路  5Comments

alicint picture alicint  路  3Comments

jolugarbe picture jolugarbe  路  8Comments