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
Repeated views using FXImageView as viewForItemAtIndex #179
Comments
Are you using it with AsyncImageView, or on it's own? |
It may be indicative of a caching issue, especially if you weren't seeing it with the previous FXImageView problem. How are you loading your images - can you show me your viewForItemAtIndex code? |
My custom Block is kind of large, which clutters things up, but here Thanks for all your insight.
} On Sat, Jul 14, 2012 at 9:04 PM, Nick Lockwood
|
Its probably not a good idea to use initWithImage to set the loading image, for a few reasons:
I suggest setting the loading.png image after of the if (view == nil) check, and you should set it using the FXImageView.processedImage property so that the effects are not applied each time you set it - if you want to apply the effects, apply them yourself manually to the image when the app loads and keep the processed image for re-use. The Dynamic Image Effects (aka Reflections) example in iCarousel shows the correct way to set a loading image. Also, as you already suggested, it's not necessary to apply any scaling to the image prior to setting it on the FXImageView because FXImageView already scales or crops it according to the contentMode, so just set the FXImageView contentMode to aspect fit or whatever it is your scaling logic is currently doing. |
Thanks, this is very helpful. I adjusted the loading image to the appropriate place and that Sadly, I still see quite a bit of erroneous image placement. This My GroupImageView subclasses view and overrides drawRect with the Clearly though, my GroupImageView results in much less smooth Any other thoughts as to why I am seeing improperly loaded images? Is Thanks again, On Sat, Jul 14, 2012 at 9:36 PM, Nick Lockwood
|
I think the key priority is to define some steps to reliably reproduce the issue. If you can reproduce it consistently it will be much easier to fix. |
Thinking about it a bit more, if this is still happening in synchronous mode, it's unlikely to be threading related, and the actual drawing logic for the setImage: method is extremely simple, so the chances are it's a caching problem. Try string the customEffectIdentifier to match the item index - that should act as a fairly effective cache buster. If that doesn't work, try disabling the cache altogether by modifying the FXImageView setImage: method. |
Finally got a chance to revisit the issue. Things I have found so far:
Proceeding to follow your advice (didn't see it until I came to post this) |
More notes:
FOUND IT - ((FXImageView *)view).processedImage = [UIImage imageNamed:@"Loading.png"]; Commenting out the 'loading' image resolves the issue. |
A suggested fix. I am not sure if this is breaking other things, but I have found that if I comment out line 483 of FXImageView.m, I am able to use the processedImage as expected (loading up a placeholder image). For clarity: (void)setProcessedImage:(UIImage *)image |
Hmm... I don't think the fix makes sense in terms of how the method should be working. I'll think about it some more. |
Yea, I had a feeling it wasn't the right thing to do, that there was something happening that wasn't expected. I figured it would be helpful though as you clearly know the intent more than I. |
btw, I tried the demo program again and was not able to recreate the issue I am seeing in my project. As a result, I am assuming you haven't seen this yet live. I am wondering if the images weren't stored in the project, like they are in the demo, if that would help you recreate it? My thought is that the issue has to do with the delay that is present in retrieving an ALAsset, though that seems a little far fetched. The group images typically return pretty quickly (they aren't asynchronous as full assets are) but it still could be an issue. Haven't come up with any ideas on this that were solid, so I figured I would pass the above thoughts back to you and see if they spurred any more insight. |
Hey Nick, |
Unfortunately I've not had a chance to look into this in detail yet. I've identified some bugs in the library that I will need to address, but nothing that would account for the issue you are seeing. In particular the fact that it still happens when operating synchronously eliminates most of the potential explanations. When you load your assets, are you doing the loading on a thread before passing the image to FXImageView? If so, what does that code look like? |
Nick, No, right now we are loading the images directly in the viewForIndex Cheers, On Wed, Jul 25, 2012 at 8:11 PM, Nick Lockwood
|
Hello again. I've still not been able to reproduce this problem, but I did release an update to FXImageView that fixes a few caching bugs, so it may be worth trying again with the new version. |
Thanks Nick, I just checked it out and found the same results. If I comment out, now Considering what I am commenting out, my theory is that for some reason the I will try and dig back into it again sometime soon and see if I can be On Tue, Aug 21, 2012 at 8:34 AM, Nick Lockwood notifications@github.comwrote:
|
Are you setting your FXImageView.processedImage placeholder before or after you set the FXImageView.image for processing? |
Before R On Thu, Aug 23, 2012 at 3:58 AM, Nick Lockwood notifications@github.comwrote:
|
Hmm... Well that should be correct. It makes it even more strange that commenting the line you did would make any difference since you're immediately overwriting that value. I appreciate you're probably getting bored of trying new versions by now, but if you get a chance please try version 1.2.2 which fixes some issues I spotted this morning that may conceivably relate to your bug. And as always, if you have a project that demonstrates the problem in a consistently reproducible way, I'd love to see it. |
Nick Still no good, although I am seeing a crash bug occasionally now... it Not sure why I didn't do this earlier, but I forked your repo and created a Cheers, On Thu, Aug 23, 2012 at 11:57 AM, Nick Lockwood notifications@github.comwrote:
|
Now fixed. |
After installing the latest version of FXImageView (which is great by the way), I have noticed that occasionally I am seeing repeated images displayed in my carousel. This can happen while scrolling and when I come to a stop, an image appears to not update from it's previous version. I have also seen it when loading a brand new carousel, with the first item having the wrong image.
I am curious if this is indicative of a cache problem or a background processing issue? Any thoughts on how best to determine the root cause? I haven't been able to obtain repeatability yet unfortunately.
Cheers,
The text was updated successfully, but these errors were encountered: