Hi Phil,
What is the best way (via the API) to determine if a file contains a NikonCapture block? It is irrelevant which tags are present in the block, I just need to know if the NikonCapture block is present or not.
I would say test the NikonCaptureData tag, but you will have to request this tag by name to be sure it is extracted.
- Phil
Hi Phil, I haven't tested this with the API, but on the command line this doesn't work. Even if the block is available, testing with e.g. '-if $NikonCapture' didn't work. I had to use e.g, a tag inside the block for this to work (which I don't want to do as the tag might not be there all the time). '-if $NikonCapture:all', however, does work too so I guess I am actually looking for the API version of this :)
Hi Hayo. Not "NikonCapture". Try "NikonCaptureData" as I mentioned.
The API version of $NikonCapture:all would be tricky.
- Phil
Quote from: Phil Harvey on August 30, 2016, 07:15:55 AM
Hi Hayo. Not "NikonCapture". Try "NikonCaptureData" as I mentioned.
Doh, should have read your reply better ::)
Looks like this will work as I intended, great!
Quote from: Phil Harvey on August 30, 2016, 07:15:55 AM
The API version of $NikonCapture:all would be tricky.
Nah, NikonCaptureData will do, I think. So for my full understanding, I guess NikonCaptureData is the tag inside the makernotes which you then further analyse and synthesise into separate NikonCapture tags?
Thanks,
Hayo
Quote from: Hayo Baan on August 30, 2016, 10:41:43 AM
Nah, NikonCaptureData will do, I think. So for my full understanding, I guess NikonCaptureData is the tag inside the makernotes which you then further analyse and synthesise into separate NikonCapture tags?
Correct. Directory-type tags like this that are accessible as blocks have a "Writable" type other than "-" in the Tag Name documentation (https://exiftool.org/TagNames/Nikon.html).
- Phil
Excellent, just one further question. In my script I want to delete the block, but when I set the value to undef, I get the following error: "Sorry, MakerNotes:NikonCaptureData is unsafe for writing", what's the solution for this?
If you're calling SetNewValue(), you must call it with Protected => 1 to be able to write unsafe tags.
- Phil
Right, I knew I missed something... Probably read about this in the past, but forgot ::)