Lens Type in EXIF of Canon 50D Images

digographer

Member
Messages
35
Reaction score
0
Location
US
Hello,

I am using exiftool to decode lens data from the exif of images. This is what I can see in the JPEG of an image taken with a Canon Lens (JPEG mode):

$ exiftool IMG_6000.JPG |grep Lens
Lens Type : Canon EF-S 17-55mm f/2.8 IS USM
Lens Model : EF-S17-55mm f/2.8 IS USM
Lens Drive No AF : Focus search on
Lens AF Stop Button : AF stop
Lens : 17.0 - 55.0 mm
Lens ID : Canon EF-S 17-55mm f/2.8 IS USM

Lens : 17.0 - 55.0 mm (35 mm equivalent: 26.9 - 87.2 mm)

(note: there's no blank lines in the above machine-generated output, it's an artifact of the forum's formatting logic).

As one can see, the lens description can be found in several places of the exif. The description is very comprehensive, at least for my lens.

The description is very inaccurate when the image is taken by a non-Canon lens:

$ exiftool IMG_6174.JPG |grep Lens
Lens Type : Canon EF 17-35mm f/2.8L or Sigma Lens
Lens Model : 50mm
Lens Drive No AF : Focus search on
Lens AF Stop Button : AF stop
Lens : 50.0 mm

Lens ID : Sigma 18-200mm f/3.5-6.3 DC OS + 2.8x or Sigma 18-50mm f/2.8 Macro + 2.8x
Lens : 50.0 mm (35 mm equivalent: 79.2 mm)

Indeed, that image has been taken with Sigma 50mm f/1.4. The lens description in the report is inconsistent and in both cases does not match the reality.

Question: is this error related to the way the camera stores the data in the exif, or to the way exiftool interprets the data? In other words, whose bug am I stepping on here?

Thanks in advance for your insight!
 
...
The description is very inaccurate when the image is taken by a non-Canon lens:

$ exiftool IMG_6174.JPG |grep Lens
Lens Type : Canon EF 17-35mm f/2.8L or Sigma Lens
Lens Model : 50mm
Lens Drive No AF : Focus search on
Lens AF Stop Button : AF stop
Lens : 50.0 mm

Lens ID : Sigma 18-200mm f/3.5-6.3 DC OS + 2.8x or Sigma 18-50mm f/2.8 Macro + 2.8x
Lens : 50.0 mm (35 mm equivalent: 79.2 mm)

Indeed, that image has been taken with Sigma 50mm f/1.4. The lens description in the report is inconsistent and in both cases does not match the reality.

Question: is this error related to the way the camera stores the data in the exif, or to the way exiftool interprets the data? In other words, whose bug am I stepping on here?
1. Camera expect that Canon lens is attached (obviously)
2. Every Canon lens has unique ID number (which is sent toward camera)

Now, what Sigma (and other 3rd party lenses) does is, it sends fake ID number toward camera. To be sure, that lens will be recognized by camera, Sigma send one of "known" Canon ID numbers.

See here: http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#LensType

-and go downto ID number 169. As you can see, there are (beside original Canon lens EF 17-35) at least five another lenses which send ID number 169 -one of them being your 50mm lens.

Of course, lens ID is only one of data which describes lens -inside Makernote metadata, there are others, i.e.: Short and Long focal length, min and max aperture, etc... so, from reading all of them, one can gues what lens was actually used.

Whose bug? Well, it's 3rd party lenses -they should pick their own ID numbers. ExifTool does fine, though.

Bogdan
 
Bogdan,

Thank you for a detailed and clear explanation.

What is stored in lens type field of the EXIF: is it the "decimal id" (i.e. 169.4 for my lens) or the string description of the lens? If it is the former, then exiftool might be able to have its own library of lenses and use it to convert.

Thanks again!
 
Hi,

There are two tags (in Makernote) in 50D which describe lens:

LensType (note: 20D, 350D didn't write into this tag)

-thisi is where ID number is written. For this tag ExifTool has it's own built-in database of lenses, so "real name" can be shown instead of number.

LensModel (note: older cameras didn't have this tag)

-here, real name (description) of lens is saved. Here, according to lens ID, camera writes the name from its own buil-in database (according ID comming from lens).

ID value 169.4 doesn't exist -it's just in ExifTool documentation (meaning: many lenses report this value). That is: Sigma sends the same 169 number as Canon lens does.

When ExifTool sees 169, it can be any of those five lenses mentioned. As mentioned, one can analyze other lens values, trying to determine actual lens (which probably exceeds ExifTool's purpose).

Greetings,
Bogdan
 
Bogdan is very accurate in his analysis.

But I am surprised that exiftool can't identify this lens based on the stored focal length and aperture information.

If possible, could you send me a sample? (phil at owl.phy.queensu.ca)

Thanks.
  • Phil
 
FWIW:

On shots where an older Tamron zoom was mounted Zoom Browser EX and Canon DPPV identified the correct zoom range, focal length used, and iris setting, and that manual focus was set. I guess you would need more if you need to know the specific lens mounted for evaluation or record keeping purposes. (The Tamron 28-200 came from my film use of the Elan II and this is the only lens from that era that was compatible with my 50D. The Sigmas I had would not work at all on the 50D and were occasionally flaky on my Elan II even with firmware upgrades. The Tamron was purchased in the fall of 2001.)
--
Ron Ginsberg
Minneapolis, MN
Land of 10,000 Puddles
 
Bogdan,

This is a very detailed answer, indeed. Thanks!

Your explanation ignites a follow-up question:

As far as I can remember, my 50D is capable of removal of the lens's vignetting. It would do so by (I would guess) re-normalizing the brightness of an image according to the vignetting data that the camera stores for the particular lens that was used to take this image. In other words, the camera would bump up the brightness in the peripheral part of an image, using an internally stored lens-dependent brightness correction table.

It follows from your explanation, that my camera can confuse my Sigma lens with a very different Canon lens. This confusion might break the camera's vignetting adjustment procedure: indeed, the camera would use vignetting data pertinent to a Canon lens when running the procedure on an image taken with my Sigma lens, and these two vignetting data sets for the two lenses might differ substantially.

Is this a known effect? Any recommendations?

I don't want to turn the vignetting adjustment procedure off, because I would presume it make sense when I shoot with my Canon lens.

Thanks again!
 
Hi,

From what I know, you're correct.

I don't know about your Sigma 50mm, but I assume it's designed for full-frame cameras (not for APS-C only) -same as is the case for EF17-35mm. You are aware, that FF lenses used on APS-C cameras have almost no vignetting. That is, if I were you, I would turn auto-vignetting adjustment in camera off (for these two lenses).

Just try with and without -you'll probably see, that differece is very, very small.

Bogdan
 
From what I know, you're correct.

I don't know about your Sigma 50mm, but I assume it's designed for full-frame cameras (not for APS-C only) -same as is the case for EF17-35mm.
...
My other lens is a EFS one.

I'll consider turning auto-vignetting off, at least when I'm using my Sigma 50 f/1.4. This inconvenience is somewhat unfortunate.

Thanks!
 
...
My other lens is a EFS one.
I see.. with my advice I've tried to make simple for you.

Now, what I really would do is, I would take photos in raw (so, your in-camera settings doesn't matter) and then:

For all photos where Sigma 50mm f/1.4 is used, I would modify LensType tag inside image file. That is, instead of existing:
169 -which says Canon EF17-35 f/2.8 was used
.. I would set value to:
198 -which says Canon EF50mm f/1.4 was used.
  • I assume vignetting amount of both f/1.4 lenses is similar, thus..
  • ..on APS-C camera vignetting amount is "equal" for both lenses.
Now, Canon software would believe Canon EF50mm f/1.4 lens was used and will allow you corrections according to that lens.

Of course, you can also modify LensModel tag, where you write "Sigma whatever" -so you know what lens is actually being used.

All above might sound complicated, but is very simple/easy/fast in reality. I've done similar with raw files comming from my previous EOS 350D camera.
If you're interested and wish to know more, see:
http://u88.n24.queensu.ca/~bogdan/
-scroll downto middle of page and look after menu Makernotes:Canon (screenshot).

Bogdan
 
Bogdan,

Thanks again for the suggestions. Image post-processing is not within my current interests. I'm sure I'll start doing it at some later point, and will try your approach.

I've looked at your web page, and found it very informative too.
 
Hi there,
first post here, so please bear with me.

I'm trying to enable CA feature on DPP for some CR2 shots taken with a 30D.

I'm trying to edit LensType tag with exiftool by trying to set it at 180 (the value of the Canon 35/1.4 lens which I hope is the most similar to my Zeiss 35/1.4). Exiftool reports the value initially as Unknown (-1).

I launched several times the command exiftool -LensType=180 but keep getting 0 files updated and the value unchanged, so that CA control feature is disabled.

Any hint?

TIA,

Stefano
 
Solved by searching elsewhere. The correct instruction resulted being the following: exiftool -n -canon:lenstype=180.

Ciao,

Stefano
 

Keyboard shortcuts

Back
Top