News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Getting lens name from a composite lensid tag

Started by sat3ll, March 17, 2019, 12:28:47 PM

Previous topic - Next topic

sat3ll

Hi,

I'm using pyexiftool to extract the Lens Models from an array of files but when I try to fetch the "lensID" tag all I get is: '32 54 6A 6A 24 24 35 02'.
Using "exiftool <file here> -lensid" returns a human readable name.
Now, pyexiftool is a wrapper to the ExifTool executable and I can't find in the docs why would the wrapper and the "executable" return different things for the same tag.
Is there a way to map these composite "machine format" tags to human readable names using the ExifTool executable?

Code snippet I am using (python3):

with exiftool.ExifTool() as et:
        for photo in photos:
            current_lens = et.get_tag("Lensid", photo)


StarGeek

Just to make sure, you don't have the -n (printConv) option somewhere in the code?  As that result would indicate the -n option was included somewhere.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

sat3ll

Thanks for the tip!
It's not included anywhere in my code but grepping through pyexiftool's code it does include this switch! (https://github.com/smarnach/pyexiftool/blob/master/exiftool.py#L163).
It's a relatively small script so its doable to patch it out but what does the -n switch do exactly? (EDIT: Forgive me, only read half of the response)

StarGeek

I'm pretty clueless with regards to python and pyexiftool, but that seems like a really bad thing to be included automatically.  Especially if it's in play in writing tags.  You could easily write data incorrectly with that option.  For example, if you got your date data and orientation data mixed up, you could end up writing -DateTimeOriginal="Rotate 270 CW" and wouldn't get an error response.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).