Skip to content

Commit

Permalink
fix: generate diff image more reliably (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielrobert authored Mar 15, 2024
1 parent 40783e0 commit 195ee95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/image-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ImageDiff {
const options = { threshold: 0.1, diffMask: true };
const result = pixelmatch(aCanvas.data, bCanvas.data, dstImage.data, dstImage.width, dstImage.height, options);

dstImage.pack().pipe(fs.createWriteStream(this.getImageOutput()));
fs.writeFileSync(this.getImageOutput(), PNG.sync.write(dstImage));

callback(Object.assign(this, {
width: dstImage.width,
Expand Down

0 comments on commit 195ee95

Please sign in to comment.