Author Topic: How to read LensData  (Read 5093 times)

Borrisholt

  • Newbie
  • *
  • Posts: 4
How to read LensData
« on: August 02, 2010, 10:55:51 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16663
    • ExifTool Home Page
Re: How to read LensData
« Reply #1 on: August 02, 2010, 07:01:35 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Borrisholt

  • Newbie
  • *
  • Posts: 4
Re: How to read LensData
« Reply #2 on: August 03, 2010, 12:17:28 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16663
    • ExifTool Home Page
Re: How to read LensData
« Reply #3 on: August 03, 2010, 07:47:36 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Borrisholt

  • Newbie
  • *
  • Posts: 4
Re: How to read LensData
« Reply #4 on: August 03, 2010, 08:59:32 AM »
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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16663
    • ExifTool Home Page
Re: How to read LensData
« Reply #5 on: August 03, 2010, 12:11:24 PM »
Thanks!

BTW, what model of camera is it?

- Phil
« Last Edit: August 03, 2010, 12:23:17 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Borrisholt

  • Newbie
  • *
  • Posts: 4
Re: How to read LensData
« Reply #6 on: August 03, 2010, 12:27:59 PM »
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

  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: How to read LensData
« Reply #7 on: August 03, 2010, 02:52:25 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

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16663
    • ExifTool Home Page
Re: How to read LensData
« Reply #8 on: August 05, 2010, 11:54:13 AM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).