gifencoder
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -278,2 +278,9 @@ /* | ||
this.transIndex = this.findClosest(this.transparent); | ||
// ensure that pixels with full transparency in the RGBA image are using the selected transparent color index in the indexed image. | ||
for (var pixelIndex = 0; pixelIndex < nPix; pixelIndex++) { | ||
if (this.image[pixelIndex * 4 + 3] == 0) { | ||
this.indexedPixels[pixelIndex] = this.transIndex; | ||
} | ||
} | ||
} | ||
@@ -296,7 +303,7 @@ }; | ||
for (var i = 0; i < len;) { | ||
var index = i / 3; | ||
var dr = r - (this.colorTab[i++] & 0xff); | ||
var dg = g - (this.colorTab[i++] & 0xff); | ||
var db = b - (this.colorTab[i] & 0xff); | ||
var db = b - (this.colorTab[i++] & 0xff); | ||
var d = dr * dr + dg * dg + db * db; | ||
var index = i / 3; | ||
if (this.usedEntry[index] && (d < dmin)) { | ||
@@ -306,3 +313,2 @@ dmin = d; | ||
} | ||
i++; | ||
} | ||
@@ -309,0 +315,0 @@ |
{ | ||
"name": "gifencoder", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "Streaming server-side animated (and non-animated) gif generation for node.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "node_modules/.bin/grunt ci" | ||
"test": "mocha test/*.js" | ||
}, | ||
@@ -34,16 +34,11 @@ "repository": { | ||
"devDependencies": { | ||
"after": "~0.8.1", | ||
"canvas": "^1.6.4", | ||
"concat-stream": "^1.4.6", | ||
"expect.js": "^0.3.1", | ||
"grunt-contrib-jshint": "^0.10.0", | ||
"grunt-contrib-watch": "^0.6.1", | ||
"grunt": "~0.4.1", | ||
"grunt-mocha-cli": "^1.10.0", | ||
"grunt-complexity": "^0.2.0", | ||
"grunt-cli": "~0.1.9", | ||
"canvas": "~1.1.0", | ||
"concat-stream": "^1.4.6", | ||
"mocha": "^3.4.2", | ||
"png-file-stream": "^1.0.0", | ||
"png-js": "~0.1.1", | ||
"after": "~0.8.1", | ||
"range": "0.0.2", | ||
"png-file-stream": "^1.0.0" | ||
"range": "0.0.2" | ||
} | ||
} |
@@ -29,6 +29,7 @@ # gifencoder | ||
var pngFileStream = require('png-file-stream'); | ||
var fs = require('fs'); | ||
pngFileStream('test/**/frame?.png') | ||
.pipe(encoder.createWriteStream({ repeat: -1, delay: 500, quality: 10 })) | ||
.pipe(fs.createWriteStream('myanimated.gif'))); | ||
.pipe(fs.createWriteStream('myanimated.gif')); | ||
``` | ||
@@ -35,0 +36,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
136582
8
1585
81