Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createGif(width, height) {
- const buffer = new ArrayBuffer(24)
- const byteView = new Uint8Array(buffer)
- // signature
- byteView.set([ 71, 73, 70, 56, 57, 97 ], 0)
- // size
- byteView.set([width, width >> 8], 6)
- byteView.set([height, height >> 8], 8)
- // jibber jabber
- byteView.set([44], 13)
- byteView.set([1], 18)
- byteView.set([1], 20)
- byteView.set([2], 23)
- return btoa(String.fromCharCode.apply(null, byteView))
- }
Add Comment
Please, Sign In to add comment