simonlindholm / toggle-gifs

Toggle animated GIFs (Firefox extension)
https://addons.mozilla.org/en-US/firefox/addon/toggle-animated-gifs/
51 stars 2 forks source link

Request: Load only first frame, rest on demand #21

Open Bitsky opened 9 years ago

Bitsky commented 9 years ago

Many websites (eg Tumblr) often have lots of large gifs. While the addon stops the animation, the complete gif is still loaded in the background. For people with low bandwidth this keeps such sites unuseable (eg only 10 gifs a 3MB mean a 30MB download per page). It would reduce traffic dramatically if loading the gif stops after the first frame. I don't mind waiting for a gif to load when I want to watch it; but always loading them in the background grinds my connection down to a halt. You could make in an extra option like "Stop loading gif after first frame was received".

simonlindholm commented 9 years ago

This is hard, certainly harder than #16. I don't think there's a way, with the Firefox APIs I'm using, to know when the first frame of a GIF has been received, or for that sake, that there even are images being loaded... One would probably need to do something completely different, with http-on-modify-request and manual GIF parsing or so. Which is also quite error-prone.

I'll leave the issue open, because it's a valid feature request, but I don't expect to work on this.

simonlindholm commented 9 years ago

As mentioned in #35, https://github.com/adamfur/GifJam does this for Chrome (well, for URLs containing .gif).

FredGithub commented 8 years ago

This would be so freaking nice, but I get why it's harder to do...

evivz commented 7 years ago

Fb does it. Anyone has idea how fb does it?

simonlindholm commented 7 years ago

I imagine their server extracts the first frame and sends it to the client, and then load the rest as a separate JS request (probably transcoded as a video, so it loads faster). Can't really use that strategy on the client side.