RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
1.96k stars 94 forks source link

Add --exiftool-template to CLI #243

Open RhetTbull opened 3 years ago

RhetTbull commented 3 years ago

Add --exiftool-template TAG TEMPLATE option to export to allow setting of arbitrary EXIF tags using template system. For example:

--exiftool-template "XMP:Subject" "{label}" to use labels as Subjects

--exiftool-template "XMP:Title" "{title,}"

Multi-valued fields would expand to multiple commands to exiftool: --exiftool-template "IPTC:Keywords" "{keywords}" results in: exiftool -IPTC:Keywords=foo -IPTC:Keywords=bar

but could do: --exiftool-template "IPTC:Keywords" "{,+keywords}" to expand in-line to single keyword: exiftool -IPTC:Keywords="foo,bar"

RhetTbull commented 3 years ago

Can be used with or without --exiftool

Once --exiftool run and file is exported, process any --exiftool-template tags.

RhetTbull commented 10 months ago

Add to osxphotos push-exif too.

Also add --exiftool-template-merge which functions the same but merges with data in the file.

Should there also be a --exiftool-remove which removes / clears the tag? --exiftool-remove "XMP:TagsList"