Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

png is not jpeg

  • Loading branch information...
commit 0e0d3480ea20bf679b517dca3f427b3dd6cbd7a1 1 parent 8b60061
@pkrumins authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 examples/jpeg-example2.js
View
8 examples/jpeg-example2.js
@@ -15,15 +15,15 @@ for (var i=0; i<HEIGHT; i++) {
}
}
-var png = new Jpeg(rgba, WIDTH, HEIGHT, 50, 'rgb');
+var jpeg = new Jpeg(rgba, WIDTH, HEIGHT, 50, 'rgb');
var fd = fs.openSync('./jpeg-gradient.jpeg', 'w+', 0660);
var written = 0;
-png.addListener('data', function(chunk, length) {
+jpeg.addListener('data', function(chunk, length) {
written += fs.writeSync(fd, chunk, written, 'binary');
});
-png.addListener('end', function() {
+jpeg.addListener('end', function() {
fs.closeSync(fd);
});
-png.encode();
+jpeg.encode();
Please sign in to comment.
Something went wrong with that request. Please try again.