@@ -106,9 +106,9 @@ function screenshotsMatch {
106106 local IMAGE_LATEST=" $2 "
107107
108108 # Calculate the normalized cross correllation between both images
109- NCC=$( compare -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " " $DIFF_FILE " )
109+ NCC=$( compare -quiet - metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " " $DIFF_FILE " )
110110
111- if [ " NCC" -lt " $NCC_THRESHOLD " ]; then
111+ if [ " $ NCC" -lt " $NCC_THRESHOLD " ]; then
112112 # The screenshots are not identical
113113 echo " Possible change detected. Confirming..."
114114
@@ -131,13 +131,13 @@ function screenshotsMatch {
131131
132132 # Compare the two cropped screenshots again
133133 # Calculate the normalized cross correllation between both images
134- NCC=$( compare -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " " $DIFF_FILE " )
134+ NCC=$( compare -quiet - metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " " $DIFF_FILE " )
135135
136- if [ " NCC" -lt " $NCC_THRESHOLD " ]; then
136+ if [ " $ NCC" -lt " $NCC_THRESHOLD " ]; then
137137 # The screenshots do not match. The website has changed
138138
139139 # Write detailed NCC information to a file (and don't overwrite the diff file)
140- compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null > " $NCC_FILE "
140+ compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null & > " $NCC_FILE "
141141
142142 # Return false, as the screenshots do not match
143143 # In bash: 1 == false
@@ -146,7 +146,7 @@ function screenshotsMatch {
146146 fi
147147
148148 # Write detailed NCC information to a file (and don't overwrite the diff file)
149- compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null > " $NCC_FILE "
149+ compare -verbose -metric NCC " $IMAGE_OLD " " $IMAGE_LATEST " /dev/null & > " $NCC_FILE "
150150
151151 # If statement above didn't exit, that means we have no mismatching hashes and therefore the screenshots match (return true)
152152 # In bash: 0 == true
0 commit comments