1.0.1 • Published 1 year ago

is-apng v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

is-apng   Latest GitHub release Latest NPM version Build Status

Check if a Buffer/Uint8Array is a Animated PNG / APNG image

Install

$ npm install is-apng

Usage

Node.js  

import { readFile } from 'node:fs/promises'
import isApng from 'is-apng'

const buffer = await readFile('image.png')

isApng(buffer)
// => true

Browser  

import isApng from 'is-apng'

const response = await fetch('image.png')
const buffer = await response.arrayBuffer()

isApng(new Uint8Array(buffer))
// => true

API

isApng(buffer)

Accepts a Buffer (Node.js) or Uint8Array. Returns a boolean of whether buffer is a APNG image.

buffer

The buffer to check.

Based on

License

MIT © Philip van Heemstra