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
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213