summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-06 10:35:51 +0100
committerhut <hut@lavabit.com>2012-03-06 10:35:51 +0100
commit87b0d82e736f0ee64220be44b9d9875af00824c4 (patch)
treeb0f01e4fc63b225850b1468c92ae9639a4ec8a0a
parent15bcea18269c62850146d08a575b3e1e139faba5 (diff)
downloadranger-87b0d82e736f0ee64220be44b9d9875af00824c4.tar.gz
scope.sh: added exiftool
-rwxr-xr-xranger/data/scope.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh
index ed4f01e1..3a6504dd 100755
--- a/ranger/data/scope.sh
+++ b/ranger/data/scope.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 # ranger supports enhanced previews.  If the option "use_preview_script"
-# is set to True (by default it's False), this script will be called
-# and its output is displayed in ranger.  ANSI color codes are supported.
+# is set to True and this file exists, this script will be called and its
+# output is displayed in ranger.  ANSI color codes are supported.
 
 # NOTES: This script is considered a configuration file.  If you upgrade
 # ranger, it will be left untouched. (You must update it yourself.)
@@ -67,9 +67,13 @@ case "$mimetype" in
 		img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;;
 	# Display information about media files:
 	video/* | audio/*)
+		have exiftool && exiftool "$path" && exit 5
 		# Use sed to remove spaces so the output fits into the narrow window
-		mediainfo "$path" | sed 's/  \+:/: /;'
-		success && exit 5 || exit 1;;
+		if have mediainfo; then
+			mediainfo "$path" | sed 's/  \+:/: /;'
+			success && exit 5
+		fi
+		exit 1;;
 esac
 
 exit 1