Skip to content

Commit cc92065

Browse files
Fix ImageMagick 6/7 compatibility
1 parent 69d14a4 commit cc92065

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lsix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,13 @@ if [[ ${BASH_VERSINFO[0]} -eq 3 ]]; then
5454
fi
5555
fi
5656

57-
magick=$(type -p magick) # For ImageMagick 6 <-> 7 compatibility.
57+
# For ImageMagick 6 <-> 7 compatibility.
58+
magick=$(type -p magick)
59+
if [[ ! $magick ]]; then
60+
convert="convert"
61+
else
62+
convert="$magick"
63+
fi
5864

5965
if ! command -v $magick montage >/dev/null; then
6066
echo "Please install ImageMagick" >&2
@@ -101,7 +107,7 @@ autodetect() {
101107
102108
You may test your terminal by viewing a single image, like so:
103109
104-
$magick convert foo.jpg -geometry 800x480 sixel:-
110+
$convert foo.jpg -geometry 800x480 sixel:-
105111
106112
If your terminal actually does support sixel, please file a bug
107113
report at http://github.com/hackerb9/lsix/issues
@@ -240,7 +246,7 @@ main() {
240246
shift
241247
done
242248
$magick montage "${onerow[@]}" $imoptions gif:- \
243-
| $magick convert - -colors $numcolors sixel:-
249+
| $convert - -colors $numcolors sixel:-
244250
done
245251
}
246252

0 commit comments

Comments
 (0)