about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2022-03-18 19:45:22 +0100
committertoonn <toonn@toonn.io>2022-03-18 19:45:22 +0100
commit89d3683e42f9d220e7e888edc5d82bdb29f423c3 (patch)
treebfec375066692f1063d068d84e7ee4c75c52ed22 /ranger
parentf52c7bef0528f03db0eb8947797c4cf3b6281b86 (diff)
parentb54f694e99fa5eec0f6833f11a181d2ec96b5505 (diff)
downloadranger-89d3683e42f9d220e7e888edc5d82bdb29f423c3.tar.gz
Merge branch 'SuperNici-drawioPreview'
Diffstat (limited to 'ranger')
-rwxr-xr-xranger/data/scope.sh30
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() {