Some LENS fail to execute "-XMP:Lens<LensID"

Started by cdmikelis, November 01, 2021, 03:51:35 PM

Previous topic - Next topic

cdmikelis

Hello.

My 1st attempt to get help. I have strange issue and can't debug it myself. [EDITED]

TL;DR: Command exiftool "-XMP:Lens<LensID" *.DNG does not work on ALL lenses I have.

Long version:
My Pentax cameras writes lens info under "Lens ID" and "Lens Type" tags, which is not read in CaptureOne - everything else is. So I figured out that if import files into Adobe Lightroom 1st, it will read lens names and write them in it's own tag "XMP:Lens"; than CaptureOne read it. So I figured out above command to do that without AdobeLr which bloat files. It works like a CHARM for most lenses, but FEW lenses return "unknown" name. This puzzles me ... It is certain lenses only. 

Strep-By-Step:
If I drag file over exiftool(-s -G -w txt).exe I see lens data under 2 tags, like this:
[MakerNotes] LensType : HD PENTAX-DA 15mm F4 ED AL Limited
[Composite] LensID : HD PENTAX-DA 15mm F4 ED AL Limited

If I drag file over exiftool(-a -G1 -s -w txt).exe, than I see like this:
[Pentax] LensType : HD PENTAX-DA 15mm F4 ED AL Limited
[Pentax] LensType : HD PENTAX-DA 15mm F4 ED AL Limited
[Composite] LensID : HD PENTAX-DA 15mm F4 ED AL Limited

So I used "LensID" to copy data. For each lens name below this is get in XMP:Lens tag:

-> HD PENTAX-DA 15mm F4 ED AL Limited                            -> Unknown (7 204)
-> Sigma 18-35mm F1.8 DC HSM                                         -> Unknown (8 31)
-> smc PENTAX-DA 35mm F2.4 AL                                        -> *
-> smc PENTAX-DA 40mm F2.8 Limited                                 -> *
-> smc PENTAX-DA 50mm F1.8                                             -> Unknown (7 212)
-> smc PENTAX-DA L 18-55mm F3.5-5.6                               -> *
-> smc PENTAX-DA L 50-200mm F4-5.6 ED                           -> *
-> smc PENTAX-FA 35-80mm F4-5.                                       -> *
-> Tamron SP AF 70-200mm F2.8 Di LD [IF] Macro (A001)      -> *

* proper name of lens

As one can see, for three lenses ExifTool does not copy actual value of lens, but "unknown" name. But still all those lenses have distinct number, so I can later run several more command to manually enter those names in the XMP:lens tag:
exiftool -XMP:Lens="HD PENTAX-DA 15mm F4 ED AL Limited"  -if "$Lens =~ /7 204/i" *.DNG
exiftool -XMP:Lens="Sigma 18-35mm F1.8 DC HSM"  -if "$Lens =~ /8 31/i" *.DNG
exiftool -XMP:Lens="smc PENTAX-DA 50mm F1.8"  -if "$Lens =~ /7 212/i" *.DNG

If I use exiftool "-Directory<LensType" *.DNG, command will copy all lenses under proper lens name folders, but those 3 lenses will get "Unknown (7 204)", "Unknown (8 31)" and "Unknown (7 212)" folders.

But very strange, if I use exiftool(-LensID -LensType -w txt).exe on original files, generated TXT file will show ALL lens names PROPERLY?!

So with last command ExifTool read proper lens names, but if I try to copy those names to another TAG, names of few lenses are not recognised.

My current work around works for me, but it is very cumbersome. I would rather have solution for one single command.
Thank you all for any help.

StarGeek

Your output seems incomplete, as there's no data or even a tag name on the Pentax line.

Can you share a file that has this problem?  Is there any error output?
* 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).

cdmikelis

#2
Please read my post again. Accidentally I posted only part of it, now it is complete.
How can I send files. I probably should send  at least two files - one where command works and one where it is not.

The issues is camera irrelevant, and always happen with particular lens. 
No errors since it works. It makes new "XMP:Lens" tag. Just some names are "unknown (number)" instead of actual lens names.

Phil Harvey

What is the "number" in the "Unknown (number)" LensID, and what is the exact lens model.  It sounds like ExifTool doesn't support this lens yet, but I can add it if you answer these questions.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cdmikelis

Quote from: Phil Harvey on November 01, 2021, 08:04:49 PM
What is the "number" in the "Unknown (number)" LensID, and what is the exact lens model.  It sounds like ExifTool doesn't support this lens yet, but I can add it if you answer these questions.

- Phil

The exact lens "numbers" -> "names" are:
Unknown (7 204) -> HD PENTAX-DA 15mm F4 ED AL Limited
Unknown (8 31)   -> Sigma 18-35mm F1.8 DC HSM
Unknown (7 212)  -> smc PENTAX-DA 50mm F1.8


The "Unknown (number)" is what EXIFTOOL returns from above command
The "names" are what ExifTool finds under LensID tag.

****
I did not know that each lens has to be manually added, since I thought that if "exiftool(-s -G -w txt).exe" shows the name, I can copy it. And with "XMP:Lens<LensID" is just copy one already existing data to another TAG. I was might unjust toward CaptureOne and they also need to manually enter each lens to recognize it. I thought they just need to read "LensID" tag, not just "Lens" tag and story over. I learn every day.

Thank you for your help.

Phil Harvey

None of those LensID numbers are unknown in the current version of ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cdmikelis

Quote from: Phil Harvey on November 02, 2021, 09:29:53 PM
None of those LensID numbers are unknown in the current version of ExifTool.

- Phil

Exactly my thought Phill: Lens names are shown if metadata is "printed" into TXT files. For truly unknown lenses there would never be a full name of lens mentioned; also lenses are pretty old / well known.

So why than a exiftool "-XMP:Lens<LensID" *.DNG command works on most lenses but those three?
What could be wrong?
Can I send files somewhere to check them? (JPEG with strongest compression, to be small, but still original from camera)?

Phil Harvey

Quote from: cdmikelis on November 07, 2021, 02:51:32 PM
So why than a exiftool "-XMP:Lens<LensID" *.DNG command works on most lenses but those three?
What could be wrong?

I would have to see a sample to determine this.

QuoteCan I send files somewhere to check them? (JPEG with strongest compression, to be small, but still original from camera)?

It is best if you could upload them to a file sharing server like dropbox.com, or you can email them to me philharvey66 at gmail.com

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cdmikelis

Hello.

I send link to my files in email today. I write notice here, since email again might not come through. The message title is "Link to trouble files - topic 12999.0" - latest version Version 12.39 from 13. January 2022 still produce same issue.

Many thanks to see what the problem might be. I included "readme" in the link with description of a problem, commands I use and files from all of my lens, to compare. Files as smallest possible JPEGs. They reproduce same error as if they would be DNG's.     

Phil Harvey

I send this email on Dec 6 in response to your first email from Nov 26:

QuoteHi Mihael,

I'm back from my vacation now, and have time to look into this.

You have given me way too much information.  I don't have time to look at all the files you sent.

Can you point me to a single file that isn't doing what you expect, and the exact command that you used?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

cdmikelis

OK, it seem I didn't get the message. I'll try to reduce the info (from the original post):

When I use exiftool "-XMP:Lens<LensID" *.DNG
with lens Sigma 18-35mm F1.8 DC HSM
The copied name is "Unknown (8 31)" instead of actual lens name. The behaviour is consistent for that lens. 

I put the offending image file in the attachment. Original link from my email to files is still valid if for some reason the comparison with other working files would be needed. Regardless of camera used and file type, the three lenses return "unknown (xxx)".

Bets regards.



StarGeek

I can't replicate the problem here using that file with version 12.39
C:\Programs\My_Stuff>exiftool -P -overwrite_original "-XMP:Lens<LensID" Y:\!temp\aaaa\_K3_3494.JPG
    1 image files updated

C:\Programs\My_Stuff>exiftool -G1 -a -s -Lens Y:\!temp\aaaa\_K3_3494.JPG
[XMP-aux]       Lens                            : Sigma 18-35mm F1.8 DC HSM
* 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).

cdmikelis

Hello.

The problem was MY computer, due to unknowingly usage of old version. When I updated ALL my Exiftool copies on PC, the problem is gone.

Various opensource programs uses (and installs) EXIFTOOL and some are very old (not updated anymore) so my system had bunch of EXIFTOOL littered around. My issues began when I added EXIFTOOL into Windows PATH environment variable, so I was not needed to copy EXIFTOOL.EXE into the folder with images each time I used CMD. No matter which recent version of Exiftool I had in my "exiftool" folder, from CMD pulled some other version in the system. I was puzzled why opening image with "exiftool(-s -G -w txt).exe" (by dragging image over the exe) my lenses are all recognised (in created TXT files), but when I used any other command (from CMD) the lenses were Unknown.

The issue was when I used "exiftool(-LensID -LensType -Lens -w txt).exe" or similar code that can be used directly with EXE file, the processing was done by that exact version. But when used with .BAT file or via CMD, system pulled some old version. I used "Everything" search tool to spot every copy of EXIFTOOL on my system (and there were around 20 of them) and overwrite all with latest version. That solved my problem.

I did not open each copy to check version, but latest version is 8.668 KB, where some old versions were at some 2600 KB size, so I reckon very old.:) My Windows 7 was installed in 2015, but my data and opensource tools can go back 20 years.

I wrote this here, just to give anyone an idea what else it could be in his problem, before giving up hope. :)

Many thanks for the assistance.
Mihael

StarGeek

On the command line, you can type
where exiftool
and Windows will show you all the paths that have a copy of exiftool in them.

And you can always use
exiftool -ver
to see the version that would be used.

Of course, that doesn't help in cases were a bat file or program includes the full path.  Everything Search is really the best, I use it daily.
* 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).

cdmikelis

Thank you "@StarGeek" for the further very useful knowledge about knowing which version and path is currently taking over in use from CMD.
If I had known that before, I could point which old version was used ... but anyway. Thank YOU!