gifencoder
Advanced tools
Comparing version 1.1.0 to 2.0.0
@@ -20,3 +20,3 @@ /* | ||
ByteArray.prototype.getData = function() { | ||
return new Buffer(this.data); | ||
return new Buffer.from(this.data); | ||
}; | ||
@@ -117,3 +117,3 @@ | ||
this.readStreams.forEach(function (rs) { | ||
rs.push(new Buffer(self.out.data)); | ||
rs.push(Buffer.from(self.out.data)); | ||
}); | ||
@@ -120,0 +120,0 @@ this.out.data = []; |
{ | ||
"name": "gifencoder", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "Streaming server-side animated (and non-animated) gif generation for node.js", | ||
@@ -32,13 +32,14 @@ "main": "index.js", | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"canvas": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"after": "~0.8.1", | ||
"canvas": "^1.6.4", | ||
"concat-stream": "^1.4.6", | ||
"expect.js": "^0.3.1", | ||
"mocha": "^3.4.2", | ||
"mocha": "^5.2.0", | ||
"png-file-stream": "^1.0.0", | ||
"png-js": "~0.1.1", | ||
"range": "0.0.2" | ||
"range": "0.0.3" | ||
} | ||
} |
@@ -5,10 +5,4 @@ # gifencoder | ||
This code is based on the fine work of the following developers, but adds | ||
server-side generation with [node-canvas](https://github.com/learnboost/node-canvas) | ||
and support for node.js Buffers: | ||
[![build status](https://secure.travis-ci.org/eugeneware/gifencoder.png)](http://travis-ci.org/eugeneware/gifencoder) | ||
* Kevin Weiner (original Java version - kweiner@fmsware.com) | ||
* Thibault Imbert (AS3 version - bytearray.org) | ||
* Johan Nordberg ([gif.js](http://jnordberg.github.io/gif.js/) - code@johan-nordberg.com) | ||
## Installation | ||
@@ -32,5 +26,15 @@ | ||
pngFileStream('test/**/frame?.png') | ||
var stream = pngFileStream('test/**/frame?.png') | ||
.pipe(encoder.createWriteStream({ repeat: -1, delay: 500, quality: 10 })) | ||
.pipe(fs.createWriteStream('myanimated.gif')); | ||
stream.on('finish', function () { | ||
// Process generated GIF | ||
}); | ||
// Alternately, you can wrap the "finish" event in a Promise | ||
await new Promise((resolve, reject) => { | ||
stream.on('finish', resolve); | ||
stream.on('error', reject); | ||
}); | ||
``` | ||
@@ -83,1 +87,22 @@ | ||
![Animated GIF](https://raw.github.com/eugeneware/gifencoder/master/examples/myanimated.gif) | ||
## Contributing | ||
gifencoder is an **OPEN Open Source Project**. This means that: | ||
> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project. | ||
See the [CONTRIBUTING.md](https://github.com/eugeneware/gifencoder/blob/master/CONTRIBUTING.md) file for more details. | ||
### Contributors | ||
gifencoder is only possible due to the excellent work of the following contributors: | ||
<table><tbody> | ||
<tr><th align="left">Kevin Weiner</th><td><a href="mailto:kweiner@fmsware.com">kweiner@fmsware.com</a></td></tr> | ||
<tr><th align="left">Thibault Imbert</th><td><a href="http://www.bytearray.org/">http://www.bytearray.org/</a></td></tr> | ||
<tr><th align="left">Eugene Ware</th><td><a href="https://github.com/eugeneware">GitHub/eugeneware</a></td></tr> | ||
<tr><th align="left">Raine Virta</th><td><a href="https://github.com/raine">GitHub/raine</a></td></tr> | ||
<tr><th align="left">Paul Ochoa</th><td><a href="https://github.com/rochoa">GitHub/rochoa</a></td></tr> | ||
<tr><th align="left">Heikki Pora</th><td><a href="https://github.com/heikkipora">GitHub/heikkipora</a></td></tr> | ||
</tbody></table> |
@@ -1,12 +0,13 @@ | ||
var expect = require('expect.js'), | ||
fs = require('fs'), | ||
path = require('path'), | ||
Canvas = require('canvas'), | ||
concat = require('concat-stream'), | ||
stream = require('stream'), | ||
png = require('png-js'), | ||
after = require('after'), | ||
range = require('range'), | ||
pngFileStream = require('png-file-stream'), | ||
GIFEncoder = require('..'); | ||
const expect = require('expect.js'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const Canvas = require('canvas'); | ||
const concat = require('concat-stream'); | ||
const stream = require('stream'); | ||
const png = require('png-js'); | ||
const after = require('after'); | ||
const { range } = require('range'); | ||
const pngFileStream = require('png-file-stream'); | ||
const GIFEncoder = require('..'); | ||
const { createCanvas, Image } = require('canvas') | ||
@@ -28,6 +29,6 @@ function getData(ctx, width, height) { | ||
var buf = fs.readFileSync(fixtures('in.png')); | ||
var img = new Canvas.Image(); | ||
var img = new Image(); | ||
img.src = buf; | ||
var canvas = new Canvas(img.width, img.height); | ||
var canvas = createCanvas(img.width, img.height); | ||
var ctx = canvas.getContext('2d'); | ||
@@ -63,6 +64,6 @@ | ||
var buf = fs.readFileSync(fixtures('in.png')); | ||
var img = new Canvas.Image(); | ||
var img = new Image(); | ||
img.src = buf; | ||
var canvas = new Canvas(img.width, img.height); | ||
var canvas = createCanvas(img.width, img.height); | ||
var ctx = canvas.getContext('2d'); | ||
@@ -108,6 +109,6 @@ | ||
var buf = fs.readFileSync(fixtures('in.png')); | ||
var img = new Canvas.Image(); | ||
var img = new Image(); | ||
img.src = buf; | ||
var canvas = new Canvas(img.width, img.height); | ||
var canvas = createCanvas(img.width, img.height); | ||
var ctx = canvas.getContext('2d'); | ||
@@ -114,0 +115,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
138063
7
106
1
1536
+ Addedcanvas@^2.2.0
+ Added@mapbox/node-pre-gyp@1.0.11(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedaproba@2.0.0(transitive)
+ Addedare-we-there-yet@2.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcanvas@2.11.2(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addeddecompress-response@4.2.1(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addeddetect-libc@2.0.3(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgauge@3.0.2(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedmimic-response@2.1.0(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addednan@2.22.0(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@5.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsemver@6.3.17.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@3.1.1(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)