@@ -147,32 +147,19 @@ function diff_image() {
147
147
cp $fileA $diff -a.png
148
148
cp $fileB $diff -b.png
149
149
150
- # Calculate the difference metric and store the composite diff image.
151
- local hash=` compare -metric PHASH -highlight-color ' #ff000050' $diff -b.png $diff -a.png $diff -diff.png 2>&1 `
152
-
153
- # Remove scientific notation
154
- local hash6=` printf " %.6f" $hash `
155
- local THRESHOLD6=` printf " %.6f" $THRESHOLD `
156
-
157
- local isGT=` echo " $hash6 > $THRESHOLD6 " | bc -l`
158
- if [ " $isGT " == " 1" ]
159
- then
160
- # Add the result to results.text
161
- echo $name $hash > $diff .fail
162
- # Threshold exceeded, save the diff and the original, current
163
- cp $diff -diff.png $DIFF /$name .png
164
- cp $diff -a.png $DIFF /$name ' _' $ANAME .png
165
- cp $diff -b.png $DIFF /$name ' _' $BNAME .png
166
- echo
167
- echo " Test: $name "
168
- echo " PHASH value exceeds threshold: $hash > $THRESHOLD "
169
- echo " Image diff stored in $DIFF /$name .png"
170
- # $VIEWER "$diff-diff.png" "$diff-a.png" "$diff-b.png"
171
- # echo 'Hit return to process next image...'
172
- # read
173
- else
174
- echo $name $hash > $diff .pass
175
- fi
150
+ # Store the composite diff image.
151
+ # Add the result to results.text
152
+ echo $name $hash > $diff .fail
153
+ # Threshold exceeded, save the diff and the original, current
154
+ cp $diff -diff.png $DIFF /$name .png
155
+ cp $diff -a.png $DIFF /$name ' _' $ANAME .png
156
+ cp $diff -b.png $DIFF /$name ' _' $BNAME .png
157
+ echo
158
+ echo " Test: $name "
159
+ echo " Image diff stored in $DIFF /$name .png"
160
+ # $VIEWER "$diff-diff.png" "$diff-a.png" "$diff-b.png"
161
+ # echo 'Hit return to process next image...'
162
+ # read
176
163
rm -f $diff -a.png $diff -b.png $diff -diff.png
177
164
}
178
165
245
232
echo " You have $num_fails fail(s):"
246
233
head -n $num_fails $RESULTS
247
234
else
248
- echo " Success - All diffs under threshold !"
235
+ echo " Success - No differences !"
249
236
fi
0 commit comments