photoprep: preserve image description
This commit is contained in:
parent
a1308423dd
commit
477b5244d5
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user