3 ms·
Apparently, if you aim to serve the GIF over the internet, you can absolutely avoid creating the file at all. GIFs don't declare how many frames the file has, s
by shubhamjain 11y ago
Apparently, if you aim to serve the GIF over the internet, you can absolutely avoid creating the file at all. GIFs don't declare how many frames the file has, so the browser will keep loading GIF frames unless you declare that there are no more frames.
People have exploited this to create a hackish one-way websocket [1].
[1]: https://github.com/videlalvaro/gifsockets https://github.com/videlalvaro/gifsockets
- pluma 11y agoI'm pretty sure people have exploited this in the 1990s to create a hackish webcam (a camera recording each frame as gif and the server "streaming" the individual gif frames as they come in).
- dag11 11y agoYou don't have to hack gifs to do this. The ability to indefinitely stream frames of an image (of any format) is part of HTTP. I made a live png view counter for funsies with this idea: http://drewgottlieb.net/2012/07/29/real-time-user-count.html http://drewgottlieb.net/2012/07/29/real-time-user-count.html