diff options
author | toonn <toonn@toonn.io> | 2022-03-18 18:54:27 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2022-03-18 19:36:58 +0100 |
commit | bdd90a730d0ca3e26376dc1247a6f5fc29011b4d (patch) | |
tree | 62d8134129df8c7f081815c2e516e911a8281cec | |
parent | 164c44c599daa814f9e5b773e074a97834554c5c (diff) | |
download | ranger-bdd90a730d0ca3e26376dc1247a6f5fc29011b4d.tar.gz |
scope: Move draw.io preview to handle_image
-rwxr-xr-x | ranger/data/scope.sh | 35 |
1 files changed, 17 insertions, 18 deletions
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() { |