Thread

Posted on Sat Aug 25 00:24:55 2007 by cocker68
Different LensType-tags

Hi,

I found out, that there are two tags named LensType:

$ exiftool -G -H -Lenstype 20061105-165457.jpeg 20070608-163808.jpeg ======== 20061105-165457.jpeg [MakerNotes] 0x0016 Lens Type : Tamron AF Aspherical 28-200mm f/3.8-5.6 or + 28-75mm f/2.8 or 28-105mm f/2.8 ======== 20070608-163808.jpeg [MakerNotes] 0x0095 Lens Type : Tamron SP AF 28-75mm f/2.8 XR Di LD (IF) 2 image files read

The string in the second image was placed there by myself using exiftool.
I don't like the ambiguously interpreted LensType in the first image, but trying to overwrite the string does not change anything:

$ exiftool -overwrite_original -LensType='Tamron SP AF 28-75mm f/2.8 XR Di LD (IF)' 20061105-165457 +.jpeg 1 image files updated $ exiftool -G -H -LensType 20061105-165457.jpeg [MakerNotes] 0x0016 Lens Type : Tamron AF Aspherical 28-200mm f/3.8-5.6 or + 28-75mm f/2.8 or 28-105mm f/2.8

How can I change the string in tag 0x0095 and disable the interpretation in tag 0x0016?

- Cocker :wq

Direct Responses: 5951 | Write a response
Posted on Sat Aug 25 04:20:50 2007 by exiftool in response to 5950
Re: Different LensType-tags
It looks like you're talking about the Canon LensType (Pentax also stores the LensType tag in two different places). Older Canon cameras stored a code which is converted by ExifTool into a string (0x0016), but newer cameras store the LensType as a string and no conversion is necessary (0x0095). Some cameras even write both tags, but only the 400D fills in both values properly.

As you have found, the numerical LensType codes are problematic for 3rd party lenses since they unfortunately tend to re-use codes from other lenses.

Since no conversion is done, you can't change the value of the 0x0095 LensType. To disable the 0x0016 conversion you can either hack Canon.pm or define your own user-defined tag to override this. Look at ExifTool_config for details on how to define user defined tags.

I hope this helps.

- Phil
Direct Responses: 5953 | Write a response
Posted on Sun Aug 26 10:30:52 2007 by cocker68 in response to 5951
Re: Different LensType-tags

Canon EOS 400D - sorry I forgot to mention.

In Canon.pm I could deactivate the according six lines in Canon::CameraSettings, but with next software-update I would have to remember to redo this.

So what You mean, is to create a user-defined tag - be it MyLensType - related to the string in MakerNotes:0x0095, which then I could read and write? *mhm*

- Cocker :wq

Direct Responses: 5955 | Write a response
Posted on Sun Aug 26 14:47:40 2007 by exiftool in response to 5953
Re: Different LensType-tags
> So what You mean, is to create a user-defined tag - be it MyLensType - > related to the string in MakerNotes:0x0095, which then I could read and write?

I was thinking that you could disable the 0x0016 conversion by overriding the tag with one of your own. Something like this:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::Canon::CameraSettings' => { 0x0016 => { Name => 'MyLensType', }, }, );

But you could also define a tag for 0x0095 to do whatever conversions you wanted, if that's what you meant.

- Phil
Direct Responses: 5997 | Write a response
Posted on Thu Aug 30 21:15:31 2007 by cocker68 in response to 5955
Re: Different LensType-tags

Thank You, Phil, that helped perfectly.

- Cocker :wq

Write a response