Closed mandeepm91 closed 8 years ago
Got it working. Figured I had to use the pack
method to create a stream out of data.
var diff = resemble(fileData).compareTo(fileData2).onComplete(function(data){
console.log(data);
var diffDataStream = data.getDiffImage().pack()
var writeStream = fs.createWriteStream(path.join(process.env.HOME,"Desktop", "diff.png"))
diffDataStream.pipe(writeStream)
});
Need to call the pack
method of the function's response to covert it to a readable stream
I am using the node.js library and trying to get the diff image after comparing two images. I am using the following code snippet for this but unable to open the image since it appears to be corrupted. What is the right way to do this ?