Different LensType-tags

Started by Archive, May 12, 2010, 08:54:07 AM

Previous topic - Next topic

Archive

[Originally posted by cocker68 on 2007-08-24 21:24:55-07]

Hi,

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

Code:
$ 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:

Code:
$ 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

Archive

[Originally posted by exiftool on 2007-08-25 01:20:50-07]

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

Archive

[Originally posted by cocker68 on 2007-08-26 07:30:52-07]

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

Archive

[Originally posted by exiftool on 2007-08-26 11:47:40-07]

Code:
> 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:

Code:
%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

Archive

[Originally posted by cocker68 on 2007-08-30 18:15:31-07]

Thank You, Phil, that helped perfectly.

- Cocker :wq