|
5 | 5 |
|
6 | 6 | # Requirements: just ImageMagick (and a Sixel terminal, of course)
|
7 | 7 |
|
8 |
| -# Version 1.9 |
| 8 | +# Version 1.9.1 |
9 | 9 | # B9 June 2024
|
10 | 10 |
|
11 | 11 | # See end of file for USAGE.
|
@@ -54,22 +54,20 @@ if [[ ${BASH_VERSINFO[0]} -eq 3 ]]; then
|
54 | 54 | fi
|
55 | 55 | fi
|
56 | 56 |
|
| 57 | +shopt -s expand_aliases # Allow aliases for working around quirks. |
| 58 | + |
57 | 59 | # For ImageMagick 6 <-> 7 compatibility.
|
58 |
| -magick=$(type -p magick) |
59 |
| -if [[ ! $magick ]]; then |
60 |
| - convert="convert" |
61 |
| -else |
62 |
| - convert="$magick" |
| 60 | +if type magick &>/dev/null; then |
| 61 | + alias convert='magick' |
| 62 | + alias montage='magick montage' |
63 | 63 | fi
|
64 | 64 |
|
65 |
| -if ! command -v $magick montage >/dev/null; then |
| 65 | +if ! command -v magick montage &>/dev/null; then # (implicit 'or') |
66 | 66 | echo "Please install ImageMagick" >&2
|
67 | 67 | exit 1
|
68 | 68 | fi
|
69 | 69 |
|
70 |
| -shopt -s expand_aliases # Allow aliases for working around quirks. |
71 |
| - |
72 |
| -if command -v gsed >/dev/null; then |
| 70 | +if type gsed &>/dev/null; then |
73 | 71 | alias sed=gsed # Use GNU sed for MacOS & BSD.
|
74 | 72 | fi
|
75 | 73 |
|
@@ -107,7 +105,7 @@ autodetect() {
|
107 | 105 |
|
108 | 106 | You may test your terminal by viewing a single image, like so:
|
109 | 107 |
|
110 |
| - $convert foo.jpg -geometry 800x480 sixel:- |
| 108 | + convert foo.jpg -geometry 800x480 sixel:- |
111 | 109 |
|
112 | 110 | If your terminal actually does support sixel, please file a bug
|
113 | 111 | report at http://github.com/hackerb9/lsix/issues
|
@@ -245,13 +243,13 @@ main() {
|
245 | 243 | onerow[len++]="file://$1"
|
246 | 244 | shift
|
247 | 245 | done
|
248 |
| - $magick montage "${onerow[@]}" $imoptions gif:- \ |
249 |
| - | $convert - -colors $numcolors sixel:- |
| 246 | + montage "${onerow[@]}" $imoptions gif:- \ |
| 247 | + | convert - -colors $numcolors sixel:- |
250 | 248 | done
|
251 | 249 | }
|
252 | 250 |
|
253 | 251 | processlabel() {
|
254 |
| - # This routine is all about appeasing ImageMagick. |
| 252 | + # This routine is mostly to appease ImageMagick. |
255 | 253 | # 1. Remove silly [0] suffix and : prefix.
|
256 | 254 | # 2. Quote percent backslash, and at sign.
|
257 | 255 | # 3. Replace control characters with question marks.
|
@@ -308,7 +306,7 @@ read -s -t 60 -d "c" -p $'\e[c' >&2
|
308 | 306 | # * If your terminal supports changing the number of color registers
|
309 | 307 | # to improve the picture quality, lsix will do so.
|
310 | 308 |
|
311 |
| -# * Only software needed is ImageMagick (e.g., apt-get install imagemagick). |
| 309 | +# * Only software needed is ImageMagick (e.g., apt install imagemagick). |
312 | 310 |
|
313 | 311 | # Your terminal must support SIXEL graphics. E.g.,
|
314 | 312 | #
|
|
0 commit comments