about 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-05-03 18:00:41 +0200
commit27e5907532c6b44192015f08490f11bb75395e5d (patch)
treeb0f01e4fc63b225850b1468c92ae9639a4ec8a0a
parent15bcea18269c62850146d08a575b3e1e139faba5 (diff)
downloadranger-27e5907532c6b44192015f08490f11bb75395e5d.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