X-Git-Url: http://git.shiar.nl/minime.git/blobdiff_plain/87f39256460859762af1985123ad86c1895c8726..8427205fb250c3a916c6a216aae9a3792d6620ad:/termimg diff --git a/termimg b/termimg index 2545c9b..d17805f 100755 --- a/termimg +++ b/termimg @@ -1,10 +1,12 @@ #!/bin/sh -convert -compress none -resize 66x23 - pgm:- | -perl -nE ' -$_ eq "P2\n" or die "ascii pgm input required\n" if $. == 1; -next if $. <= 3; +convert -compress none +distort SRT '0,0 1,.56 0' -thumbnail ${1:-66x23} - pgm:- | +perl -e ' +<> eq "P2\n" or die "ascii pgm input required\n"; +<>; <>; # ignore depth, dimensions -state @ch = split //, " .oO@"; -print $ch[ $_ / 256 * @ch ] for /\d+/g; -print $/; +my @ch = split //, " .:coO@"; +while (<>) { + print $ch[ $_ * @ch >> 8 ] for /\d+/g; + print $/; +} '