-
-
Save yocontra/3013658 to your computer and use it in GitHub Desktop.
JavaScript animated GIF detection!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isAnimatedGif = (src, cb) -> | |
request = new XMLHttpRequest() | |
request.open "GET", src, true | |
request.responseType = "arraybuffer" | |
request.addEventListener "load", -> | |
arr = new Uint8Array request.response | |
return cb false if arr[0..3] isnt [0x47,0x49,0x46,0x38] | |
request.send() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment