@@Exiftool_logo@@
Image processing
sudo apt install libimage-exiftool-perl
export SOURCE=/media/mint/K-1/DCIM/105_0419
export TARGET=/tmp/DCIM/%Y/%Y-%m-%d
export FILENAME_TEMPLATE=%Y-%m-%dT%H-%M-%S_%%f%%-c.%%le
export IMG=2020-04-19T17-49-39_IMGP5520.jpg
#export TITLE="Copy ${SOURCE} to ${TARGET}"
exiftool -progress:${TITLE} -v \
-o . '-Directory<CreateDate' -d ${TARGET} -r ${SOURCE}
exiftool -progress:${TITLE} -v \
'-filename<CreateDate' -d ${FILENAME_TEMPLATE} -r -ext jpg -ext dng ${TARGET}
Option | Description |
---|---|
-filename<CreateDate |
rename the image file using the image’s creation date and time. |
-d |
Set format for date/time values |
-ext jpg -ext dng |
only rename files with the “jpg” or “dngw” extension. |
-r |
recursively |
%Y-%m-%dT%H-%M-%S_%%f%%-c.%%le
(YYYY-MM-DDThh-mm-ss_filename-copy.ext)
Read all IPTC data from image
exiftool -json -IPTC:all ${IMG}
exiftool -tagsfromfile "/media/mint/K-1/DCIM/default.json" "-caption-abstract<Description" "-keywords<tags" 2020-04-19T17-49-39_IMGP5520.jpg
# Write all data from in.json to image
exiftool -tagsfromfile in.json ${IMG}
desc2Json.cmd - Compile descriptions into JSON for ExifTool]
:Latin1_UTF8 :: How does ExifTool handle coded character sets? :: The following command changes the internal IPTC encoding to UTF‑8 (from Windows Latin1 unless CodedCharacterSet was already “UTF8”):
exiftool -tagsfromfile @ -iptc:all -codedcharacterset=utf8 *.jpg