Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
31
.bin/OLD/imagecompare
Executable file
31
.bin/OLD/imagecompare
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
c=0
|
||||
find . -mindepth 1 -maxdepth 1 -type f \
|
||||
| grep '....-..-.._' \
|
||||
| cut -b 1-19 \
|
||||
| sort -u \
|
||||
| while read line
|
||||
do
|
||||
things="$(findimagedupes -t 95% -- $line*)"
|
||||
[ -z "$things" ] && continue
|
||||
c=$(( c + 1 ))
|
||||
ls -1l $things \
|
||||
| awk '{ print $5" "$9 }' \
|
||||
| sort -nr \
|
||||
| cut -d" " -f2- \
|
||||
| while read thing
|
||||
do
|
||||
mkdir -p set-$c
|
||||
if [ -z "$PICK" ]
|
||||
then
|
||||
PICK=$thing
|
||||
echo pick set-$c/1-$(basename $PICK)
|
||||
mv $PICK set-$c/1-$(basename $PICK)
|
||||
else
|
||||
echo discard set-$c/2-$(basename $thing)
|
||||
mv $thing set-$c/2-$(basename $thing)
|
||||
fi
|
||||
done
|
||||
PICK=
|
||||
done
|
||||
Reference in New Issue
Block a user