13 lines
292 B
Plaintext
13 lines
292 B
Plaintext
import { toUTF8String, readUInt16LE } from "./utils.js";
|
|
const gifRegexp = /^GIF8[79]a/;
|
|
const GIF = {
|
|
validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
|
|
calculate: (input) => ({
|
|
height: readUInt16LE(input, 8),
|
|
width: readUInt16LE(input, 6)
|
|
})
|
|
};
|
|
export {
|
|
GIF
|
|
};
|