From b206d87f4603ebf612cc2e5be60415a8aa99bef8 Mon Sep 17 00:00:00 2001 From: Christian Albers Date: Mon, 17 Jun 2024 20:16:57 +0200 Subject: [PATCH] bilder_aufnummerieren.sh aktualisiert --- bilder_aufnummerieren.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bilder_aufnummerieren.sh b/bilder_aufnummerieren.sh index 56c8f08..701bca1 100644 --- a/bilder_aufnummerieren.sh +++ b/bilder_aufnummerieren.sh @@ -1 +1 @@ -find . -name "*.[Jj][Pp][Gg]" -o -name "*.[Jj][Pp][eE][Gg]" | grep -v out | awk '{printf( "identify %c%s%c\n",34,$0,34);}' |sh|awk -F' JPEG ' '{split($2,i," ");print $1"|"i[1];}'|awk -F'|' 'BEGIN { x = 0; y = 0; size=4000 } {split($2, a, "x"); x = a[1]; y = a[2]; if ( ( x > size ) || ( y > size ) ) {printf("echo %c%s: %s%c; convert %c%s%c -resize %sx%s %c%s_out.jpg%c\n",34,FNR,$1,34,34,$1,34,size,size,34,$1,34); printf("rm %c%s%c\nmv %c%s_out.jpg%c %c%s%c\n",34,$1,34,34,$1,34,34,$1,34);}else{printf("echo %c%s: %s%c zu klein\n\n",34,FNR,$1,34); } }' | sh \ No newline at end of file +ls *.JPG | awk -F'_' '{ if (NR == 1) {basis = substr($0, 5,4);} k = substr( $0, 5,4); erg = k - basis + 1; ergtext = sprintf("IMG_%04d",erg); print "mv "$0" "ergtext".JPG"; }' | sh \ No newline at end of file