Skip to content

Commit 529cb22

Browse files
committed
fix: image diff calculation
closes FRSOURCE#107 Signed-off-by: Jakub Freisler <[email protected]>
1 parent b4c6617 commit 529cb22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export const initPlugin = (
161161
height,
162162
diffConfig
163163
);
164-
imgDiff = (diffPixels / width) * height;
164+
imgDiff = diffPixels / (width * height);
165165

166166
if (isImgSizeDifferent) {
167167
errorMsg = `Images size mismatch - new screenshot is ${rawImgNew.width}px by ${rawImgNew.height}px while old one is ${rawImgOld.width}px by ${rawImgOld.height} (width x height).`;

0 commit comments

Comments
 (0)