Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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.
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.');
});
gifencoder is a server-side node.js GIF encoding library that creates GIF images. It is similar to omggif in that it allows for the creation of GIFs programmatically but differs in its API and additional features like setting quality and repeat options for the GIF.
jsgif is a JavaScript GIF parser and player which works in both the browser and Node.js environments. It shares functionality with omggif in terms of reading GIF files but focuses more on playing GIF animations rather than creating or modifying them.
omggif is a JavaScript implementation of a GIF 89a encoder and decoder.
https://github.com/deanm/omggif
(c) Dean McNamee dean@gmail.com, 2013.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
omggif is a JavaScript implementation of a GIF 89a encoder and decoder.
The npm package omggif receives a total of 1,449,574 weekly downloads. As such, omggif popularity was classified as popular.
We found that omggif demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.