NYTPhotoViewer icon indicating copy to clipboard operation
NYTPhotoViewer copied to clipboard

Regression - Image disappears once full resolution is loaded

Open StainlessStlRat opened this issue 4 years ago • 7 comments

I was really excited to see that NYTPhotoViewer had finally gotten an update. Unfortunately, there's been a regression.

I have an object derived from NYTPhoto that pulls the "placeholder" image from cache if available. In my case, the placeholder is basically a thumbnail. When "image" is called, I kick off an asynchronous web fetch, that once finished will call updatePhoto:photo on the photosviewcontroller.

This works fine on 2.0 but when the "image" is updated, it clears the image and doesn't load the new one unless you touch the screen/begin to slide.

It appears to get chugged up somewhere on the new Pinterest image stuff that replaced FLAnimatedImage. While debugging, the whole system freezes on me making it difficult to see what's actually happening, but it appears basically stuck after this:

// Animated Image can take a while to dealloc, let's try and do it off main. __block PINCachedAnimatedImage *strongAnimatedImage = previousAnimatedImage; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ strongAnimatedImage = nil; });

If I never call update, the view never gets blanked (but I also don't get my fullscreen image).

Another interesting facet of this bug is that it only happens on the first view if it's a series of images. The second, third, etc... all load up fine (first with thumb, then with full image).

See linked video here: https://imgur.com/a/VgwkEwz

StainlessStlRat avatar Apr 06 '20 07:04 StainlessStlRat