gopher.sh: support for ImageUtils.sh
authorNiki Roo <niki@nikiroo.be>
Fri, 6 Apr 2018 14:46:56 +0000 (16:46 +0200)
committerNiki Roo <niki@nikiroo.be>
Fri, 6 Apr 2018 14:46:56 +0000 (16:46 +0200)
gopher.sh

index 6b16f264bed62a596d1feefe2f826639f0e0cab7..e433ac0a620c093acc9b39a423efaf437c669803 100755 (executable)
--- a/gopher.sh
+++ b/gopher.sh
@@ -143,14 +143,16 @@ download)
 ;;
 g|I)
        if convert -h >/dev/null 2>&1; then
-               if jp2a -h >/dev/null 2>&1; then
+               if ImageUtils.sh --help >/dev/null 2>&1; then
+                       ImageUtils.sh --mode=DITHERING \
+                               --width=74 "$tmp" | less
+               elif jp2a -h >/dev/null 2>&1; then
                        convert "$tmp" "$tmp.jpg"
-                       # not supported: --chars=" ░▒▓█"
-                       jp2a --border --colors --chars=" .-+=o8#"\
+                       jp2a --border --chars=" .-+=o8#"\
                                --width=74 "$tmp.jpg" | less
                else
-                       echo "required program not found to view images: jp2a" \
-                               | less
+                       echo "required program not found to view images:" \
+                               jp2a or ImageUtils.sh | less
                fi
        else
                echo "required program not found to view images: convert" \