animated-gif-detector
Detect animated GIFs from JavaScript buffers.
Installation
npm i animated-gif-detector
Motivation
Given a readable stream or a buffer directly, determine if a buffer of data is an animated GIF. This helps determine if a document contains cat pics or LOLz.
Usage
Streaming
This module is intended to be used as a Writable stream:
var fs = animated = ;fs ; ;
Particularly, you may want to determine animate as early as possible in a given HTTP request, and abort the request as soon as you know:
var http = animated = ;var req = http ;
Sync
If an img is loaded as a buffer directly, a sync function is also available:
var fs = animated = ; // => true!
Browserify
This should work as a client-side package if Browersified.
Tests
npm test
runs the tests.
Please contribute weird animated GIFs to the repository to add to the test cases.
Contributors
Thanks to hard work from the following contributors:
- Bradley Spaulding - GitHub/bspaulding
- Vilson Vieira - GitHub/automata
- Andreas Lind - GitHub/papandreou
- Priyank Parashar - GitHub/paras20xx