ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:23 AM

Title: Customising Minolta lens names.
Post by: Archive on May 12, 2010, 08:54:23 AM
[Originally posted by elo on 2008-08-10 03:16:46-07]

Hi Guys,

At the moment, my Tamron lens prints out as "Lens ID: Tamron Lens (various models)"

I looked at Minolta.pm from the distribution, and the Tamron lens I want is commented out:

Code:
# %minoltaLensIDs{255} = 'Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical'

I looked at the example .ExifTool_config and did some google searches but its not clear how to override these names in the config file.

I don't want to edit Minolta.pm because that gets overwritten on each upgrade, and it doesn't seem like that is the correct solution.

Any help appreciated

Elias
Title: Re: Customising Minolta lens names.
Post by: Archive on May 12, 2010, 08:54:24 AM
[Originally posted by exiftool on 2008-08-15 11:54:27-07]

Hi Elias,

I am working on enhanced lens recognition code hopefully
for the next exiftool release.  With any luck, this will allow
your Tamron lens to be uniquely identified.

But to answer your question, with the current exiftool you could
create a user-defined Composite tag to replace the names
you want:

Code:
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyLens => {
            Description => 'Lens',
            Desire => {
                0 => 'LensID',
                1 => 'LensType',
                2 => 'Lens',
            },
            ValueConv => q{
                foreach (@prt) {
                    next if not defined $_ or /Unknown/;
                    return 'Tamron SP AF 17-50mm f/2.8 XR Di II LD Aspherical' if /Tamron Lens \(various models\)/;
                    return $_;
                }
                return undef;
            },
        },
    },
);

- Phil