Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New tags for Nikon's FlashInfo0106 and FlashInfo0107 #154

Open
postscript-dev opened this issue Aug 28, 2022 · 3 comments
Open

New tags for Nikon's FlashInfo0106 and FlashInfo0107 #154

postscript-dev opened this issue Aug 28, 2022 · 3 comments

Comments

@postscript-dev
Copy link

postscript-dev commented Aug 28, 2022

In Exiv2/exiv2#1941, a user requested that ExifTool's FlashInfo0106 and FlashInfo0107 were added to exiv2 and that new tags were discovered. This has now been merged into exiv2 and the PR can be found in Exiv2/exiv2#2274.

The .exv test files provided by the user are available in Exiv2/exiv2#1941 and exiv2's output of the NikonFl6/NikonFl7 tags can be found in exiv2-NikonFl6-NikonFl7-output.txt. As part of discovering the tags, I inserted the user's .exv files into empty JPEGs and then looked at them in Nikon's NX Studio software. The inserted JPEG files can be found in Exiv2/exiv2#1941 and NX Studio's metadata output is available in NX_Studio-NikonFl6-NikonFl7-output.csv.

Let me know if you have any questions.

@boardhead
Copy link
Contributor

Thanks for the information, and sorry for the delay in responding. I had another bash at combining this new flash info into ExifTool today, but gave up again (for now) because it was too painful. It might be just me, but I find the Exiv2 code very confusing. I'll have another bash at it later when I have more time.

@postscript-dev
Copy link
Author

postscript-dev commented Jan 19, 2023

@boardhead

Thanks for the information, and sorry for the delay in responding.

No problem, whenever you have some time.

It might be just me, but I find the Exiv2 code very confusing.

As an aside, in Exiv2, a tag's value can be output as 'vanilla' (i.e. raw) or 'translated' (i.e., interpreted). The 'translated' value contains any conditions, conversions and formatting of the data.

For your purposes, the code to look at is in the NikonFl6 and NikonFl7 groups as they list the flash tags. In each tag entry, the last parameter is a function pointer which is called when the user requests the 'translated' value of a tag. For the last parameter, when the 'translation' is simple substitution, a macro is used (written in capital letters) to display an array value. E.g., using the printExifVersion function and nikonFlashSource array

constexpr TagInfo Nikon3MakerNote::tagInfoFl7_[] = {
    {0, "Version", N_("Version"), N_("Identifies the NikonFl version"), IfdId::nikonFl7Id, SectionId::makerTags,
     undefined, 4, printExifVersion},
    {4, "FlashSource", N_("Flash source"), N_("The type of flash used"), IfdId::nikonFl7Id, SectionId::makerTags,
     unsignedByte, 1, EXV_PRINT_TAG(nikonFlashSource)},

In the same src/nikonmn_int.cpp file, you can find the info on a tag by searching for either the 'translation' function or array.

Additionally, one difference between ExifTool and Exiv2 is how non-applicable tags are handled. Exiftool's tag conditions allow a tag to be excluded from the user's output. However, Exiv2 only marks a tag as not-applicable by outputting a localised version of n/a in the 'translated' output. Some of the new flash tags 'translations' sometimes output n/a but you may prefer to exclude those tags instead.

I hope the above thoughts help. If you have any questions then let me know.

@boardhead
Copy link
Contributor

Thanks. I did find all that, but there is a fair bit of digging through code to find how each value conversion is done, and that is what was taking most of my time. Luckily, some conversions apply to more than one tag, so once I figure out a few of these it should get faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants