Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit b26d77b

Browse files
committed
Support output as buffer.
1 parent 6441408 commit b26d77b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ function BlinkDiff (options) {
142142

143143
this._imageOutput = null;
144144
this._imageOutputPath = options.imageOutputPath;
145+
this._imageOutputBuffer = options.imageOutputBuffer;
145146
this._imageOutputLimit = load(options.imageOutputLimit, BlinkDiff.OUTPUT_ALL);
146147

147148
// Pixel or Percent
@@ -466,6 +467,11 @@ BlinkDiff.prototype = {
466467
fn(undefined, result);
467468
}
468469
}.bind(this));
470+
} else if(this._imageOutputBuffer === true) {
471+
this._imageOutput.toBlob(function( err, blob ){
472+
result.buffer = blob;
473+
fn(undefined, result);
474+
});
469475
} else {
470476
fn(undefined, result);
471477
}

0 commit comments

Comments
 (0)