Don't perform the first call to compare if we've seen a difference
in the EXIF info. This means that we won't run the (potentially expensive) first compare if we have seen a metadata change, in particular a file size change. We already know that there's a difference.
This commit is contained in:
@ -132,11 +132,16 @@ diff_clean_names()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
exifdiff=
|
||||||
if which exiftool > /dev/null
|
if which exiftool > /dev/null
|
||||||
then
|
then
|
||||||
d1="$(exif "$f1")"
|
d1="$(exif "$f1")"
|
||||||
d2="$(exif "$f2")"
|
d2="$(exif "$f2")"
|
||||||
diff_clean_names "$d1" "$d2"
|
diff_clean_names "$d1" "$d2"
|
||||||
|
set +e
|
||||||
|
diff -q "$d1" "$d2" >/dev/null
|
||||||
|
exifdiff=$?
|
||||||
|
set -e
|
||||||
else
|
else
|
||||||
diff_clean_names "$f1" "$f2"
|
diff_clean_names "$f1" "$f2"
|
||||||
fi
|
fi
|
||||||
@ -154,7 +159,7 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if compare "$f1" "$f2" /dev/null
|
if [[ $exifdiff = 0 ]] && compare "$f1" "$f2" /dev/null
|
||||||
then
|
then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user