diff options
author | hut <hut@hut.pm> | 2017-12-19 22:16:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 22:16:24 +0100 |
commit | e330d3458143fb17f3cf22cc11a7fa588e842ac2 (patch) | |
tree | e73f98495c2fc3ca13a2263440e6b3ea411973e2 | |
parent | b246d160ca9d39431df29f608a11f1a6c0abd1a9 (diff) | |
parent | ab8fd9e8256a1a6c296934af6ffb77bd34671bb2 (diff) | |
download | ranger-e330d3458143fb17f3cf22cc11a7fa588e842ac2.tar.gz |
Merge pull request #995 from Vifon/pdf-previews
scope.sh: Add the image-based PDF previews (disabled by default)
-rwxr-xr-x | ranger/data/scope.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 3bf5785a..560e27da 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -113,6 +113,15 @@ handle_image() { # # Thumbnail # ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6 # exit 1;; + # PDF + # application/pdf) + # pdftoppm -f 1 -l 1 \ + # -scale-to-x 1920 \ + # -scale-to-y -1 \ + # -singlefile \ + # -jpeg -tiffcompression jpeg \ + # -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \ + # && exit 6 || exit 1;; esac } @@ -158,11 +167,11 @@ handle_fallback() { } -handle_extension MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )" if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then handle_image "${MIMETYPE}" fi +handle_extension handle_mime "${MIMETYPE}" handle_fallback |