Created
January 16, 2021 17:14
-
-
Save benfoxall/47a8ce7ed12b14e79dffa1048e2c2fa7 to your computer and use it in GitHub Desktop.
Revisions
-
benfoxall created this gist
Jan 16, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ await gifsize('https://media.giphy.com/media/3ornjZLITGcFQVRbxK/source.gif') // > {width: 500, height: 247} async function gifsize (url) { const result = await fetch(url, {headers: {Range: 'bytes=6-9'}}) const [width, height] = new Uint16Array(await result.arrayBuffer()) return {width, height} }