-
Notifications
You must be signed in to change notification settings - Fork 278
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
Missing Lens Information for Nikon Z6 + FTZ + F-Mount Lens #1433
Comments
I think ExifTool knows how to decode LensData and Exiv2 can't decode that.: https://exiv2.org/tags-nikon.html
I'll study this next week. |
I've looked at this and regret that I cannot help. The main reason is that the data is encrypted and I don't know the algorithm. The other reason is that, after 12 years of working on Exiv2, I intend to retire at the end of 2020. My last working day will be Thursday 2020-12-17. I have other matters I'd like to finish before Thursday. However, here's what I have discovered in looking at your issue. There is a Nikon decoded in dcraw.c which is really available on the internet. When I run you file with that code it outputs:
As you can see, it located tag 0x98 of 108 bytes at offset 00012748. My tvisitor program locates that also:
And I can correctly locate the data as follows: 519 rmills@rmillsmm-local:~/gnu/exiv2/team/book/build $ dmpf '/Users/Shared/Jenkins/Home/userContent/testfiles/Exiv2/NikonLens/CH0_0174.NEF:13690->73846' count=108 skip=61902
0xf1ce 61902: 0801.of6...%U.......lZ....yl...n -> 30 38 30 31 fe 6f 66 36 13 14 c7 25 55 18 95 da ea ad c7 03 6c 5a ca 09 85 cd 79 6c 14 f7 15 6e
0xf1ee 61934: ... .[Q...w...MV.....c...].....> -> 02 d1 db 20 a0 5b 51 82 ee 95 77 94 ec 7f 4d 56 9a 19 d3 c8 f8 63 09 ea 06 5d ef bc c4 07 85 3e
0xf20e 61966: 2a.pPk.R.%g....&.....sy.6...t..- -> 32 61 cb 70 50 6b c1 52 1e 25 67 e4 9c 8f bd 26 ca a9 c3 18 a8 73 79 ba 36 ed df 0c 74 17 f5 2d
0xf22e 61998: b..._{1"N.W4 -> 62 f1 bb c0 00 7b 31 22 4e b5 57 34
520 rmills@rmillsmm-local:~/gnu/exiv2/team/book/build $ When I run your file with ExifTool -v5, we see:
I've looked up the ExifTool code in Nikon.pm and it is:
|
Thanks for having a look @clanmills. |
I clicked the "comment" button in error. You can read about it now! |
I see ExifTool references the decryption at: 4) http://www.cybercom.net/~dcoffin/dcraw/. It's rather odd that my version of that code does not decode that data. Oh well, somebody's going to have fun with this. |
The latest version of Dave's code is here and has the code to decrypt 0x98: https://github.com/ncruces/dcraw/blob/master/parse.c The decrypter requires the serial number which is stored in the MakerNote. 864 rmills@rmillsmm-local:/Users/Shared/Jenkins/Home/userContent/testfiles/Exiv2/NikonLens $ exiv2 -pv --unknown CH0_0174.NEF | grep 1d
0x001d Nikon3 SerialNumber Ascii 8 6078248
865 rmills@rmillsmm-local:/Users/Shared/Jenkins/Home/userContent/testfiles/Exiv2/NikonLens $ And the LensData is: 865 rmills@rmillsmm-local:/Users/Shared/Jenkins/Home/userContent/testfiles/Exiv2/NikonLens $ exiv2 -pv --unknown CH0_0174.NEF | grep LensData
0x0098 Nikon3 LensData Undefined 108 48 56 48 49 254 111 102 54 19 20 199 37 85 24 149 218 234 173 So fixing this doesn't look very difficult. However, I'm now retired. Somebody else will have to deal with this. |
Good News: I've added the nikon_decrypt() function from parse.c to the tvisitor.cpp code in my book. At the moment, it is not successfully decrypting the data because the function expects the data to start "02" and it starts "08". Puzzling. Some debugging in parse.c and I'll probably solve that. As far as Exiv2 is concerned, I am retired and will not be submit code in future. However, I want the book to deal with everything I know about Exiv2 to help a future maintainer to understand the code (which is non-trivial). Currently in the book, I say:
I'm happy to develop the decryption and document it in my book. The ciphered code for Sony is discussed here: #906 and is the mostly complex change I every made to Exiv2. It is discussed in the book. I'll solve nikon_decrypt() and document/discuss it in the book. Not so happy news: I'm disappointed that no member of the Community has shown any interest in becoming the maintainer of Exiv2. I've done everything I can to leave the project in a clean and tidy state and my book explains everything I know about Metadata and Exiv2. https://clanmills.com/exiv2/book/ I will support, mentor and encourage somebody to maintain Exiv2. At this moment, it seems unlikely! However, Exiv2 is a unique and critical resource to the Open Source Graphics Community, and I expect a maintainer will volunteer in 2021. I intend to give a presentation at LGM in Rennes in May 2021 and to run an afternoon workshop based on my book. https://discuss.pixls.us/t/maintainer-urgently-needed-for-exiv2/21547 So now I leave, with my head held high I remain optimistic about the future of Exiv2. Don't think that I will change my mind and return from retirement. I have to retire some day and that day is ..... today. |
Success!
|
@clanmills should we close this issue, since it's now supported in the maintenance branch? |
Yip. Close it. We had the meeting with the darktable (and rawspeed) people on Saturday and we have a plan for v0.27.4. The meeting notes are on the chat-server and I'll update the Exiv2 RoadMap today. One day, there will be a 0.28 release from 'master'. This feature and about 100 PRs will have to merged from 0.27-maintenance into master. Who will do this and when will that happen? I have no idea. If everybody behaved as you have, everything will be fine and a new maintainer will appear to make this happen. |
Describe the bug
The problem I encountered is trying to get lens info out of an image file produced with a Nikon Z6 + FTZ Adapter + 70-200mm f2.8/G IF ED VR
Compared to a picture taken with a native Z mount lens:
As you can see it's missing for example
LensMake
,LensModel
, andLensSerialNumber
information.I googled a bit and found this link describing a similar problem in exiftool.
This was fixed in exiftool shortly after in this github commit
And now it produces:
which still misses the above mentioned fields but adds
LensID
and provides aLensIDNumber
.exiv2 fails to produce a
LensIDNumber
and thus doesn't allow me to workaround missing information with a local config file as is described in the man pages.Note, I tried with the current release, and build the master and 0.27-maintenance but had the same result for all three versions
To Reproduce
I've provided a file to @clanmills
Expected behavior
Ideally provide
LensMake
andLensModel
but at least aLensIDNumber
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: