Author Topic: Getting lens name from a composite lensid tag  (Read 244 times)

sat3ll

  • Newbie
  • *
  • Posts: 4
Getting lens name from a composite lensid tag
« on: March 17, 2019, 12:28:47 PM »
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):
Code: [Select]
with exiftool.ExifTool() as et:
        for photo in photos:
            current_lens = et.get_tag("Lensid", photo)

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2514
Re: Getting lens name from a composite lensid tag
« Reply #1 on: March 17, 2019, 12:49:39 PM »
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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

sat3ll

  • Newbie
  • *
  • Posts: 4
Re: Getting lens name from a composite lensid tag
« Reply #2 on: March 17, 2019, 02:12:56 PM »
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

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2514
Re: Getting lens name from a composite lensid tag
« Reply #3 on: March 17, 2019, 02:35:34 PM »
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.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.