Thread

Posted on Mon Jun 30 07:37:06 2008 by slowboat
Extracting Canon LensType
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?
Direct Responses: 8201 | Write a response
Posted on Mon Jun 30 17:16:15 2008 by bogdan in response to 8198
Re: Extracting Canon LensType
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 )

Greetings,
Bogdan
Direct Responses: 8205 | Write a response
Posted on Mon Jun 30 23:00:02 2008 by slowboat in response to 8201
Re: Extracting Canon LensType
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".
Direct Responses: 8207 | Write a response
Posted on Tue Jul 1 13:46:05 2008 by exiftool in response to 8205
Re: Extracting Canon LensType
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
Direct Responses: 8209 | Write a response
Posted on Tue Jul 1 17:18:15 2008 by slowboat in response to 8207
Re: Extracting Canon LensType
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, .....}
Direct Responses: 8213 | Write a response
Posted on Wed Jul 2 14:18:00 2008 by exiftool in response to 8209
Re: Extracting Canon LensType
Ah yes. You can't reference the existing lens lookup because it is a private variable of Canon.pm.
Write a response