Un-prefix tags on command line

Started by rishid, October 04, 2021, 06:34:55 AM

Previous topic - Next topic

rishid

Hi,

I have been trying to read through the documentation, specifically the list of tags page. One of the things I am confused about is how does one determine which tags will be written when using an un-prefixed tag?

exiftool '-Author=rishid' foo.jpg

What I am trying to figure out is what tags (including groups) correspond to the usage of "Author" here? Is this documented somewhere or a way to see the tags without actually doing the writing via the command line? It seems you can use some (all?) tags without a prefix. I would also think this is file type dependent as well.

Thanks.


Phil Harvey

This is mentioned in the -TAG=VALUE section of the application documentation:

            TAG may contain one or more leading family 0, 1, 2 or 7 group
            names, prefixed by optional family numbers, and separated colons.
            If no group name is specified, the tag is created in the preferred
            group, and updated in any other location where a same-named tag
            already exists.  The preferred group is the first group in the
            following list where TAG is valid: 1) EXIF, 2) IPTC, 3) XMP.


Also, you can add -v2 to the command to see what tags ExifTool wants to write.  For example:

> exiftool -artist=me -v2 test.jpg
Writing PNG:Artist
Writing UserData:Artist if tag exists
Writing ItemList:Artist if tag exists
Writing Keys:Artist
Writing Pentax:Artist if tag exists
Writing XMP-tiff:Artist if tag exists
Writing XMP-xmpDM:Artist if tag exists
Writing IFD0:Artist
======== test.jpg
Rewriting test.jpg...
  Editing tags in: APP0 APP1 CIFF ExifIFD IFD0 ItemList JFIF Keys MakerNotes PNG UserData XMP
  Creating tags in: APP1 IFD0 Keys PNG
JPEG APP1 (96 bytes):
  Rewriting IFD0
    + IFD0:Artist = 'me'
JPEG DQT (130 bytes):
JPEG SOF0:
JPEG DHT (73 bytes):
JPEG SOS
    1 image files updated


- 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

#2
When it comes to video files, where the same tag name can often be located in multiple groups, you can find the priorities on the Quicktime tags page

   When writing, ExifTool creates both QuickTime and XMP tags by default, but the group may be specified to write one or the other separately. If no location is specified, newly created QuickTime tags are added in the ItemList location if possible, otherwise in UserData, and finally in Keys,

Phil, maybe this should be added to the -TAG=VALUE as well?


Quote from: rishid on October 04, 2021, 06:34:55 AMIt seems you can use some (all?) tags without a prefix. I would also think this is file type dependent as well.

Yes, all tags can be used without setting a group name and it can be file type dependent as well.  For example, setting Comment in a jpeg file will set the jpeg specific File:Comment while in a video file it will set ItemList:Comment.

But since the same tag name can often be found in multiple groups, some tags are marked as "Avoid".  For example, in the case of XMP:Author, that tag can be written as XMP-pdf:Author, XMP-xmp:Author, and XMP-acdsee:Author.  The latter two are marked with "Avoid", indicated by a slash / in the "Writable".  XMP-xmp:Author is avoided because it is non-standard and XMP-acdsee:Author is avoided because it is specific to the ACDSee software, which has a tendency to create their own tags rather than use existing standards.
* 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).

Phil Harvey

Quote from: StarGeek on October 04, 2021, 11:10:07 AM
Phil, maybe this should be added to the -TAG=VALUE as well?

I have changed the description in the -TAG=VALUE section to indicate that it applies to JPEG and TIFF-format files only.  I don't think I want to get into mentioning the details about all of the other types here.  Right now, QuickTime is probably the one with the most complex rules, but a number of other formats have specific groups of their own, and detailing all of these would be too much.

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