-
Notifications
You must be signed in to change notification settings - Fork 378
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
Regression - Image disappears once full resolution is loaded #309
Comments
Anyone looked at this? Any new information needed? |
do you have a sample project i can look at? |
I am facing the same problem. When I load multiple images in NYTPhotoViewerController , at first all images all loaded. And I can swipe to all images perfectly fine. Once all images are loaded, on image change screen turns black, in my debugging I can see the proper image with size is return but as soon as photoViewController.update(photo) is called, The screen goes black and so on. |
Sorry for the delay. Does this reproduce in either Example apps? I tried, (see branch |
I don't know if it's the same root cause, but I'm able to reproduce this consistently whenever the placeholder image is the same size as the full image, and the full image is loaded after the placeholder has been displayed. This is easy to reproduce using the example Swift app if you make the following change: diff --git a/Examples/Sources/Swift/PhotoBox.swift b/Examples/Sources/Swift/PhotoBox.swift
index ff42727..cf9f719 100644
--- a/Examples/Sources/Swift/PhotoBox.swift
+++ b/Examples/Sources/Swift/PhotoBox.swift
@@ -22,7 +22,9 @@ final class NYTPhotoBox: NSObject, NYTPhoto {
var image: UIImage?
var imageData: Data?
- var placeholderImage: UIImage?
+ var placeholderImage: UIImage? {
+ return UIImage(named: value.name)
+ }
var isPhoto: Bool {
return value.itemType == .image And just to verify that it's not an issue with the images being the same reference (which they would be in my example modification above), here's a snippet of a debugging session in my app:
|
thanks, i'll give this a try (in the next day or two) |
I reproduced the issue, thanks for the how-to. I think this is a manifestation of this issue pinterest/PINRemoteImage#591. |
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
The text was updated successfully, but these errors were encountered: