odiff-bin. Diff image size is not resulted in expected `layout-diff` response
pashidlos opened this issue · comments
You need to pass specific flag failOnLayoutDiff
I did, but it works only if I compare completely different images (ex "1.png" vs "diffLayout2.png" it works)
you could find images and code inside the repo
const odiff = require("odiff-bin");
const {getImagePath} = require("./utils");
(async () => {
const result = await odiff.compare(
getImagePath("diffLayout1.png"),
getImagePath("diffLayout2.png"),
getImagePath("diff.png"),
{
failOnLayoutDiff: true
}
);
console.log(result);
})();
It currently only fails if the width AND height are different from the original image.
(https://github.com/dmtrKovalenko/odiff/blob/main/src/Diff.re#L98)
I also noticed this some time ago, but thought it maybe was intended.
It would be an easy fix though, if it isn't intended 😄
Ohh that is definitely a mistake