]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
change generate cover info
authorBastian Dehn <hhaalo@arcor.de>
Thu, 17 Jul 2025 17:24:11 +0000 (19:24 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 17 Jul 2025 17:24:11 +0000 (19:24 +0200)
libs/voribs.sh

index 903a95656a896faba8b1939962ee127bd7647cb8..df1ce9420d66d859eadf2441265ed70f2167849c 100644 (file)
@@ -39,25 +39,22 @@ cover_to_metadata()
        local inputfile="$1"
        local 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
+       # picture typ (jpg)
+       printf "%b" "\x0\x0\x0\x3" > $outputfile
+       # mime type (image/jpeg)
+       printf "%b%s" "\x0\x0\x0\xa" "image/jpeg" >> $outputfile
+       # description length (zero)
+       printf "%b" "\x0\x0\x0\x0" >> $outputfile
+       # Width (zero)
+       printf "%b" "\x0\x0\x0\x0" >> $outputfile
+       # Heigth (zero)
+       printf "%b" "\x0\x0\x0\x0" >> $outputfile
+       # Color depth (zero)
+       printf "%b" "\x0\x0\x0\x0" >> $outputfile
+       # Color Count (zero)
+       printf "%b" "\x0\x0\x0\x0" >> $outputfile
        # File Size
-       printf "0: %.8x" $(wc -c "$inputfile" \
-               | cut --delimiter=' ' --fields=1) \
+       printf "0: %.8x" $(cat $inputfile | wc -c) \
                | xxd -r -g0 >> $outputfile
        cat $inputfile >> $outputfile
 }