mirror of
https://github.com/danbulant/pngjs
synced 2026-07-08 12:40:35 +00:00
fixed fill
This commit is contained in:
parent
82dd9a96c0
commit
9dc3fc20b1
2 changed files with 30 additions and 14 deletions
|
|
@ -34,10 +34,12 @@ var PNG = exports.PNG = function(options) {
|
||||||
|
|
||||||
this.width = options.width || 0;
|
this.width = options.width || 0;
|
||||||
this.height = options.height || 0;
|
this.height = options.height || 0;
|
||||||
|
|
||||||
this.data = this.width > 0 && this.height > 0
|
this.data = this.width > 0 && this.height > 0
|
||||||
? new Buffer(4 * this.width * this.height) : null;
|
? new Buffer(4 * this.width * this.height) : null;
|
||||||
|
|
||||||
|
if(options.fill && this.data){this.data.fill(0)};
|
||||||
|
|
||||||
this.gamma = 0;
|
this.gamma = 0;
|
||||||
this.readable = this.writable = true;
|
this.readable = this.writable = true;
|
||||||
|
|
||||||
|
|
|
||||||
40
package.json
40
package.json
|
|
@ -1,15 +1,29 @@
|
||||||
{
|
{
|
||||||
"name": "pngjs",
|
"name": "node-png",
|
||||||
"version": "0.4.0",
|
"version": "0.4.1",
|
||||||
"description": "Simple PNG encoder/decoder",
|
"description": "Simple PNG encoder/decoder",
|
||||||
"author": "Kuba Niegowski",
|
"author": "Kuba Niegowski",
|
||||||
"contributors": [],
|
"contributors": [],
|
||||||
"homepage": "https://github.com/niegowski/node-pngjs/",
|
"homepage": "https://github.com/niegowski/node-pngjs/",
|
||||||
"keywords" : [
|
"keywords": [
|
||||||
"png"
|
"png"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "0.8.x"
|
"node": "0.8.x"
|
||||||
},
|
},
|
||||||
"main": "./lib/png.js"
|
"main": "./lib/png.js",
|
||||||
|
"directories": {
|
||||||
|
"example": "examples"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git://github.com/brighthas/node-pngjs.git"
|
||||||
|
},
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/brighthas/node-pngjs/issues"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue