Baseflow / flutter_cached_network_image

Download, cache and show images in a flutter app
https://baseflow.com
2.43k stars 654 forks source link

progressive image loading #43

Open vipulasri opened 6 years ago

vipulasri commented 6 years ago

Is there a way to have progressive image loading which is supported by JPEG and WEBp images?

renefloor commented 6 years ago

Not at the moment, but it's a good feature. Do images support that themselves or should a server give two images?

vipulasri commented 6 years ago

Yeah, there can two ways:

  1. First providing a thumbnail image and then loading the actual image in the background. And when the actual image is available replacing thumbnail with it.
  2. More awesome way, JPEG, and WEBp support progressive loading with themselves(if the only image was created supporting such feature.)
renefloor commented 6 years ago

For the image supported progressive loading I will probably need a lot of rewriting as the loading and showing of the image is fully seperated. (File loading is even a seperate library.) Using two images is easier, as I can just start loading the second one when the first one is finished. I am not sure how much developers want something like this, as images for apps are often already optimized to be small.

vipulasri commented 6 years ago

I agree, then the library should offer an extra method/option like thumbnail() that would really help.

renefloor commented 6 years ago

I was thinking about a stream, that way you can change it to any amount of images/files. Do you know some easy to read documentation about this? Is this generic or does every image type has its own methods?

vipulasri commented 6 years ago

I can tell you about most commonly used Image Loading library on Android i.e Glide. It has great features as well as documentation.

perlatus commented 6 years ago

Hey you can actually use the placeholder widget for this. That's what I'm doing. I pass in a placeholder widget that's basically a lower-res image (already cached) stacked with a progress bar.