Extracting Canon LensType

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

Previous topic - Next topic

Archive

[Originally posted by slowboat on 2008-06-30 04:37:06-07]

I am having trouble trying to figure out how to select a specific Canon:LensType tag.  If I use the "-a" option along with "-Canon:LensType"  there a three tags returned with the lens type information. The data in the Tag IDs 0x0016 & 0x0112 is what I am after and not the data in Tag ID 0x0095. However, if I omit the "-a" switch only Tag ID 0x0095 is extracted.

Tag IDs 0x0016 & 0x0112 contain integer values and use a lookup to obtain the string value but Tag ID 0x0095 is a string value that is not as complete or formatted well.  

How can a specfically extract the value for Canon:LensType Tag ID 0x0016 or 0x0112?

Archive

[Originally posted by bogdan on 2008-06-30 14:16:15-07]

Hi,

I had very similar question once and the answer I've got from Phil was:

"...and I assume you want to specify a tag by number to distingush between the 2 lenstype tags? The only way to do this is to create a user-defined tag to override the exiftool definition. You can't specify a tag by number." (see: http://www.cpanforum.com/threads/7987" target="_blank">http://www.cpanforum.com/threads/7987 )

Greetings,

Bogdan

Archive

[Originally posted by slowboat on 2008-06-30 20:00:02-07]

So, if I understand this correctly I will need to create a user-defineg tag that behaves exactly like one of the existing LensType tags but use a unique name so that I am able to reference that tag id. For instane I would basically copy what is defined for Tag ID 0x0016 and change the "Name" to "MyLens".

Archive

[Originally posted by exiftool on 2008-07-01 10:46:05-07]

Exactly. But I'll think about renaming the
text version of this tag in the next release
since this problem has come up more
than once. - Phil

Archive

[Originally posted by slowboat on 2008-07-01 14:18:15-07]

Thank you for the confirmation Phil and thanks to Bogdan for the idea/thread pointer.  I got this working last night and overrode the 0x0016 LensType value as a user defined tag.  Although I must admit my PERL is a bit rusty and could not figure out how to reference the existing canonLensType hash for PrintConv in my user defined tag, so I just set PrintConv equal to an inline hash ie. PrintConv =&rt; { num, lens string, .....}

Archive

[Originally posted by exiftool on 2008-07-02 11:18:00-07]

Ah yes.  You can't reference the existing lens lookup because it is a
private variable of Canon.pm.