aboutsummaryrefslogtreecommitdiff
path: root/webAO/utils/calculateGifLength.js
diff options
context:
space:
mode:
authorstonedDiscord <Tukz@gmx.de>2023-09-20 11:52:34 +0200
committerstonedDiscord <Tukz@gmx.de>2023-09-20 11:52:34 +0200
commit5fc20f9dd53fe4d32be08d538782baa47c67853c (patch)
treeba0994a4c3a7b090d3732f7381b96e92ee365249 /webAO/utils/calculateGifLength.js
parent4db738e6e5e3287c3621501a01988ab90eed447e (diff)
make eslint a lot happier
Diffstat (limited to 'webAO/utils/calculateGifLength.js')
-rw-r--r--webAO/utils/calculateGifLength.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/webAO/utils/calculateGifLength.js b/webAO/utils/calculateGifLength.js
index 1df0ba9..ca0e1e1 100644
--- a/webAO/utils/calculateGifLength.js
+++ b/webAO/utils/calculateGifLength.js
@@ -1,8 +1,8 @@
/**
- * Adds up the frame delays to find out how long a GIF is
- * I totally didn't steal this
- * @param {data} gifFile the GIF data
- */
+ * Adds up the frame delays to find out how long a GIF is
+ * I totally didn't steal this
+ * @param {data} gifFile the GIF data
+ */
const calculateGifLength = (gifFile) => {
const d = new Uint8Array(gifFile);
// Thanks to http://justinsomnia.org/2006/10/gif-animation-duration-calculation/
@@ -11,9 +11,9 @@ const calculateGifLength = (gifFile) => {
for (let i = 0; i < d.length; i++) {
// Find a Graphic Control Extension hex(21F904__ ____ __00)
if (d[i] === 0x21
- && d[i + 1] === 0xF9
- && d[i + 2] === 0x04
- && d[i + 7] === 0x00) {
+ && d[i + 1] === 0xF9
+ && d[i + 2] === 0x04
+ && d[i + 7] === 0x00) {
// Swap 5th and 6th bytes to get the delay per frame
const delay = (d[i + 5] << 8) | (d[i + 4] & 0xFF);