Short vs. Long syntaxes to specify Tag Groups and individual Tags

Started by jsx97, May 29, 2024, 02:36:00 AM

Previous topic - Next topic

jsx97

To remove a group of tags, e.g. Exif, I can use either the short -exif= or the long -exif:all= syntax:

exiftool -overwrite_original_in_place -exif= image.jpg
exiftool -overwrite_original_in_place -exif:all= image.jpg
Whereas to remove an individual tag, e.g. Foo, the only syntax, as far as I understand, is the short one, -Foo=:

exiftool -overwrite_original_in_place -Foo= image.jpg
Is this correct? If the answer is "yes":

Does it mean that it is a good idea, in order to keep things as clear as possible, to use the short syntax for individual tags only, and to use the long one for groups, so that when you see something like -Xyz=, you have an additional spot that it is not a group but just an individual tag?

Phil Harvey

I don't know what you mean by short syntax and long syntax.

-exif:all specifies all tags in the EXIF group

-exif specifies the EXIF tag (EXIF as a block)

-foo specifies the Foo tag without a group, but it is often a good idea to qualify this with a group name, like -exif:Foo for example.

- 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 ($).

StarGeek

Quote from: Phil Harvey on May 29, 2024, 08:57:08 AM-exif:all specifies all tags in the EXIF group

-exif specifies the EXIF tag (EXIF as a block)

To further break this down, in some commands, there are reasons you may need to deal with the data as a block or as individual tags. Though this usually isn't in regard to deleting tags.

For example, MakerNotes, the proprietary tags added by camera manufacturers, cannot be created or deleted individually. ICC_Profile is similar.  Instead, you have to copy the entire block if you need that data in a different file.

Also, some people create their own tags. Exiftool cannot copy these tags individually without a definition for them. In those cases, the only way to copy them without creating a definition is to copy the data as a block.

Quote-foo specifies the Foo tag without a group, but it is often a good idea to qualify this with a group name, like -exif:Foo for example.

A lot of the time, this isn't a problem. If you are trying to remove the EXIF:DateTimeOriginal tag, then in all likelihood, you probably want to remove the XMP:DateTimeOriginal tag as well. And there are times when, due to a misunderstanding of the mess that is metadata, someone may try to use a specific group name in a file that cannot hold that group.  For example, you can't create/remove EXIF:DateTimeOriginal in an XMP sidecar file, because XMP sidecars can only hold XMP data.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

jsx97

Phil and StarGeek, many thanks for explanations, and sorry for a late reply.

Quote from: Phil Harvey on May 29, 2024, 08:57:08 AM-foo specifies the Foo tag without a group

Could you elaborate, does it mean that using, e.g.,

exiftool -overwrite_original_in_place -orientation= my_image.jpg

a) will remove the Orientation tag from each group in which it exists?

b) Or does it mean that it will remove only the Orienatation tag that isn't a part of any group? (In case such "groupless" tags are even possible. Are they?)

StarGeek

When you don't include a group, in your example, it means that exiftool will try to remove every tag with that name that it can. There are no groupless tags. All tags are part of some group.  See the Tags Names page.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).