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

Getting an error UnhandledPromiseRejectionWarning: TypeError: ImageData expected with images of different width

ua834 opened this issue · comments

commented

When there is a diff and normalise function is being used I get this error. Happens with node v12.18.1 in Uubuntu 20.04.

packges:
"@andreekeberg/imagedata": "^1.0.2",
"pngjs": "^6.0.0",
"resemblejs": "^3.2.5"

canvas version inside node_modules is "2.6.1"

my code:

`ar compare = async function(imgPath1, imgPath2){
return new Promise(async (resolve, reject) => {
const img1 = getSync(imgPath1);
const img2 = getSync(imgPath2);

resemble(img1)
.compareTo(img2)
// .scaleToSameSize()
// .ignoreColors()
.onComplete(function(data) {
    resolve(data);
});

})
}`

Images I've used for comparison:

f1
f2

It not clear what the error is. Worth updgrading to the latest Resenble which uses Canvas@2.8.0