1
0
Fork 0

photoprep: preserve image description

This commit is contained in:
tastytea 2024-02-10 19:52:26 +01:00
parent a1308423dd
commit 477b5244d5
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 5 additions and 0 deletions

View File

@ -23,10 +23,15 @@ local size=${o_size[2]}
local format=${o_format[2]}
mkdir -p photoprep
local jq_filter='.[0] | {"ImageDescription", "UserComment", "Comment", "Description", "Description-en-US", "Description-de-DE"}'
for file in ${@}; do
newfile=photoprep/${file##*/}
newfile=${newfile%.*}.${format}
local exif_json=$(mktemp --suffix='.photoprep.json')
exiftool -json ${file} | jq ${jq_filter} | grep -v null > ${exif_json}
magick -quality ${quality} ${file} -auto-orient -strip -resize ${size} ${newfile}
exiftool -json=${exif_json} -quiet -overwrite_original ${newfile}
rm ${exif_json}
print -n '.'
done
print