diff options
author | toonn <toonn@toonn.io> | 2022-11-18 21:24:31 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2023-05-25 17:02:11 +0200 |
commit | 1c3e3f60f1415a8ef4df73585911b532c1bf60d5 (patch) | |
tree | 2fac96e8f0863efefb2aa7d169e9cd73c42cfd3d | |
parent | ae3af7cae4a4f652984adf88fb5f2d06f8decb85 (diff) |
scope.sh: Enable DjVu previews by default
ImageMagick requires a large amount of memory to process DjVu files and
is run on anything with a MIME type matching `image/*`. By enabling the
special case for DjVu files by default, we either use `ddjvu` or we exit
instead of trying to run them through ImageMagick. Preventing this from
happening.
PR #1947 tried to address this similarly. The difference is it uses
ImageMagick's convert on the ddjvu output to make sure it produces a
JPEG. This shouldn't really be necessary and avoiding ImageMagick
altogether seems nicer in this case.
Fixes #2366
Closes #1947
-rwxr-xr-x | ranger/data/scope.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 2e9983ee..2f643421 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -147,10 +147,10 @@ handle_image() { exit 1;; ## DjVu - # image/vnd.djvu) - # ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \ - # - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \ - # && exit 6 || exit 1;; + image/vnd.djvu) + ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \ + - "${IMAGE_CACHE_PATH}" < "${FILE_PATH}" \ + && exit 6 || exit 1;; ## Image image/*) |