mirror of
https://github.com/danbulant/pngjs
synced 2026-06-18 22:11:32 +00:00
tidy examples a little
This commit is contained in:
parent
f84416a523
commit
cdd6f0c5ab
3 changed files with 12 additions and 9 deletions
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
var fs = require('fs'),
|
||||
PNG = require('pngjs').PNG;
|
||||
PNG = require('../lib/png').PNG; // note require('pngjs') outside this project
|
||||
|
||||
fs.createReadStream('in.png')
|
||||
fs.createReadStream('test/in/basi0g01.png')
|
||||
.pipe(new PNG({
|
||||
filterType: 4
|
||||
}))
|
||||
|
|
|
|||
10
examples/newfile.js
Normal file
10
examples/newfile.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
var PNG = require("../lib/png").PNG;
|
||||
|
||||
(new PNG({width:1,height:1})).pack()
|
||||
.on('data', function(data) {
|
||||
console.log('data', data);
|
||||
})
|
||||
.on('end', function() {
|
||||
console.log('bitmap:', this.data);
|
||||
console.log('end !');
|
||||
});
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
var PNG = require("../lib/png").PNG;
|
||||
|
||||
(new PNG({width:1,height:1})).pack()
|
||||
.on("end", function() {
|
||||
console.log(this.data);
|
||||
console.log("end !"); // never called
|
||||
})
|
||||
Loading…
Reference in a new issue