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
Progressive image not so progressive #332
Comments
Hi, loading from localhost is probably simply too fast. That's why the demo uses a custom loader in which I can control the size of the data chucks and how fast they are delivered. Please also make sure the image is actually encoded as progressive jpeg. |
Hi @kean, thanks for your fast answer! The image is actually progressive, i've tested it on a site: Second, the load isn't too fast because the image has actually 70MB size. Here is the url of the image (a smaller version): Click Me The progress completion never gets called. UPDATE: I've managed to make it work using the following code: The problem is:
Also, what about this ? Any ideas? |
Could you please upload the image that you are using for testing so that I could reproduce it? |
Download: Is there any settings that should be made for the webserver? I guess not. |
It works if you put it in a demo app. I tested in on an iOS simulator. I didn't test on a device (assuming you are testing in on an iOS device). The image is clearly too big for an iOS device. This might be causing the issues, depending on which hardware you run it. I would suggest not downloading images this size, downsampling them on the server. If not possible, downsampling on a device: ImageRequest(url: url, processors: [ImageProcessor.Resize(size: .init(width: 1000, height: 1000))] You can learn more by watching this WWDC session https://developer.apple.com/videos/play/wwdc2018/219/ I would strongly advise against rendering images this size, especially if you are doing this on iOS devices. |
"It works if you put it in a demo app. I tested in on an iOS simulator." Did you loaded it from an URL or from the app it-self? Still getting nil in the progress callback even for 45kb images: progress: { progress, completed, total in |
There should be no difference where data is coming from. The only difference is how fast the data is downloaded and in how many chunks it is delivered. If the download is too fast, and Nuke doesn't have enough time to produce any intermediate images, it will only produce the final image.
Progress handler currently serves two purposes:
If none intermediate images are delivered, only the download progress is reported. |
For example, if the image gets cached in the standard |
I'm only interested in getting intermediate images until the download finishes. |
My best guess is that the download happens too fast since all the links you shared so far were referencing localhost. Another thing that you should take into account when debugging this, is that by default, Nuke decompresses the downloaded images on the background thread. Decompression takes time. For an image this big it could be seconds. I think that’s all the information that I can give. To debug, see ImagePipeline class. Another thing you can do is enable OSLog signposts and use profiler - they might give you and idea what is happening when the image is loaded. |
Ok, thanks so much for your time. |
No worries, if you have any specific questions, I’ll be happy to help. |
@kean |
Hello,
I'm trying to use the progressive decoding feature of Nuke.
The productImage ImageView never gets the image ..
Any clues about this?
Your example lacks in information because it only loads images from the app resources and loading from an URL is far way complicated.
Thanks in advance.
The text was updated successfully, but these errors were encountered: