From 1c3e3f60f1415a8ef4df73585911b532c1bf60d5 Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Nov 2022 21:24:31 +0100 Subject: 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 --- ranger/data/scope.sh | 8 ++++---- 1 file 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/*) -- cgit v1.2.3