Main Menu

Lens ID consistency

Started by surfer, March 27, 2011, 09:51:15 AM

Previous topic - Next topic

surfer

Hello,

I am very interested in extracting the lens model name for each photo. Does exiftool always display the lens name under the same tag or is it different for different manufacturers? Upon testing so far with Canon and Nikon cameras I have noticed that "Lens" and "LensID" seem to be present in both photos with the same format. Is this true for other brands as well?

Thanks!

Phil Harvey

LensID is a composite tag designed to be consistent across all makes.

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

surfer


surfer

Hi again,

I ran exiftool through a db of photos and for some canon lenses I just got id's instead of text.
The "Lens" tag would for example contain data like:

EF28mm f/1.8 USM
EF50mm f/1.4 USM
EF70-200mm f/4L USM
EF24-105mm f/4L IS USM
EF-S60mm f/2.8 Macro USM
EF100-400mm f/4.5-5.6L IS USM
EF-S18-135mm f/3.5-5.6 IS
EF-S18-55mm f/3.5-5.6 IS

While the LensID would have numbers such as 144.

Are these lenses supported or are these special cases?

Thanks



Phil Harvey

If you want the numbers for Canon lenses, use -lenstype# on the command line.  If you want the model names, use -lensid.

Please tell me the lens name and the corresponding unknown LensID number if ExifTool doesn't properly report the model name for a lens and I will add it to the list.

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

surfer

Hi,

I tried with the -lensid but nothing changed. I have written a script to go through about 20,000 photos. I get a lot of photos with empty LensID values but I assume this is because of re-saved photos. I however as described above get a lot of photos with LensID numbers. See the list below. The first value is the LensID and the second is the Lens.

                        10   105mm
         102   18.0-35.0 mm f/3.5-4.5
         105   70.0-300.0 mm f/4.0-5.6
         118   50.0 mm f/1.8
         120   24.0-120.0 mm f/3.5-5.6
         127   18.0-70.0 mm f/3.5-4.5
         138   105.0 mm f/2.8
         140   18.0-55.0 mm f/3.5-5.6
         144   55.0-200.0 mm f/4.0-5.6
         148   18.0-55.0 mm f/3.5-5.6
         154   18.0-55.0 mm f/3.5-5.6
         158   18.0-105.0 mm f/3.5-5.6
         159   35.0 mm f/1.8
         161   17-35mm
         161   17-50mm
         165   EF70-200mm f/2.8L USM
         168   EF28mm f/1.8 USM
         178   EF28-135mm f/3.5-5.6 IS USM
         180   EF35mm f/1.4L USM
         183   EF100-400mm f/4.5-5.6L IS USM
         186   EF70-200mm f/4L USM
         190   EF100mm f/2.8 Macro USM
         198   EF50mm f/1.4 USM
         205   18.0-125.0 mm f/3.8-5.6
         206   150.0-500.0 mm f/5.0-6.3
         229   105.0 mm f/2.8
         230   EF24-70mm f/2.8L USM
         231   EF17-40mm f/4L USM
         235   EF-S10-22mm f/3.5-4.5 USM
         236   EF-S60mm f/2.8 Macro USM
         237   EF24-105mm f/4L IS USM
         246   EF16-35mm f/2.8L II USM
         249   10.0-20.0 mm f/4.0-5.6
         251   EF70-200mm f/2.8L IS II USM
         25501   50mm F1.7
         27   NULL
         27   50-50mm
         28   100mm F2.8 Macro
         28   70-300mm
         29   EF50mm f/1.8
         29   EF50mm f/1.8 II
         3 44   Sigma or Tamron Lens
         39   EF75-300mm f/4-5.6
         4 249   TAMRON XR DiII 18-200mm F3.5-6.3
         40   EF28-80mm f/3.5-5.6
         45   EF-S18-55mm f/3.5-5.6
         48   EF-S18-55mm f/3.5-5.6 IS
         49   EF-S55-250mm f/4-5.6 IS
         50   105.0 mm f/2.8
         50   DT 18-250mm F3.5-6.3
         50   EF-S18-200mm f/3.5-5.6 IS
         51   28.0-75.0 mm f/2.8
         51   EF-S18-135mm f/3.5-5.6 IS
         54   24.0 mm f/2.8
         56   85.0 mm f/1.8
         6   NULL
         65535   NULL
         65535   17.0-35.0 mm
                        65535   5.0-100.0 mm
         65535   6.0-22.5 mm
         65535   70.0-200.0 mm
         65535   EF24-105mm f/4L IS USM
         67   50.0 mm f/1.4
         78   135.0 mm f/2.0

Phil Harvey

I really don't understand what you are doing.  ExifTool will identify almost all of the lenses you mention.

If you could provide the exact command line you are using and a sample output maybe I can understand the problem.

Also, what version of exiftool are you using?

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

surfer

No worries. I am running the latest 8.56.
I have script that runs the command exiftool -j pathtoimage.
I run the command on 20000 images and get about 150 unique lenses in return. Most of the lenses get a model name from LensID such as "AF-S DX VR Zoom-Nikkor 18-105mm f/3.5-5.6G ED" and "Canon EF 50mm f/1.8 II", but for some images I just get a number in return as shown above. For example one image gives the LensID "29" and the corresponding Lens value "EF50mm f/1.8". Why is a number returned instead for these images? Is this lens different from the others?

surfer

If you want I can e-mail some sample images that output these numbers.

Thanks!

Phil Harvey

Thanks for the details.

Quote from: surfer on May 26, 2011, 01:42:01 PM
but for some images I just get a number in return as shown above.

This is very odd, because you should get an output like "Unknown (130)", and not just a number.  But you should only get this for unknown lenses.

QuoteIf you want I can e-mail some sample images that output these numbers.

Yes, please!  Send them to philharvey66 at gmail.com

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

surfer

Great. I have sent you an e-mail now :)

Phil Harvey

Thanks for the samples.

Ah, right.  I forgot about XMP:LensID.  Adobe introduced this tag after I had already established the Composite:LensID tag generated by ExifTool.  Use the -G1 option to see which one you are getting.

Honestly, I don't see how I can make things consistent with these Adobe XMP tags.  I don't have enough information to properly convert the LensID numbers stored by Adobe.  Too bad they do it this way instead of just preserving the maker notes.  Dumb, really.

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

surfer

I understand. I seem to get "XMP-aux:LensID" for these photos.
So the only solution for the time being is that I filter out the values that don't have the "Composite:LensID" tag? I guess I will need to run the command twice to get one with the -G1 option and one without as the key's will change then for each photo when I get the other values?

It's a shame that the information from these lenses get lost but as you said it's dumb that Adobe can't make things consistent. Is it mainly adobe that does this or do other popular apps do this as well?

Thanks!

Phil Harvey

There should be no need to run the command twice.  Just ignore the XMP:LensID with --xmp:lensid.

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

surfer

Thanks I will try that!
Is there a chance by using that option that I might miss any lenses that would be supported by exiftool?