Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions diff-image
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ fi

if [[ -d "$f2" ]]
then
f=$(basename "$f1")
f2="$f2/$f"
f=$(basename "$f1")
f2="$f2/$f"
fi

if [[ "$f2" != '/dev/null' ]] && [[ ! -f "$f2" ]]
Expand All @@ -103,7 +103,7 @@ ext="${name1##*.}"

if diff "$f1" "$f2" >/dev/null
then
exit 0
exit 0
fi


Expand Down Expand Up @@ -141,15 +141,15 @@ diff_clean_names()
exifdiff=
if which exiftool > /dev/null
then
d1="$(exif "$f1")"
d2="$(exif "$f2")"
diff_clean_names "$d1" "$d2"
set +e
diff -q "$d1" "$d2" >/dev/null
exifdiff=$?
set -e
d1="$(exif "$f1")"
d2="$(exif "$f2")"
diff_clean_names "$d1" "$d2"
set +e
diff -q "$d1" "$d2" >/dev/null
exifdiff=$?
set -e
else
diff_clean_names "$f1" "$f2"
diff_clean_names "$f1" "$f2"
fi

if $exif_only
Expand Down Expand Up @@ -244,10 +244,10 @@ then
do_compare
if [ -n "$outputPath" ]
then
echo "Copy diff image to $outputPath"
cp "$destfile" "$outputPath"
echo "Copy diff image to $outputPath"
cp "$destfile" "$outputPath"
else
xdg-open "$destfile"
xdg-open "$destfile"
fi
else
w=$(exiftool -p '$ImageWidth' "$f1" || true)
Expand All @@ -259,10 +259,10 @@ else
do_compare
if [ -n "$outputPath" ]
then
echo "Copy diff image to $outputPath"
cp "$destfile" "$outputPath"
echo "Copy diff image to $outputPath"
cp "$destfile" "$outputPath"
else
exec open "$destfile"
exec open "$destfile"
fi
fi
fi