From f8f5ddfb4a602597993dff31e5f6015902ef70a9 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 18 Jul 2025 11:31:22 +0200 Subject: [PATCH] change vorbis cover without xxd --- albentohandy | 3 --- libs/voribs.sh | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 } -- 2.47.3