From 3cc3d7b8914bb68375d209d773c62692498ffa43 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 5 Dec 2020 15:21:14 +0100 Subject: [PATCH] remove: covertometa integration in albentohandy --- albentohandy | 35 +++++++++++++++++++++++++++++++---- covertometa | 32 -------------------------------- 2 files changed, 31 insertions(+), 36 deletions(-) delete mode 100755 covertometa diff --git a/albentohandy b/albentohandy index 379a9a7..908be81 100755 --- a/albentohandy +++ b/albentohandy @@ -64,10 +64,37 @@ ConvertCoverToMeta() local readonly parallelopts="$2" local readonly scriptdir="$3" - find $workdir -name '*.jpg' \ - | sort \ - | parallel --will-cite --ungroup \ - --sshlogin $parallelopts $scriptdir/covertometa {} + for i in $(find $workdir -name '*.jpg' | sort); do + CoverToMeta $i + done +} + +CoverToMeta() +{ + local readonly INPUTFILE="$1" + local readonly OUTPUTFILE="${INPUTFILE/%.jpg/.txt}" + + # Picture Typ + printf "0: %.8x" 3 | xxd -r -g0 > $OUTPUTFILE + # Mime type + printf "0: %.8x" $(printf "image/jpeg" | wc -c) \ + | xxd -r -g0 >> $OUTPUTFILE + printf "image/jpeg" >> $OUTPUTFILE + # Description + printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE + # Width + printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE + # Heigth + printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE + # Color depth + printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE + # Color Count + printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE + # File Size + printf "0: %.8x" $(wc -c "$INPUTFILE" \ + | cut --delimiter=' ' --fields=1) \ + | xxd -r -g0 >> $OUTPUTFILE + cat $INPUTFILE >> $OUTPUTFILE } CleanupFlac() diff --git a/covertometa b/covertometa deleted file mode 100755 index 1f374e4..0000000 --- a/covertometa +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -main() -{ - local readonly INPUTFILE="$1" - local readonly OUTPUTFILE="${INPUTFILE/%.jpg/.txt}" - - # Picture Typ - printf "0: %.8x" 3 | xxd -r -g0 > $OUTPUTFILE - # Mime type - printf "0: %.8x" $(printf "image/jpeg" | wc -c) \ - | xxd -r -g0 >> $OUTPUTFILE - printf "image/jpeg" >> $OUTPUTFILE - # Description - printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE - # Width - printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE - # Heigth - printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE - # Color depth - printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE - # Color Count - printf "0: %.8x" 0 | xxd -r -g0 >> $OUTPUTFILE - # File Size - printf "0: %.8x" $(wc -c "$INPUTFILE" \ - | cut --delimiter=' ' --fields=1) \ - | xxd -r -g0 >> $OUTPUTFILE - cat $INPUTFILE >> $OUTPUTFILE -} - -main $* -exit 0 -- 2.47.3