From: Bastian Dehn Date: Fri, 18 Jul 2025 09:31:22 +0000 (+0200) Subject: change vorbis cover without xxd X-Git-Tag: v1.0.0^2~46 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f8f5ddfb4a602597993dff31e5f6015902ef70a9;p=albentohandy.git change vorbis cover without xxd --- diff --git a/albentohandy b/albentohandy index fc9a202..4ffd455 100755 --- a/albentohandy +++ b/albentohandy @@ -149,9 +149,6 @@ check_programms() command -v rsync > /dev/null \ || errlog "command rsync not found" \ || return $? - command -v xxd > /dev/null \ - || errlog "command xxd not found" \ - || return $? } convert_process() diff --git a/libs/voribs.sh b/libs/voribs.sh index 9b1579e..e2295dc 100644 --- a/libs/voribs.sh +++ b/libs/voribs.sh @@ -38,6 +38,8 @@ cover_to_metadata() { local inputfile="$1" local outputfile="${inputfile/.jpg/.txt}" + local filesize=$(cat $inputfile | wc -c) + local filesizehex=$(printf "%08x" "$filesize") # picture typ (jpg) printf "%b" "\x0\x0\x0\x3" > $outputfile @@ -54,8 +56,9 @@ cover_to_metadata() # Color Count (zero) printf "%b" "\x0\x0\x0\x0" >> $outputfile # File Size - printf "0: %.8x" $(cat $inputfile | wc -c) \ - | xxd -r -g4 >> $outputfile + for i in {0..6..2}; do + printf "%b" "\x${filesizehex:$i:2}" >> $outputfile + done cat $inputfile >> $outputfile }