Skip to content

Commit

Permalink
Eliminate the use of fs.ReadStream, but still use sharp's stream-base…
Browse files Browse the repository at this point in the history
…d input mode, passing a new Buffer instance for each iteration.
  • Loading branch information
papandreou committed May 24, 2016
1 parent 55cd1e7 commit 9bf672b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ sharp.cache(false);

var fileName = '100mpix.jpg';

var imageBuffer = fs.readFileSync(pathModule.resolve(__dirname, '100mpix.jpg'));

var singleTest = function(cb) {
var i = sharp();
i.embed().interpolateWith(sharp.interpolator.bicubic)
Expand All @@ -18,7 +20,7 @@ var singleTest = function(cb) {
}
cb();
});
fs.createReadStream(pathModule.resolve(__dirname, '100mpix.jpg')).pipe(i);
i.end(new Buffer(imageBuffer));
};

var run = function(name) {
Expand Down

0 comments on commit 9bf672b

Please sign in to comment.