Some uncommon (I assume) metadata questions

Started by gEEvEE, June 14, 2024, 06:09:44 AM

Previous topic - Next topic

gEEvEE

Dear all, dear Phil,

I have some metadata/ExifTool questions for which I could not find an answer directly. I'm sorry if these questions are trivial. I'm just trying to increase my understanding of metadata.

  • Who gave the IDs to the tags? Phil? Manufacturers? Standards? Are these IDs ExifTool-specific?
  • Why are some IDs numeric ("ID=4096"), while others use words ("id='Flash Compensation") and some letter codes ("id='0043,100B'")?
  • Why are there sometimes jumps in the ID values? For example, why are there no tags with IDs 1 and 2 here?
    • <table name='Nikon::LensData0800' g0='MakerNotes' g1='Nikon' g2='Camera'>
    •    <tag id='0' name='LensDataVersion' type='string' count='4' writable='true'/>
    •    <tag id='3' name='OldLensData' type='undef' count='17' writable='true'/>
    •    <tag id='4' name='ExitPupilPosition' type='int8u' writable='true'/>
  • Are the tables used in ExifTool structures created by Phil, or are they based on the standards/metadata header structure? For example: "Nikon::lensdata0800". Has Nikon decided to generate this Exif section to put lens metadata in, or where did that name come from?
  • Why is there a "lensdata00, 01, 0204, 0400, 0402, 0403 and 0800"? What is the reason for this? Why not have just one table/section called lensdata? If that originates from Nikon, what would be their rationale behind this?
  • How come that indices are needed? For example, why not give the second a different ID?
    •    <tag id='6' name='VRMode' index='0' type='int8u' writable='true'/>
    •    <tag id='6' name='VRMode' index='1' type='int8u' writable='true'/>
  • If I have a bunch of NEF files from different Nikon models, I can just use "-focusDistance" in ExifTool to get the respective focusing distances. However, depending on the Nikon camera model, the focusDistance metainformation might be located in lensdata01, lensdata204 and lensdata 0800. Is there any practical advantage of knowing where the focusDistance info is located?
  • If the Tag ID and sections are coming from the metadata specifications or from the file's header structure, can we assume that "tag id='17' name='MaxApertureAtMinFocal" will always be in "Nikon::LensData0800"?
  • To give undocumented tags a name, does Phil/ExifTool use a controlled vocabulary to prevent a newly decyphered tag from being named FocusDistance, while another deciphered tag gets named focusingDistance?

My best regards, and thanks for any insights! Geert

Phil Harvey

Geert,

Quote from: gEEvEE on June 14, 2024, 06:09:44 AM1. Who gave the IDs to the tags? Phil? Manufacturers? Standards? Are these IDs ExifTool-specific?

These are the ID's stored in the file by whatever wrote the metadata, or offsets into binary data structures.  They are defined by the specification if there is one, but the manufacturers rarely release a specification.

Quote2. Why are some IDs numeric ("ID=4096"), while others use words ("id='Flash Compensation") and some letter codes ("id='0043,100B'")?

Of course they are all just bytes in the file, but they are converted to numbers or strings as most
convenient for human interpretation.  If there is a specification, I use the same conversion as in the spec.

Quote3. Why are there sometimes jumps in the ID values? For example, why are there no tags with IDs 1 and 2 here?

This may represent either a gap in our knowledge (maybe 1 and 2 are unknown, in which case the -u or -U option may extract this information), or a gap in the range of ID's defined by the specification.  For the specific case of the LensData0800 tags, this is a binary data structure and the ID's are byte offsets into the structure, so in this odd case the tags actually overlap.
 

Quote4. Are the tables used in ExifTool structures created by Phil, or are they based on the standards/metadata header structure?

Both.

Quote5. Why is there a "lensdata00, 01, 0204, 0400, 0402, 0403 and 0800"? What is the reason for this? Why not have just one table/section called lensdata? If that originates from Nikon, what would be their rationale behind this?

Different cameras write this binary data structure differently.  Also, it may change with camera firmware version.

Quote6. How come that indices are needed? For example, why not give the second a different ID?

Some tags are appropriate only for certain conditions.  Take a look at the source code "Condition" expression to see what these are.

Quote7. If I have a bunch of NEF files from different Nikon models, I can just use "-focusDistance" in ExifTool to get the respective focusing distances. However, depending on the Nikon camera model, the focusDistance metainformation might be located in lensdata01, lensdata204 and lensdata 0800. Is there any practical advantage of knowing where the focusDistance info is located?

This is hard to answer.  In most cases this location is not signicant, but there are exceptions.

Quote8. If the Tag ID and sections are coming from the metadata specifications or from the file's header structure, can we assume that "tag id='17' name='MaxApertureAtMinFocal" will always be in "Nikon::LensData0800"?

Only if there is no Condition for this tag.  Check the source code.

Quote9. To give undocumented tags a name, does Phil/ExifTool use a controlled vocabulary to prevent a newly decyphered tag from being named FocusDistance, while another deciphered tag gets named focusingDistance?

I try to be consistent, but I don't always succeed.

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

gEEvEE

#2
Waaw, thank you so much, Phil! One last question: I suppose a section/table like "lensdata 0800" is named like this by Nikon. This is not a name you came up with, right?

Oh, and where in the source code would I find more information on a tag's "condition"?
Cheers, Geert

StarGeek

Quote from: gEEvEE on June 14, 2024, 09:55:01 AMOh, and where in the source code would I find more information on a tag's "condition"?

There's no single place, you would have to search through the source code.

I use a program called dnGREP, which is basically a grep program with a GUI. I start with something I know, like a tag name. Depending upon what you're looking for, that could be enough, though if you are getting into something deeper, you might have to follow the trail of several variables.
* 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: gEEvEE on June 14, 2024, 09:55:01 AMW I suppose a section/table like "lensdata 0800" is named like this by Nikon. This is not a name you came up with, right?

I gave it that name.

QuoteOh, and where in the source code would I find more information on a tag's "condition"?

For these tags, look at the LensData0800 table here.  Notice that some tags have a "Condition" element in the tag information structure.

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

gEEvEE