ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: fstchr on January 03, 2025, 06:10:26 AM

Title: Write tag only if does'nt exist or if empty
Post by: fstchr on January 03, 2025, 06:10:26 AM
Hi
Sorry for my bad english !
I have a lot of pictures and I want to add tags automatically (for a DIR for example). For example, the  TAG's are -XMP:Artist,XMP:OwnerName and XMP:CopyrightOwnerName. In my case, I have 14 tags to change
But I want not change a TAG when its exists and is not NULL.
How can I do with a single exiftool command ? (if many, it's means a long time to execute).
Thanks in advance !
Title: Re: Write tag only if does'nt exist or if empty
Post by: Phil Harvey on January 03, 2025, 08:13:13 AM
The -wm option is for cases like this.  Add -wm cg to your command to only create new tags and not change existing ones.

However, this won't update a tag that exists but is empty.  If this is a problem then we may need another command to deal with these.

- Phil
Title: Re: Write tag only if does'nt exist or if empty
Post by: fstchr on January 04, 2025, 03:22:54 PM
Hi,
it works fine.
Thank you !