News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

How to read LensData

Started by Borrisholt, August 02, 2010, 10:55:51 AM

Previous topic - Next topic

Borrisholt

These are the lens data for two of my lenses (Nikon camera):

Sigma Macro 50mm F2.8 EX DG
3031303120270600113A5032545050242435240F541C550000000000000106

Sigma 135-400mm F4.5-5.6 APO Aspherical
30313031103C0E00115C9826447398343C1C3C1765214F0000000000000202

But I can't find out how to decrypt the data

on http://www.exiftool.org/TagNames/Nikon.html you write :"Nikon encrypts the LensData information below if LensDataVersion is 0201 or higher, but the decryption algorithm is known so the information can be extracted." but not a wort about how


So can any one please telle me how to decrypt the LensData ... Thank you "

Jens borrisholt

Phil Harvey

Out of interest, does ExifTool recognize the lens properly?  (ie. what is the value of the LensID tag?)

Use the exiftool -v3 to see both the encrypted and decrypted LensData in hex.

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

Borrisholt

Sigma Macro 50mm F2.8 EX DG is  recognize by ExifTool but
Sigma 135-400mm F4.5-5.6 APO Aspherical isn't, because you would expect '26 44 73 98 34 3C 1C 02' for LensID but the real LensID is
'26 44 73 98 34 3C 1C 03'

So now back to my question HOW do I decrypt the data .. I'm not intrested in any program to do the job, I'm interested in doing it my self.

Phil Harvey

Thanks for the lens information.

The decryption is done in the Decrypt() subroutine in lib/Image/ExifTool/Nikon.pm.  You will find this file in the full ExifTool distribution.

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

Borrisholt

Thanks and

The LensId for  Nikon AF-S DX Zoom-Nikkor 18-70mm f/3.5-4.5G IF-ED is normally listed as

'7F 40 2D 5C 2C 34 84 06' byt my observations says : '7F 40 2D 5C 2C 34 84 02'

Phil Harvey

#5
Thanks!

BTW, what model of camera is it?

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

Borrisholt

Hi

It is a Nokon d70

By the way I must be blind. I cant find the source code any where ....

If you want the pictures from taken with these lenses please write me an email : udleveret.ExifTool@Borrisholt.dk

Jens Borrisholt

BogdanH

Quote from: Borrisholt on August 03, 2010, 12:27:59 PM
...
By the way I must be blind. I cant find the source code any where ....
...

Hi Jens,
If you're on Windows, Nikon.pm file is inside Windows Temp folder, i.e:
c:\Users\YourName\AppData\Local\Temp\par-YourName\cache-exiftool\inc\lib\Image\Exiftool

Greetings,
Bogdan

Phil Harvey

Hi Jens,

Bogdan is correct, but sometimes it is easier just to download the full Perl distribution if you want to look at the source code.

Robert Rottmerhusen has copied me on the email you sent him with one image, but I get the expected LensID when I run exiftool, and not the LensID you reported.  Did you use exiftool to extract the LensID number?  If so, what exiftool version and what system are you using?

Thanks for any help you can provide in sorting this out.

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