rsmbl / Resemble.js

Image analysis and comparison

Home Page:http://rsmbl.github.io/Resemble.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onComplete call back not getting triggered in the latest version (3.0.1)

dineshmatta opened this issue · comments

I am trying to use the following code for comparing two images:

resemble('./1-dev.png')
.compareTo('./2-dev.png')
.ignoreNothing()
.onComplete(function(data) {
console.log(data)
data.getDiffImage().pack().pipe(fs.createWriteStream( './diff.png'));
});

but the code never gets executed inside onComplete callback, but if I downgrade to 2.3.x version then it works fine,

I believe the getDiffImage method was only available in the node-resemble fork. With resemble.js 3.0.1 you can call fs.writeFileSync(./diff.png, data.getBuffer());