Skip to content

Commit 28b5696

Browse files
committed
GIFs with colons fail: ImageMagick >=6.9.10 requires "file://"
If a GIF filename has a colon in it, say "11:11.gif", we have to add a prefix to tell ImageMagick to not interpret the colon. This happens because ImageMagick acts funny when we suffix "[0]" at the end of the filename, as we do with GIFs, to pick just the first frame. The previous solution (commit 0535c2b) was to prefix ":" before any GIF files. That worked well in older versions of ImageMagick, but no longer works in 6.9.10. The new solution is to prefix "file://". To prevent the prefix from being displayed in the montage, we add it in after the -label has been generated. The full filename for "11:11.gif" becomes "file://11:11.gif[0]". Note that for simplicity we add the prefix to *all* files, not just GIFs, but it should (hopefully) not have any harmful effects.
1 parent 0123fc0 commit 28b5696

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lsix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

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

8-
# Version 1.7.4
8+
# Version 1.7.5
99
# B9 May 2021
1010

1111
# See end of file for USAGE.
@@ -196,7 +196,7 @@ main() {
196196
# Only show first frame of animated GIFs if filename not specified.
197197
for x in ${!MAPFILE[@]}; do
198198
if [[ ${MAPFILE[$x]} =~ gif$ ]]; then
199-
MAPFILE[$x]=":${MAPFILE[$x]}[0]"
199+
MAPFILE[$x]="${MAPFILE[$x]}[0]"
200200
fi
201201
done
202202
set -- "${MAPFILE[@]}"
@@ -239,7 +239,7 @@ main() {
239239
len=${#onerow[@]}
240240
onerow[len++]="-label"
241241
onerow[len++]=$(processlabel "$1")
242-
onerow[len++]="$1"
242+
onerow[len++]="file://$1"
243243
shift
244244
done
245245
montage "${onerow[@]}" $imoptions gif:- \

0 commit comments

Comments
 (0)