ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Mac2 on September 07, 2016, 03:26:08 AM

Title: What is the 'best' lens tag?
Post by: Mac2 on September 07, 2016, 03:26:08 AM
Lens data in image files is a mess. No real standard, different vendors using the same id for different lenses, sometimes even reusing their own ids for different lenses...

In my application I try to present the best possible lens information to my users.
I do this by looking at the lens Composite tags produced by ExifTool, and by looking at several of them (top-down):

Composite\LensID-4\LensID
Composite\LensID-3\LensID
Composite\LensID-2\LensID
Composite\LensID\LensID

In my experience, if LensID-4 exists and conains data, this data is the most detailed lens info ExifTool could find or make up for a given image.

I have just received some images taken with the Nikon 1 model (various editions).
For these images, none of the above tags seems to be filled. Instead a new Composite tag named LensSpec is delivered by ExifTool.
When I look at the documentation for Composite tags, I learn that LensSpec is produced from Nikon:Lens  and Nikon:LensType. So this seems to be something specific for (some?) Nikon cameras.

My question: Would it be safe to extend my 'find best lens info' algorithm to first look at the Composite::LensSpec and if this tag exists and has data use it? And if the tag does not exist fall back to checking the regular composite tags?

I have looked in the FAQ and searched this community etc. but I could not really find an answer.

Title: Re: What is the 'best' lens tag?
Post by: Phil Harvey on September 07, 2016, 08:17:52 AM
How are you seeing the instance number of the LensID tag?  I thought these were hidden to the user -- the numbers may change depending on what type of file is processed.

Typically, LensSpec gives the lens features, but not the actual model. 

But you are right, lens data is a mess.

- Phil
Title: Re: What is the 'best' lens tag?
Post by: Mac2 on September 07, 2016, 10:03:20 AM
Hi, Phil

I import data from ExiftTool via XML output (-X option). And this output delivers the LensID... values.
I've implemented this algorithm to find the best lens model about two or three years ago  - it might not be optimal or not longer valid...
Looking at a recent sample database shows no lensid-* tags anymore? Most be a thing of the past now.

Do you think that Exif::Main\LensModel is the better tag?

For example, I have files with this data:

LensID: AF Zoom-Nikkor 18-35mm f/3.5-4.5D IF-ED
LensModel: 18.0-35.0 mm f/3.5-4.5

so here LensID clearly the better tag.

Other files have no LensModel at all, just LensID. Other files have only "lens".
My application deals with images taken over the past 20 years and mangled with all kinds of software ::)

My aim is to produce a standard Lens tag that holds the best possible description...


Title: Re: What is the 'best' lens tag?
Post by: Phil Harvey on September 07, 2016, 10:07:25 AM
For Nikons, LensID is definitely the tag to use.  If LensID isn't available, then I would use LensModel, and if that isn't available, then LensType, and last maybe LensSpec.  But this is off the top of my head -- I don't have time to evaluate this properly right now.

- Phil
Title: Re: What is the 'best' lens tag?
Post by: Mac2 on September 07, 2016, 10:09:24 AM
Thanks, I will perform some own tests with this info. This helps me already!