
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@citizenfx/apng-js
Advanced tools
apng-js
provides functions for parse and render animated PNG's
(APNG).
https://davidmz.github.io/apng-js/
npm install apng-js
Default exported function. Parses APNG data, returns APNG object (see below) or Error. This function can be used in node.js environment. Object methods relies on browser features (canvas, requestAnimationFrame…) and should work only in browser.
Usage:
import parseAPNG from 'apng-js';
const apng = parseAPNG(buffer);
if (apng instanceof Error) {
// handle error
}
// work with apng object
Checks if Error is 'Not a PNG' error.
Checks if Error is 'Not an animated PNG' error.
Structure of APNG file.
class APNG {
width: number // with of canvas, pixels
height: number // height of canvas, pixels
numPlays: number // number of times to loop animation (0 = infinite looping)
playTime: number // total duration of one loop in milliseconds
frames: Frame[] // array of frames
// Methods
createImages(): Promise // create imageElement's for all frames
getPlayer(context: CanvasRenderingContext2D, autoPlay: boolean = false): Promise.<Player>
// Create Player (see below) on given context and start playing
// if autoPlay is true.
}
Individual APNG frame.
class Frame {
left: number // left offset of frame, pixels
top: number // top offset of frame, pixels
width: number // with of frame, pixels
height: number // height of frame, pixels
delay: number // time to show frame in milliseconds
disposeOp: number // type of dispose operation (see APNG spec.)
blendOp: number // type of blend operation (see APNG spec.)
imageData: Blob // image data in PNG (not animated) format
imageElement: HTMLImageElement // image data rendered as HTML Image element.
// This field is null right after 'parse',
// use Frame.createImage() or APNG.createImages()
// to fill this field.
// Methods
createImage(): Promise // create imageElement for this frame
}
Player renders APNG frames on given rendering context and plays APNG animation.
class Player {
context: CanvasRenderingContext2D
playbackRate: number = 1.0 // animation playback rate
currFrameNumber: number // current frame number (read only)
currFrame: Frame // current frame (read only)
paused: boolean // playback is paused (read only)
ended: boolean // playback is ended (read only)
// Methods
play() // start or resume playback
pause() // pause playback
stop() // stop playback and rewind to start
renderNextFrame() // move to next frame and render it on context
// Use this method to manual, frame by frame, rendering.
}
Player object is an EventEmitter. You can listen to following events:
FAQs
Parse and play animated PNG (APNG)
The npm package @citizenfx/apng-js receives a total of 0 weekly downloads. As such, @citizenfx/apng-js popularity was classified as not popular.
We found that @citizenfx/apng-js 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.