Skip to content

Commit

Permalink
Handle files with leading at signs, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Aug 27, 2021
1 parent c6cfe2e commit 9c369f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,6 @@ GitHub.
will be removed once xterm can handle images greater than 1000x1000.
[Last tested with XTerm(344)].

* Filenames that begin with "@" are special to ImageMagick and it'll
freak out if you don't prepend a directory. (`lsix ./@foo.png`)
(This is a bug in ImageMagick, not lsix).

* Specifying the empty string `""` as a filename makes ImageMagick hang.
(This appears to be an ImageMagick bug / misfeature).

* Long filenames are wrapped, but not intelligently. Would it
complicate this script too much to make it prefer to wrap on whites
space, dashes, underscores, and periods? Maybe.
Expand Down Expand Up @@ -274,4 +267,4 @@ GitHub.

* [VT340 Test](https://github.com/hackerb9/vt340test), a project to document the actual behaviour of the DEC VT340 hardware.

* [Digital ANSI-Compliant Printing Protocol: Level 2 Programming Reference Manual](http://www.vaxhaven.com/images/f/f7/EK-PPLV2-PM-B01.pdf), Chapter 5: Sixel Graphics. An excellent and reasonably clear discussion for anyone who wants to generate or parse sixel graphics.
* [Digital ANSI-Compliant Printing Protocol: Level 2 Programming Reference Manual](http://www.vaxhaven.com/images/f/f7/EK-PPLV2-PM-B01.pdf), Chapter 5: Sixel Graphics. An excellent and reasonably clear discussion for anyone who wants to generate or parse sixel graphics.
9 changes: 7 additions & 2 deletions lsix
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,19 @@ main() {
len=${#onerow[@]}
onerow[len++]="-label"
onerow[len++]=$(processlabel "$1")
onerow[len++]="file://$1"
onerow[len++]="file://$(imescape $1)"
shift
done
montage "${onerow[@]}" $imoptions gif:- \

montage "${onerow[@]}" $imoptions gif:- \
| convert - -colors $numcolors sixel:-
done
}

imescape() {
echo "$@" | sed -e 's|^@|./@|g;'
}

processlabel() {
# This routine is all about appeasing ImageMagick.
# 1. Remove silly [0] suffix and : prefix.
Expand Down

0 comments on commit 9c369f1

Please sign in to comment.