Skip to content

Commit f0c23fe

Browse files
committedJun 10, 2024
ImageMagick 6 / 7 compatibility
I don't have IM7 to test, but I believe this should work on either.
1 parent 3a43179 commit f0c23fe

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
 

‎lsix

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
# Requirements: just ImageMagick (and a Sixel terminal, of course)
77

8-
# Version 1.8.2
9-
# B9 November 2023
8+
# Version 1.9
9+
# B9 June 2024
1010

1111
# See end of file for USAGE.
1212

@@ -54,7 +54,9 @@ if [[ ${BASH_VERSINFO[0]} -eq 3 ]]; then
5454
fi
5555
fi
5656

57-
if ! command -v montage >/dev/null; then
57+
magick=$(type -p magick) # For ImageMagick 6 <-> 7 compatibility.
58+
59+
if ! command -v $magick montage >/dev/null; then
5860
echo "Please install ImageMagick" >&2
5961
exit 1
6062
fi
@@ -103,7 +105,7 @@ autodetect() {
103105
104106
You may test your terminal by viewing a single image, like so:
105107
106-
convert foo.jpg -geometry 800x480 sixel:-
108+
$magick convert foo.jpg -geometry 800x480 sixel:-
107109
108110
If your terminal actually does support sixel, please file a bug
109111
report at http://github.com/hackerb9/lsix/issues
@@ -241,8 +243,8 @@ main() {
241243
onerow[len++]="file://$1"
242244
shift
243245
done
244-
montage "${onerow[@]}" $imoptions gif:- \
245-
| convert - -colors $numcolors sixel:-
246+
$magick montage "${onerow[@]}" $imoptions gif:- \
247+
| $magick convert - -colors $numcolors sixel:-
246248
done
247249
}
248250

0 commit comments

Comments
 (0)
Please sign in to comment.