From bdd90a730d0ca3e26376dc1247a6f5fc29011b4d Mon Sep 17 00:00:00 2001 From: toonn Date: Fri, 18 Mar 2022 18:54:27 +0100 Subject: scope: Move draw.io preview to handle_image --- ranger/data/scope.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'ranger') diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 2d1321c2..003ce65b 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -90,11 +90,6 @@ handle_extension() { ## Preview as text conversion (unsupported by pandoc for markdown) odt2txt "${FILE_PATH}" && exit 5 exit 1;; - -# drawio) -# ## Preview as image -# draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 -# exit 1;; ## XLSX xlsx) @@ -267,19 +262,23 @@ handle_image() { # mv "${TMPPNG}" "${IMAGE_CACHE_PATH}" # } - # case "${FILE_EXTENSION_LOWER}" in - # ## 3D models - # ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH} - # ## is hardcoded as jpeg. So we make a tempfile.png and just - # ## move/rename it to jpg. This works because image libraries are - # ## smart enough to handle it. - # csg|scad) - # openscad_image "${FILE_PATH}" && exit 6 - # ;; - # 3mf|amf|dxf|off|stl) - # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 - # ;; - # esac + case "${FILE_EXTENSION_LOWER}" in + ## 3D models + ## OpenSCAD only supports png image output, and ${IMAGE_CACHE_PATH} + ## is hardcoded as jpeg. So we make a tempfile.png and just + ## move/rename it to jpg. This works because image libraries are + ## smart enough to handle it. + # csg|scad) + # openscad_image "${FILE_PATH}" && exit 6 + # ;; + # 3mf|amf|dxf|off|stl) + # openscad_image <(echo "import(\"${FILE_PATH}\");") && exit 6 + # ;; + # drawio) + # draw.io -x "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" --width 1920 && exit 6 + # exit 1;; + + esac } handle_mime() { -- cgit 1.4.1-2-gfad0