From 87f39256460859762af1985123ad86c1895c8726 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sun, 9 Feb 2020 16:54:19 +0100 Subject: [PATCH 1/1] termimg script to identify images Simple fingerprint creating an ascii thumbnail for use in diffs. --- termimg | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 termimg diff --git a/termimg b/termimg new file mode 100755 index 0000000..2545c9b --- /dev/null +++ b/termimg @@ -0,0 +1,10 @@ +#!/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; + +state @ch = split //, " .oO@"; +print $ch[ $_ / 256 * @ch ] for /\d+/g; +print $/; +' -- 2.30.0