wswebcreation / webdriver-image-comparison

MIT License
43 stars 36 forks source link

Fix mismatch percentage #126

Closed wswebcreation closed 1 year ago

wswebcreation commented 1 year ago

This PR reverts #105 and will update the misMatchPercentage from a string back to a number. But, instead of using a toFixed(2) it uses toFixed(3). The reason for this is that the average screen resolution is around 1920x1080. I want this module to be able to detect at least a 10x10 pixel difference.

1920x1080 = 2073600 pixels, a difference of 10x10 is 100 which means 0.005% difference (0.00482253). Number(0.00482253.toFixed(2)) = 0 and Number(0.00482253.toFixed(3)) = 0.005

This PR also updates ResembleJS to the latest version 4.1.0