get lens name from image

Started by joe999, September 23, 2014, 01:41:28 PM

Previous topic - Next topic

joe999

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?

Phil Harvey

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

joe999

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!

StarGeek

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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

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

joe999