Skip to content

Commit e158896

Browse files
authored
Handle animated webp same as gif
That is, only explode into individual frames if the file is specified on the command line. Otherwise, just show the first frame.
1 parent e49fc61 commit e158896

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lsix

+4-4
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
9-
# B9 August 2021
8+
# Version 1.8.1
9+
# B9 November 2023
1010

1111
# See end of file for USAGE.
1212

@@ -188,13 +188,13 @@ main() {
188188
if [[ $# == 0 ]]; then
189189
# No command line args? Use a sorted list of image files in CWD.
190190
shopt -s nullglob nocaseglob nocasematch
191-
set -- *{jpg,jpeg,png,gif,webp,tiff,tif,p?m,x[pb]m,bmp,ico,svg,eps}
191+
set -- *{jpg,jpeg,png,,webp,tiff,tif,p?m,x[pb]m,bmp,ico,svg,eps}
192192
[[ $# != 0 ]] || exit
193193
readarray -t < <(printf "%s\n" "$@" | sort)
194194

195195
# Only show first frame of animated GIFs if filename not specified.
196196
for x in ${!MAPFILE[@]}; do
197-
if [[ ${MAPFILE[$x]} =~ gif$ ]]; then
197+
if [[ ${MAPFILE[$x]} =~ (gif|webp)$ ]]; then
198198
MAPFILE[$x]="${MAPFILE[$x]}[0]"
199199
fi
200200
done

0 commit comments

Comments
 (0)