Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garbetjie/apng-assembler
A NodeJS wrapper library around the apngasm binary.
https://github.com/garbetjie/apng-assembler
Last synced: 18 days ago
JSON representation
A NodeJS wrapper library around the apngasm binary.
- Host: GitHub
- URL: https://github.com/garbetjie/apng-assembler
- Owner: garbetjie
- License: other
- Created: 2017-12-07T12:13:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-13T05:32:43.000Z (almost 7 years ago)
- Last Synced: 2024-10-03T07:05:06.690Z (about 1 month ago)
- Language: JavaScript
- Size: 253 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
APNG Assembler
--------------Simple wrapper around the excellent [APNG Assembler](https://sourceforge.net/projects/apngasm) command line binary.
## Usage
```js
const Assembler = require('apng-assembler');// Assemble file asynchronously.
Assembler.assemble(
'input*.png',
'output.png',
{
loopCount: 0,
frameDelay: 100,
compression: Assembler.COMPRESS_7ZIP
}
).then(
function(outputFile) {
console.log(`${outputFile} has been assembled successfully.`);
},
function(error) {
console.error(`Failed to assemble: ${error.message}`);
console.error(`stdout: ${error.stdout}`);
console.error(`stderr: ${error.stderr}`);
}
);// Assemble file synchronously.
try {
Assembler.assembleSync(
'input*.png',
'output.png',
{
loopCount: 0,
frameDelay: 100,
compression: Assembler.COMPRESS_7ZIP
}
);
} catch (e) {
console.error(`Failed to assemble: ${error.message}`);
console.error(`stdout: ${error.stdout}`);
console.error(`stderr: ${error.stderr}`);
}// Pass an instance of the assembler around.
let assembler = new Assembler.Assembler(loopCount, frameDelay, compression);
assembler.assemble('input*.png', 'output.png');
assembler.assembleSync('input*.png', 'output.png');
```## Credits
* [APNG Assembler](https://sourceforge.net/projects/apngasm) by Max Stepin.