XMP fields repeated

Started by jmsantos, May 11, 2022, 11:31:56 AM

Previous topic - Next topic

jmsantos

Hello.
I am immersed in the arduous task of reviewing and correcting with IMatch the mistakes made in the metadata by other software. In that review I detect that some images have some XMP fields repeated two or more times, for example the Author field (XMP::dc\creator\Creator\0) and also Copyright and Title. The screenshot is from the ExifTool Command Processor.

I can't find a way to filter the images with that problem. I've tried with filters and categories, but I can't.

Is this possible to do?

Mario

#1
These tags are repeatable (can appear multiple times), but usually ExifTool returns the values of array tags like these as Value, Value, Value (separated with a comma).
The tag exists only once in the file, but can have multiple values (multiple authors, for example).

In your case, it seems that the tag was somehow added multiple times (?). Not sure how to achieve that, even with ExifTool.

When you change the value of the tag in the Metadata panel (to one value or multiple values, separated with ;) ExifTool should remove the duplicate tag entries during write-back.

What does IMatch show in the Metadata Panel for this file?

As for finding files with this problem,  I don't see a simple solution.
I would probably write a Python script which extracts the Metadata with ExifTool and then searches for dupes.
Alternatively, extracting the data and grepping it would also be a potentially viable solution. I'm sure there are tons of examples for using ExifTool and grep on the Internet.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jmsantos

Quote from: Mario on May 11, 2022, 01:29:47 PM
What does IMatch show in the Metadata Panel for this file?

The Metadata Panel displays the repeated values in a single tag, as seen on the screenshot. Sure enough, the problem goes away when Write-back the file, even without any changes.

I see that it is not easy to filter the files with that problem. I have no idea about writing scripts or what is "grep".

Thanks, Mario.

Mario

This is indeed tricky.
If I add 3 creator tags to a file, ExifTool lists them as Tom,Harry,Sally.
But for the database import, the tag is delivered 3 times, and thus is stored in 3 "rows" in the database.
Filters don't really deal with repeatable tags (they don't combine them but search each value separately), which does not help in your case.

IMatch displays tags with multiple values in the Metadata Panel using a semicolon (Windows list separator): Tom; Harry; Sally.
This is also what is returned by the corresponding variable {File.MD.creator}.

This could be used for a data-driven category. If you see child-categories containing a ; you know that the files in this category have more than one value for the tag. Maybe this helps.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jmsantos

Oh yeah!
I had created a data-driven category based on the Creator tag, but in this case the power of variables is greater. I have found images with up to 6 repetitions of the same author.

Thank you very much!

Mario

Good that you have IMatch. Don't try this with lesser DAMs  ;D
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook