Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omggif

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omggif

omggif is a JavaScript implementation of a GIF 89a encoder and decoder.

  • 1.0.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7M
decreased by-1.26%
Maintainers
1
Weekly downloads
 
Created

What is omggif?

The omggif npm package is a JavaScript library for reading and writing GIF89a encoded GIF files. It allows for parsing and creating GIFs in a Node.js environment or in the browser. This package is particularly useful for applications that need to manipulate GIF images programmatically, such as generating GIFs on-the-fly, modifying existing GIFs, or extracting information from GIF files.

What are omggif's main functionalities?

Reading GIF Information

This feature allows you to read and extract information from a GIF file, such as its dimensions. The code sample demonstrates how to read a GIF file and log its width and height.

const GifReader = require('omggif').GifReader;
const fs = require('fs');

fs.readFile('path/to/gif.gif', (err, data) => {
  if (err) throw err;
  const reader = new GifReader(data);
  console.log('Width:', reader.width);
  console.log('Height:', reader.height);
});

Writing GIF Images

This feature enables the creation of GIF files programmatically. The code sample shows how to initialize a GIF writer, add a frame to the GIF, and save the GIF to a file.

const GifWriter = require('omggif').GifWriter;
const fs = require('fs');

const buffer = new Uint8Array(256 * 256 * 5); // Example buffer size
const writer = new GifWriter(buffer, 256, 256, { loop: 0 });
// Add frames to the GIF
writer.addFrame(0, 0, 256, 256, frameData, { delay: 50 });

fs.writeFile('path/to/output.gif', buffer, (err) => {
  if (err) throw err;
  console.log('GIF created successfully.');
});

Other packages similar to omggif

Keywords

FAQs

Package last updated on 16 Jul 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc