diff --git a/CHANGELOG.md b/CHANGELOG.md index 9af0494..7afe079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.0.1 November 14, 2012 + +Fix addImage not working with buffers. + + ## 2.0.0 November 1, 2012 New API for updating structure fields: diff --git a/lib/pass.js b/lib/pass.js index 7b0de99..6242074 100644 --- a/lib/pass.js +++ b/lib/pass.js @@ -305,8 +305,9 @@ function addImage(file, source, callback) { file.on("close", callback); } } else if (source instanceof Buffer) { - file.end(buffer); - callback(); + file.on("close", callback); + file.write(source); + file.end(); } else if (typeof(source) == "function") { try { source(file); diff --git a/lib/zip.js b/lib/zip.js index 96cf80b..7e89c95 100644 --- a/lib/zip.js +++ b/lib/zip.js @@ -10,8 +10,8 @@ var EventEmitter = require("events").EventEmitter; -var Stream = require("stream").Stream; var inherits = require("util").inherits; +var Stream = require("stream").Stream; var Zlib = require("zlib");