@ashiteam/ashi-is-animated-image
v1.0.4
Published
My library to detect if an image is an animated image.
Downloads
14
Readme
@ashiteam/ashi-is-animated-image
My library to detect if an image is an animated image.
Description
You can pass in a Buffer containing the binary of an image to isAnimated which would return tru or false to indicate if the image is an animated image or not.
Usage
Web
const imageUrl = 'https://somesite.com/someimage';
const fetchedImage = await fetch(imageUrl);
const imageBuffer = Buffer.from(await fetchedImage.arrayBuffer());
const imageIsAnimated = isAnimated(imageBuffer)
NodeJS
const pathToImage = './someimage.gif'
const buffer = fs.readFileSync(pathToImage);
const imageIsAnimated = isAnimated(buffer);