diff options
author | toonn <toonn@toonn.io> | 2022-03-18 19:45:22 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2022-03-18 19:45:22 +0100 |
commit | 89d3683e42f9d220e7e888edc5d82bdb29f423c3 (patch) | |
tree | bfec375066692f1063d068d84e7ee4c75c52ed22 /ranger | |
parent | f52c7bef0528f03db0eb8947797c4cf3b6281b86 (diff) | |
parent | b54f694e99fa5eec0f6833f11a181d2ec96b5505 (diff) | |
download | ranger-89d3683e42f9d220e7e888edc5d82bdb29f423c3.tar.gz |
Merge branch 'SuperNici-drawioPreview'
Diffstat (limited to 'ranger')
-rwxr-xr-x | ranger/data/scope.sh | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index 864e39ab..5e0e66ac 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -262,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 "${DEFAULT_SIZE%x*}" && exit 6 + exit 1;; + esac } handle_mime() { |