Author Topic: Lens type as variable  (Read 21698 times)

Offline JGVilla

  • Newcomer
  • *
  • Posts: 7
    • View Profile
Lens type as variable
« on: May 22, 2007, 11:42:56 AM »
At this moment you can specify "lens" under image info.
However that is the focal length used for that specific photo.
I have several zoom lenses with overlapping ranges.
For me it would be useful to be able to specify "lens type"
e.g "Nikon 17-55 VR" or "Nikon 18-200 VR"
This information is available in the EXIF data (at least for Nikon).
Maybe I missed something and is it already possible.
In that case please bring me up to date how to do the tric.
Otherwise I put it up for the "future whishlist".
Regards -Jan-

Offline Whatlarks

  • Newcomer
  • *
  • Posts: 15
    • View Profile
Re: Lens type as variable
« Reply #1 on: May 27, 2007, 03:58:31 PM »
As a Nikon owner with overlapping lenses, I would also like to second this request for the lens type variable to be added.

Many thanks,
Ian




Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Lens type as variable
« Reply #2 on: May 27, 2007, 11:22:36 PM »
Though very nice, getting the precise lens description (brand, exact model, etc.) is actually quite complex.  Exiftool by Phil Harvey http://www.sno.phy.queensu.ca/~phil/exiftool/ is able to decipher it, at least for Nikon cameras (haven't checked for other cameras).

On the other hand, if you can live with just the focal length/range and max aperture (or range for non fixed aperture lenses), this can be done more easily.  For Nikon it is in the makernotes, tag 132.  4 rational numbers together make up min-focal, max-focal, max-aperture-at-min-focal, and max-aperture-at-max focal.  I'm sure other camera brands provide the same data somewhere as well.

Cheers,
    Hayo
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Lens type as variable
« Reply #3 on: May 28, 2007, 07:26:10 AM »
Jan,

At this moment you can specify "lens" under image info.
However that is the focal length used for that specific photo.
I have several zoom lenses with overlapping ranges.
For me it would be useful to be able to specify "lens type"
e.g "Nikon 17-55 VR" or "Nikon 18-200 VR"
This information is available in the EXIF data (at least for Nikon).
Maybe I missed something and is it already possible.
In that case please bring me up to date how to do the tric.
Otherwise I put it up for the "future whishlist".

This is a commonly requested feature but it requires a fair amount of work and while it is already on the wish list, it is currently at a lower priority than other features at this time.  I don't have a specific time/date for you on the implementation.

-Kirk

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #4 on: June 18, 2007, 01:11:40 PM »
Until lens type (and perhaps some additional camera specific EXIF data) is available in PM, ExifTool does seem to be an excellent alternative for this information. A possible short-term solution could be to utilize ExifTool's ability to copy this data into other fields. However, there does not seem to be any appropriate fields which can easily be utilized. Could custom XMP fields be added which then could be populated using ExifTool, as well as viewed as variables in PM?

Thanks,
Ian

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Lens type as variable
« Reply #5 on: June 18, 2007, 02:31:58 PM »
Ian,

Until lens type (and perhaps some additional camera specific EXIF data) is available in PM, ExifTool does seem to be an excellent alternative for this information. A possible short-term solution could be to utilize ExifTool's ability to copy this data into other fields. However, there does not seem to be any appropriate fields which can easily be utilized. Could custom XMP fields be added which then could be populated using ExifTool, as well as viewed as variables in PM?

While something like that could be done, it would be easier for all involved to just support a {lenstype} variable.

-Kirk

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #6 on: June 18, 2007, 03:15:59 PM »
While something like that could be done, it would be easier for all involved to just support a {lenstype} variable.

I agree that a {lenstype} variable would be a perfect solution. Since you had indicated it was a lower priorty item, I had gotten the impression that it might be something that was a long way off.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Lens type as variable
« Reply #7 on: June 18, 2007, 03:21:07 PM »
While something like that could be done, it would be easier for all involved to just support a {lenstype} variable.

I agree that a {lenstype} variable would be a perfect solution. Since you had indicated it was a lower priorty item, I had gotten the impression that it might be something that was a long way off.

I don't know when we'll get to it, but the method you suggested would be just about as difficult as just doing it within PM directly which would be a better solution anyway.  I understand that this feature is important to some folks and I'll see what I can do about getting it implemented.

-Kirk

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Lens type as variable
« Reply #8 on: June 25, 2007, 03:18:38 PM »
Another vote for this important feature.

An interim solution may be to show the min and max focal length and f-stop as another poster mentioned.  For a 70-200 f2.8 lens, this would be 70/200 2.8/2.8.  For an 18-200 f3.5-5.6 lens this would be 18/200 3.5/5.6.  Perhaps this info could be used in a code replacement like manner where the user would provide a text file which would provide the name of the lens, something like:

70/200 2.8/2.8   AF-S VR Zoom-Nikkor ED 70-200mm f/2.8 G IF

Deven

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #9 on: June 25, 2007, 04:02:42 PM »
At least for Nikon, as already mentioned, basic lens data is placed in MakerNote 0x0084 (min/max focal length and corresponding apertures). Also, in MakerNote 0x0083 is additional "lens type" information (i.e. MF, D, G, VR).  I think this could definitely be used with Code Replacement to lookup a lens name.

However, after taking a good look at the actual lens data and associated decryption algorithm required, I realize that it really wouldn't be that much more work to just extract the full lens information. While I too was suggesting an interm solution, a real {lenstype} variable would probably be worth waiting a little longer for.

-Ian

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Lens type as variable
« Reply #10 on: June 25, 2007, 04:31:54 PM »
Though very nice, getting the precise lens description (brand, exact model, etc.) is actually quite complex.

On the other hand, if you can live with just the focal length/range and max aperture (or range for non fixed aperture lenses), this can be done more easily.  For Nikon it is in the makernotes, tag 132.  4 rational numbers together make up min-focal, max-focal, max-aperture-at-min-focal, and max-aperture-at-max focal.  I'm sure other camera brands provide the same data somewhere as well.

I am adding the {lenstype} (or {lt} for short) variable in 4.5.2.  So far I have handled the Canon lenses of which there are two methods: 1) old way that stored a unique ID that must be looked-up in a table; 2) new way (e.g. 5D, Mk III) that stores the actual ASCII name.

Nikon is a bit more complex, especially due to encryption of this info in certain newer camera models (e.g. D2X).  Even without the encryption it is a bit tricky to convert the various byte patterns into a human readable string (e.g. the pattern for my 17-55 DX f/2.8 lens in ExifTool doesn't exactly match what ExifTool says it should be).  But I can at least use Maker note 132 tag as mentioned to manufacture a string (e.g. "17-55mm Zoom f/2.8") but this won't necessarily have info like DX or VR info (which could be encrypted).  What a mess.  It is questionable whether or not we can legally de-crypt this info due to DMCA, although since Nikon claims this info isn't "encrypted" (just perhaps highly obfuscated) perhaps they have don't have any recourse.  Don't really want to go there.  You know who to complain to.

Other SLR makes will be implemented later if the info can be deciphered.

--dennis

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #11 on: June 25, 2007, 05:15:04 PM »
Quote
It is questionable whether or not we can legally de-crypt this info due to DMCA, although since Nikon claims this info isn't "encrypted" (just perhaps highly obfuscated) perhaps they have don't have any recourse.  Don't really want to go there.  You know who to complain to.

I think many people are dissapointed Nikon took this route. (As I understand, it causes a bigger problem with the encryption/obfuscation of white balance information.)  I can also understand your desire to tread carefully with regards to the legal ramifications of such decryption. It is a bit ironic that Nikon is storing such information in a format designed specifically for the exchange of imaging data, and yet making the exchange of such data difficult. And while I highly doubt Nikon would be successful in attempting to assert any protection under DMCA for the information they choose to "encrypt", I certainly undertand why you wouldn't want to be a test case for it.


Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #12 on: June 25, 2007, 05:28:34 PM »
Quote
But I can at least use Maker note 132 tag as mentioned to manufacture a string (e.g. "17-55mm Zoom f/2.8") but this won't necessarily have info like DX or VR info (which could be encrypted).

As far as I understand Makernote 131 (0x0083) contains some of this information. It contains a single byte with the following lens information...
   bit 0 = MF
   bit 1 = D
   bit 2 = G
   bit 3 = VR

I don't know if this will really help all that much, but combined with the lens data from Makernote 132 it might be of some value. Neither of these EXIF tags are encrypted/obfuscated.


Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Lens type as variable
« Reply #13 on: June 26, 2007, 01:00:30 PM »
Ian,

After playing with this info a bit, I was wrong about my previous statement that the info ExifTool for my DX 17-55 f/2.8 was wrong (I was looking at the wrong byte for one of the "composite" fields).

I have implemented using tags 131 and 132 as much as I can, but I still can't report info like AF-S, DX, IF, or ED.  If I can get Nikon's blessing to decrypt the newer model's lens info then perhaps I'll put the big lookup table into PM to report this extra information on a per-lens basis.  But for now I think the info reported is sufficient.  And I've taken advantage of certain combinations such as VR+D+G apparently always being "G IF-ED" so I can infer IF-ED from this combination (at least for Nikkor glass thus far - this will be wrong for other manufacturer's glass).  If this is a big issue for non-Nikkor glass I can just keep the VR+D+G to "G".

For example, right now PM will report:
AF VR Zoom 24-120mm f/3.5-5.6G IF-ED
AF Zoom 17-55mm f/2.8G

instead of ExifTool's lookup (respectively):
AF-S VR Zoom-Nikkor 24-120mm f/3.5-5.6G IF-ED
AF-S DX Zoom-Nikkor 17-55mm f/2.8G IF-ED

The first example is close enough I figure (missing AF-S and "Nikkor").  The second example additionally missing DX and IF-ED I can't do much about until I do the (blessed) lookup.

--dennis

Offline IanGoldstein

  • Member
  • **
  • Posts: 98
    • View Profile
Re: Lens type as variable
« Reply #14 on: June 26, 2007, 02:35:14 PM »
Dennis,

That's great. I think most people (including me) will be more than happy with that info. I think it primarily serves two purposes -- (1) the question "what lens did I shoot this with" and (2) "which images were shot with lens x".  The info you now have PM  providing will be perfect for that; especially when your cataloging features are fully implemented.

Perhaps one day you can get Nikon's blessing to do the decryption. From what I've read, Adobe is copying encrypted Nikon data when converting NEF's to DNG files, but not decrypting them. It appears they are looking for the same blessing from Nikon before decrypting the white balance information (http://photoshopnews.com/2005/05/23/dng-workflow-part-i/). FWIW, Lightroom reports the lens only by using the focal length(s) and max aperature(s). Your inclusion of the AF, VR, G, etc. prefix/suffix is a welcome bonus.

In case you need it, here's the tag 131 & 132 data I've pulled from some of my images...

    Nikon AF-S VR 70-200mm f/2.8G
    Exif lookup: AF-S VR Zoom-Nikkor 70-200mm f/2.8G IF-ED
    Tag 131: 14 (VR-G-D)
    Tag 132: 70,200,2.8,2.8

    Nikon AF-S VR 18-200mm f/3.5-5.6G
    Exiftool lookup: AF-S DX VR Zoom-Nikkor 18-200mm f/3.5-5.6G IF-ED
    Tag 131: 14 (VR-G-D)
    Tag 132: 18,200,3.5,5.6

    Nikon AF 50mm f/1.8D
    Exiftool lookup: AF Nikkor 50mm f/1.8D
    Tag 131: 2 (D)
    Tag 132: 50,50,1.8,1.8

    Tamron SP 90mm f/2.8 Macro
    Exiftool lookup: Tamron SP AF90mm f/2.8 Di 1:1 Macro
    Tag 131: 2 (D)
    Tag 132: 90,90,2.8,2.8

    Sigma 10-20mm f/4-5.6
    Exiftool lookup: Sigma 10-20mm f/4-5.6 EX DC HSM
    Tag 131: 6 (G-D)
    Tag 132: 10,20,4,5.6

    Sigma 50-500mm f/4-6.3
    Exiftool lookup: Sigma 50-500mm f/4-6.3 EX APO RF HSM
    Tag 131: 2 (D)
    Tag 132: 50,500,4,6.3

-Ian