Socket
Socket
Sign inDemoInstall

decode-gif

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    decode-gif

Decode the frames of a gif.


Version published
Weekly downloads
15K
decreased by-16.61%
Maintainers
1
Install size
48.6 kB
Created
Weekly downloads
 

Readme

Source

decode-gif Travis CI Build Status

Decode the frames of a gif.

NPM Badge

Install

npm install decode-gif

Usage

const fs = require("fs");
const decodeGif = require("decode-gif");

decodeGif(fs.readFileSync("unicorn.gif"));
/*
{
  width: 220,
  height: 165,
  frames: [
    { timeCode: 0, data: [Uint8ClampedArray] },
	{ timeCode: 10, data: [Uint8ClampedArray] },
	...
  ]
}
*/

API

decodeGif(data)

data

Type: array-like

The gif data. Can be anything array-like such as a Buffer, Array or Uint8Array.

Return value
width

Type: number

The width of the gif.

height

Type: number

The height of the gif.

frames

An array of each frame of the gif.

frame.timeCode

The time code in milliseconds that the frame appears at.

frame.data

The frame data as a Uint8ClampedArray.

Keywords

FAQs

Last updated on 17 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc