Feature request: User Defined Synonyms

Started by busywait, January 15, 2017, 06:53:09 AM

Previous topic - Next topic

busywait

exiftool has a helpful feature that by default new tag values will be written to a preferred group, but updated in all groups where the same named tag exists:
http://www.exiftool.org/index.html#writing
Quote
If a group name is not specified when writing information, then the information is added only to the highest priority group for which the tag name is valid (however, the information is updated in all groups where the tag already existed).

Unfortunately in the different groups (different metadata specifications) the same information might have a different attribute name, for example EXIF:LensModel vs XMP-Aux:Lens.

To ensure that all equivalent attributes are updated users can define the same value for each equivalent tag name an exiftool command, but it might be impossible to replicate the write and update behavior described above. EXIF:LensModel vs XMP-Aux:Lens

That approach requires config files or command lines to be unnecessarily verbose and requires additional technical knowledge of both metadata formats and exiftool syntax:

-EXIF:LensModel="My Lens 50mm f/2.8"
-XMP-Aux:Lens="My Lens 50mm f/2.8"

in combination with exiftool Write Mode -wm command line options instead of

-LensModel="My Lens 50mm f/2.8"


I propose that users can define Tag synonyms as a list with a preferred term (first in the list) and list of equivalent tag names (synonyms):
LensModel,Lens

Data would be written only to the preferred exiftool tag (LensModel in this case), but the synonyms would also be updated if they exist already (Lens in this case).

This is important to me because I have written a script that exposes exiftool config files as it's API - users will have many config files as "EXIF Actions" and I would like minimum complexity in those action files: Image Action Runner)

busywait

Above I proposed a list with a Preferred Term followed by equivalent synonyms. An alternative is for the list to be just a set of equivalent terms (synonyms).

Any term given explicitly in a command is written or updated according to the write mode. Any of the synonym terms are updated only if they exist already. For example
exiftool.exe -syn Lens,LensModel -LensModel="My Lens 50mm f/2.8"

Phil Harvey

What you want is more fine-grained control over whether a tag is created or just updated (ie. the -wm option on a per-tag basis).  You can do this by creating a writable user-defined tag with WriteAlso tags that set the EditOnly flag if you don't want them to be created.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

busywait

Yes! And I'd like to be able to define them with a simple syntax.

Meanwhile, I'll brush up my perl skills. :)