fixed fill

This commit is contained in:
brighthas 2013-10-21 21:08:53 +08:00
parent 82dd9a96c0
commit 9dc3fc20b1
2 changed files with 30 additions and 14 deletions

View file

@ -34,10 +34,12 @@ var PNG = exports.PNG = function(options) {
this.width = options.width || 0;
this.height = options.height || 0;
this.data = this.width > 0 && this.height > 0
? new Buffer(4 * this.width * this.height) : null;
if(options.fill && this.data){this.data.fill(0)};
this.gamma = 0;
this.readable = this.writable = true;

View file

@ -1,15 +1,29 @@
{
"name": "pngjs",
"version": "0.4.0",
"description": "Simple PNG encoder/decoder",
"author": "Kuba Niegowski",
"contributors": [],
"homepage": "https://github.com/niegowski/node-pngjs/",
"keywords" : [
"png"
],
"engines": {
"node": "0.8.x"
},
"main": "./lib/png.js"
"name": "node-png",
"version": "0.4.1",
"description": "Simple PNG encoder/decoder",
"author": "Kuba Niegowski",
"contributors": [],
"homepage": "https://github.com/niegowski/node-pngjs/",
"keywords": [
"png"
],
"engines": {
"node": "0.8.x"
},
"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"
}
}