Is it possible to add Nikon makernote tags with exiv2?
Added by Michal K about 11 years ago
Hi,
I've just discovered this software and I just have a quick question before I go further with my experiments: can exiv2 add new makernote tags to Nikon NEF files? I'm specifically interested in adding these: PictureControlVersion, PictureControlName, PictureControlBase, PictureControlAdjust and PictureControlQuickAdjust. I'm going to use Win executable. Thanks!
Replies (7)
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Andreas Huggel about 11 years ago
That should work. Try! And if you run into problems, post the specific issue.
Andreas
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Michal K about 11 years ago
This seems to work somehow - I added the picture control tags to a nef file but ViewNX doesn't like it and says that the optional picture control on which the one from this file is based, is missing. It is strange bacause I copied exactly all picture control exif tags from a working nef and both exiv2 and exiftool show the tags are identical. But I understand that ViewNX can check for other data that we don't know about which makes it misbehave. BTW, I'm trying to set picture control tags in a file from D60 (which does not have picture controls). I tried copying all makernote exif from a picture control nef from D3000 to D60 nef and surprisingly it worked - ViewNX allowed editing without problems. I now want to do something similar but instead of copying everything just set the picture control tags. I wonder - the tags show up in different order in the D3000 and the modified D60 file - does this make any difference? Could it be that ViewNX accepts the tags only if they are written in the order specified by Nikon?
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Andreas Huggel about 11 years ago
Interesting project :) As this is all Nikon proprietary stuff your guess is as good as mine. From past experience, I'm not aware of any issue with the order of the tags. (According to the TIFF standard they are supposed to be sorted by tag number in an IFD, but in makernote IFDs that's not always the case.) What I have seen before is that some software only works if certain tags are present. In these cases, I would incrementally add or remove tags until it works/doesn't work anymore.
Andraes
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Michal K about 11 years ago
Yes, interesting but really hard trying to hack proprietry stuff :). I have tried incrementally adding tags but I didn't go anywhere that route. The best result was when I used exiftool to copy all makernotes from a true D3000 nef to a D60 nef. But still I need to adjust certain tags.
Now I experience weird behaviour with exiv2. I use it to insert Nikon Capture data (ViewNX adjustment settings) to a nef file like this:
set Exif.Nikon3.CaptureData 64 169 134 122...
Of course, there's a lot more data than this. This command corrupts the nef somehow - the settings appear to be okay in ViewNX but as soon as I try to load the raw image the colours are corrupted, there's a strong red/magenta cast and the image seems to be unusable. But I can work around this problem by running exiv2 twice. First time I can change anything simple, for example:
set Exif.Nikon3.WhiteBalance SUNNY
or:
set Exif.Nikon3.Quality RAW
Then when I inject the CaptureData in the second pass, the file works correctly in ViewNX. This is very strange and it took me a while to figure this out. Is this a bug in exiv2?
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Andreas Huggel about 11 years ago
May be a bug. Can you please provide an original image and the exact steps that work and don't work, so that I can reproduce this here and compare the resulting images in detail? (This reminds me of #701.)
Andreas
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Michal K about 11 years ago
Okay, I'll send you the file soon.
Another question - is this possible to use exiv2 to add the FirmwareVersion tag? It is not reported by exiv2 and seems to be unsupported. It's the one listed here: http://owl.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#ShotInfo. I suspect it is necessary for ViewNX when I add the picture control tags but neither exiv2 not exiftool allows me to access it. Or perhaps there is a way to add unsupported tags somehow? My guess is the key name should be Exif.NikonSi02xx.FirmwareVersion.
RE: Is it possible to add Nikon makernote tags with exiv2? - Added by Andreas Huggel about 11 years ago
Yes, you should be able to view and add/modify unknown tags within known groups, like this case. Run exiv2 -u -pa img.NEF to see the unknown tags and use the tagnumber in hex notation to set them, e.g., Exif.NikonSi02xx.0x0004
Andreas