onLevelChange gif issue
Hi! I think you can help me. We are using your awesome library to show jpg/png/gif images with the progress bar. With the jpeg and the png images everything work fine, but when we load gif, onLevelChange callback we get 10000, but the gif is shown after 10-25 seconds. How we can solve this issue?

Is this an animated or static image? Can you give me the url so that we can test it our end? It sounds like it's taking a long time for the image to load after it is downloaded/retrieved from cache, but I'm not sure why that would be the case.
Animated image.
We are facing this problem with some big gif, for example http://ta-ty-sho.com/wp-content/uploads/2015/04/gifki-gif-animatsia-multfilm-kot-v-sapogakh-i-t.gif
If the gif has cached, it take 1-2 seconds for appearance this gif image, but if it has loaded first time, we have that problem.
We tried to use the callback "onFinalImageSet" to intercept the downloading animation, but it worked after 10-25 seconds after onLevelChange level == 10000
Same issue,after progressBarImage disappear fresco need a short time to show the gif. But after first loaded when gif show again ,it has no delay at all.
It looks like this is a bug in Fresco - when we fetch an image from disk cache successfully, we say that the request is 100% completed, when we fact we still need to do the decode. For an animated GIF like the above one, the decode can take a long time, leading to the gap that you notice above.
@IanChilds Do you have a recommendation for how to work around this issue for now?
Can you use it in conjunction with the onFinalImageSet callback?
@IanChilds yeah, we try to use it, but have no idea how we can connect onFinalImageSet with ProgressBarDrawable
Don't you have access to the ProgressBarDrawable when you construct your listener for the DraweeController?
Yeah, that is my code that extends GenericDraweeView and override setUri: http://pastebin.com/UhcW0vPw
You need to add a ControllerListener to the DraweeControllerBuilder that overrides onFinalImageSet
I tried this code http://pastebin.com/TAem1tta ProgressBar passed very fast, but the animation appeared after 10-25 seconds
Yeah the problem is that the progress bar gets faded out when the progress is set to 100.
I wonder if it's possible to make this work by setting the progress bar to be the placeholder image too? Can you try that?
We should handle this on the pipeline level. It is hard to estimate the decoding time, but my hunch is that there are two main components here: the size in bytes of the image and the decode queue length (in bytes).
We could make decode producer do some heuristics like:
out_progress = f(in_progress, estimated_decode_wait_time)
out_progress is the progress that decode producer reports to its parent
in_progress is the progress of the child producer (e.g. network fetch progress)
f(in_progress, wait_time) could be something like in_progress * 0.9 + exp(-C1 * wait_time) * 0.1.
estimated_decode_wait_time could be something like C2 * (total_bytes_in_the_decode_queue_including_the_current_image)
There is no optimal solution to this problem, all we can do is to provide an estimate. This is just one idea.
Have you solved the delay problem? How ?
I believe this should be solved by da9b7f162bb31f538bda2f34e83ac505f0e67a39.