pixel-compare
Advanced tools
Comparing version 1.0.3 to 1.1.0
20
index.js
@@ -117,8 +117,18 @@ "use strict"; | ||
); | ||
const writable = fs.createWriteStream(outputImagePath); | ||
savePixels(resultNdarray, imageType).pipe(writable); | ||
return new Promise((resolve, reject) => { | ||
const writable = fs.createWriteStream(outputImagePath); | ||
const stream = savePixels(resultNdarray, imageType).pipe(writable); | ||
stream.on("finish", () => { | ||
resolve(isSame); | ||
}); | ||
stream.on("error", err => { | ||
reject(err); | ||
}); | ||
}); | ||
} | ||
return isSame; | ||
}) | ||
.catch(console.error); | ||
else { | ||
return isSame; | ||
} | ||
}); | ||
} |
{ | ||
"name": "pixel-compare", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "compare pixel of image for PNG, JPEG or DataURL.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,1 +8,2 @@ const pixelCompare = require("../index"); | ||
}) | ||
.then(isSame => console.log(isSame)); |
410527
130