KTPhotoBrowser icon indicating copy to clipboard operation
KTPhotoBrowser copied to clipboard

Images don't update immediately on iOS 4

Open henrik opened this issue 15 years ago • 3 comments

I use KTPhotoBrowser with SDWebImage.

I'm seeing an issue that seems to happen on iOS 4 but not iPhone OS 3, no matter if the app is compiled for SDK 3 or 4. I haven't tested this thoroughly, so it's more of a suspicion.

The issue is that the large (non-thumb) images are slow to load. Clicking the first thumb in the SDWebImage sample will not even show the local placeholder image until about 5 seconds pass. This is about the same time as the navigation controls fade out, but they're likely unrelated - if I click to hide them quicker, the image still does not show until those 5 seconds pass.

Other than the placeholder loading slow on the first image you view, this issue also turns up when you navigate between several images. Since the browser reuses two KTPhotoViews, navigating the images in order will show image 1 for several seconds when you're supposed to see image 3 or its placeholder.

By logging, it seems that KTPhotoView's setImage: is called when it should, but for some reason the image is not rendered for a while.

henrik avatar Jun 25 '10 10:06 henrik

By the way, see my fork (http://github.com/henrik/KTPhotoBrowser) for a version that builds against SDK 4.

henrik avatar Jun 25 '10 10:06 henrik

Thanks for reporting this. I've noticed issues with iOS 4 as well this week. I will be working on a fixes for iOS 4 as soon as possible, but it's doubtful I will get to it until next week.

kirbyt avatar Jun 25 '10 13:06 kirbyt

Found the problem. setImage: was called in a background thread. A big no-no since setImage: will update the image view. The fix is in the master repo.

Now, I discovered another issue. Seems the large Flickr photos are causing out of memory errors which in turns kills the sample app. I'm not sure why the large images were fine before. I've tested on two devices, a 2nd gen iPod touch and a 3GS. Both run out of memory.

kirbyt avatar Jun 26 '10 01:06 kirbyt