ExifTool Forum

ExifTool => Newbies => Topic started by: joe999 on September 23, 2014, 01:41:28 PM

Title: get lens name from image
Post by: joe999 on September 23, 2014, 01:41:28 PM
Hi,

I have started with the program today so I am a total newbie.

I have read that exiftool can be used to figure out tricky lense names. For example when different makers have an overlap in id.
So I am interested in listing the "lens name" from a filename, and I did

Quoteexiftool IMG_2.jpg | grep -i le

Lens Info                       : 14-30mm f/?
Lens Model                      : TAMRON SP 15-30mm F/2.8 Di VC USD A012
Lens Serial Number              : 0000000000
Lens                            : TAMRON SP 15-30mm F/2.8 Di VC USD A012
Lens Profile Enable             : 0
Lens Manual Distortion Amount   : 0
Lens Profile Setup              : LensDefaults
Lens ID                         : Sigma 24-105mm f/4 DG OS HSM | A

So my question is which of these lens attributes should I use if I want to get the lens name which exiftool interprets the lens to be.
I want to be able to detect lenses in the way that is described here:
http://www.rottmerhusen.com/objektives/lensid/thirdparty.html

In the above example I think there is some software that saved the file that has wrongly written in "Sigma..." as LensId.

So I think "Lens Model" will give me a readable lens model in a reliable way. Correct?
Title: Re: get lens name from image
Post by: Phil Harvey on September 23, 2014, 02:04:12 PM
In general, LensID should be the most reliable, but maybe this isn't the case for your example.  LensModel is not written by many cameras.

- Phil
Title: Re: get lens name from image
Post by: joe999 on September 23, 2014, 02:23:04 PM
It is "Lens Id", "lens" and last "lens model" in order of most likely the correct and most often used.

But are "lens", "lens model" and "Lens Id" computed in some way, or are they just read from the exif info?

Usually lens id in exif is a number. So this "Lens id" value is a readable value computed from that number?

By computing I mean that there can be a "lens id" in exif that can be misleading, and that additional things must be considered.

Thanks!
Title: Re: get lens name from image
Post by: StarGeek on September 23, 2014, 02:24:00 PM
One minor tip, you don't need to pipe to grep.  You can use wildcards to look for tags.  In this case you could have simply used exiftool -*le* IMG_2.jpg.
Title: Re: get lens name from image
Post by: Phil Harvey on September 23, 2014, 02:32:43 PM
You can tell where the information comes from like this:

exiftool -a -G1 "-*le*" IMG_2.jpg

(StarGeek: thanks for the suggestion.  The quotes I added are necessary in Mac/Linux, but not Windows.)

Anything in the "Composite" group has been derived from the values of other tags.

- Phil
Title: Re: get lens name from image
Post by: joe999 on September 24, 2014, 06:01:43 AM
Thanks a lot. Much appreciated.