gemini-testing / looks-same

Node.js library for comparing images
MIT License
669 stars 55 forks source link

`looksSame` throws an error when an error is present using the readme code #57

Open vctr-dev opened 5 years ago

vctr-dev commented 5 years ago

looksSame throws an error when an error is present, using the readme code

looksSame('image1.png', 'image2.png', function(error, {equal}) {
    // equal will be true, if images looks the same
});

> TypeError: Cannot destructure property `equal` of 'undefined' or 'null'.

Should probably update the docs to set the default in the callback i.e.

looksSame('image1.png', 'image2.png', function(error, {equal} = {}) {
    // equal will be true, if images looks the same
});
Pathos14489 commented 4 years ago

This doesn't resolve the error, this just makes it not stop the script. Equal still comes out as undefined.

Pathos14489 commented 4 years ago

After some more fidgeting, I figured out the issue. looks-same only works on .png images.