FHMWG 'Exiftool handle"

Started by ScannerBoy, October 29, 2024, 08:51:22 PM

Previous topic - Next topic

ScannerBoy

Back in 2021 I was looking at the then recently published FHMWG metadata comments and asked a few questions
https://exiftool.org/forum/index.php?topic=12935.msg69931#msg69931

In the meantime FHMWG has updated their comments, see:
https://github.com/fhmwg/current-tags/blob/stage2-essentials/stage2-essentials-overview.md#metadata-properties

In the document they speak about Exiftool and recommend it (at least by implication) when they say:
QuoteKeeping metadata properties straight can be a challenge. The names are similar and it's not always clear which property is actually being written.

Exiftool is an open-source software for metadata management that uses handles for metadata fields based on groups and tag names to uniquely identify metadata properties. The exiftool handle is provided for each metadata field using the group and tag name displayed when using the -G -s options for exiftool. Exiftool group names are EXIF, IPTC (for IIM properties), and XMP. If the tag names are part of a structure, the tag name is flattened so that each field has a unique name.
While the most obvious place to ask my question would be on a FHMWG site, their initial FaceBook page seems dormant and the new main site seems mainly output, not a forum, hence I took a chance to ask here.

Unfortunately, they do not give details beyond using the "-a-G" options.
When I run those option against a typical image I get the expected) output something like:

[XMP]           ICC Profile Name                : sRGB IEC61966-2.1
[XMP]           Creator Tool                    : Microsoft Windows Photo Viewer 6.1.7600.16385
[XMP]           Modify Date                     : 2016:09:27 14:01:23-07:00
[XMP]           Create Date                     : 2011:01:13 15:44:42
[XMP]           Metadata Date                   : 2016:09:27 14:01:23-07:00
[XMP]           Supplemental Categories         : Genealogy|Photos|Group
....
[IPTC]          Supplemental Categories         : Genealogy|Photos|Group
[IPTC]          Date Created                    : 2011:01:13
[IPTC]          Time Created                    : 15:44:42-08:00
[IPTC]          Originating Program             : Microsoft Windows Photo Viewer 6.1.7600.16385

Presumably, I can parse such a line and extract the group and tag names and concatenate them to get the 'Exiftool handle', unless of course the is a much simpler way??

FWIW, if I use different command line options, such as " -s -g1", I get a completely different data organization and get group names which the recommended options do not give, such as:

---- XMP-x ----
XMPToolkit                      : Image::ExifTool 11.74
---- XMP-iptcCore ----
CountryCode                     : GRC
CreatorCity                     : London

Does anyone have more experience with, or better insight into the FHMWG recommendations?



Phil Harvey

I think -G1 (specific location) may be a better recommendation than -G, especially for XMP which has many same-named tags in different namespaces.  These namespaces are differentiated by the -G1 group names, but not -G.

The simpler way to see the "handle" as you call it is to use the -args option:

exiftool -args -G1 FILE

The output of this command is in the same form as you would use to assign a value to each of the tags (handles), or to extract them specifically by dropping the =VALUE part.

Having said this though, the simpler -G grouping (information type) may be fine for your purposes.  It is certainly fine for EXIF and IPTC, and is OK for XMP too if you are writing only to the most common namespaces since these will be preferred when creating new tags.

Start here if you want more information about these tag groupings.

- 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: ScannerBoy on October 29, 2024, 08:51:22 PMUnfortunately, they do not give details beyond using the "-a-G" options.

Actually, I think you mean -G -s. The -G (-groupNames) option shows the name of the group the tag belongs to, e.g. XMP/IPTC/EXIF, and the -s (-short) option show the actual tag name. Without the -s option, you are getting tag descriptions, which can have spaces in them.

QuotePresumably, I can parse such a line and extract the group and tag names and concatenate them to get the 'Exiftool handle', unless of course the is a much simpler way??

Maybe the -args (-argFormat) option? This option outputs the data in a format that could be called with the -@ (Argfile) option to reinsert the data.

C:\>exiftool -G -a -s -e -args --file:all y:\!temp\Test4.jpg
-ExifTool:ExifToolVersion=12.98
-EXIF:XResolution=72
-EXIF:YResolution=72
-EXIF:ResolutionUnit=inches
-EXIF:ModifyDate=2024:10:29 12:00:00
-EXIF:YCbCrPositioning=Centered
-EXIF:ExifVersion=0232
-EXIF:DateTimeOriginal=2024:10:29 12:00:00
-EXIF:CreateDate=2024:10:29 12:00:00
-EXIF:ComponentsConfiguration=Y, Cb, Cr, -
-EXIF:FlashpixVersion=0100
-EXIF:ColorSpace=Uncalibrated
-XMP:XMPToolkit=Image::ExifTool 12.98
-XMP:CreatorTool=Microsoft Windows Photo Viewer 6.1.7600.16385

QuoteFWIW, if I use different command line options, such as " -s -g1", I get a completely different data organization and get group names which the recommended options do not give, such as:

The -G (-groupHeadings) option just formats the data a bit differently than the -G (-groupNames) option, giving a group name header rather than showing the group name on every line.

In both cases, with or with out the 1, you're still getting the group name, just a different level. Without the 1, -g/-G will give you Group 0 names (the same as using -g0/-G0). This returns the name of the main group a tag belongs to and listed as "Information Type". Adding a 1 (-g1/-G1) gives the Group 1 names which are "Specific Location".
* 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).

StarGeek

Again, I was too slow, but posted it anyway

Quote from: Phil Harvey on October 29, 2024, 09:21:30 PMI think -G1 (specific location) may be a better recommendation than -G, especially for XMP which has many same-named tags in different namespaces.  These namespaces are differentiated by the -G1 group names, but not -G.

I tend to disagree with this. Exiftool will almost always write to the most common group, which are usually the IPTC Photo Metadata Standard tags. Tags with the same name in other namespaces are usually the tags you don't want to be writing to unless for using with a specific program, like ACDSee. I usually advise keeping it as simple as possible. Use only the tag name unless you need to differentiate between groups, like in the case of Headline and then add the Group 0 name. The only time I suggest using the Group 1 name is when it is absolutely necessary, and I don't think I've ever seen the need for this with any of the IPTC, MWG, or EXIF standards. I suggest Group 1 names only when the tag is marked as Avoid or has been written to the wrong place, such as when we've seen ModifyDate in IDF1 instead of IDF0. Or maybe if it's a Quicktime tag, with the insane mess that those tags are.

Most people don't want to dig into the details of metadata groups. I feel adding specific groups when it isn't necessary is something that's more likely to increase confusion.
* 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).