I'm a big fan of TagThatPhoto. I just processed over 40,000 photos through the app.
I noticed that a percentage of the photos have an undefined tag embedded in the XMP section.
They are investigating the issue.
Here's an example of a problem file.
TTP Unnamed.jpg
Although exiftool can display the tag, it won't delete it.
D:\windata\exif>exiftool -xmp:Unnamed 2024-0004.jpg
Unnamed :
D:\windata\exif>exiftool -xmp:Unnamed= -m 2024-0004.jpg
Warning: Tag 'xmp:Unnamed' is not defined
Nothing to do.
TagsFromFile will resolve the issue, but not conditionally for some reason.
I only want it to modify the files where the issue is found.
The following commend will run TagsFromFile on every file, not just the offending ones.
D:\windata\exif>exiftool -if "defined $xmp:Unnamed" -m -tagsfromfile @ -all:all 2024-0004.jpg
1 image files updated
D:\windata\exif>exiftool -if "defined $xmp:Unnamed" -m -tagsfromfile @ -all:all 2024-0004.jpg
1 image files updated
In the first instance, the offending tag was successfully removed.
The second instance of the command should fail the if condition, but it doesn't.
Any ideas?
You would need to create a user-defined tag for ExifTool to be able to delete XMP:Unnamed.
Your -if condition won't work if you are using PowerShell (read my signature).
- Phil
Thanks Phil. Straight DOS command box, no Powershell.
Ah, right. The problem is that the tag will always be defined if you use the -m option.
- Phil
That was it. And can you point out the problem with this simple config file for the unnamed tag?
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::Main' => {
Unnamed => { Writable => 'string',
WriteGroup => 'XMP',
},
},
);
1; #end
You don't add tags to the XMP::Main lookup, this is for namespaces only. See the XMP-xxx tags in the sample config file (https://www.exiftool.org/config.html) for an example of how to define these. You'll need to look at the raw XMP to get the namespace prefix and URI for the definition.
- Phil
Thanks.
Hey Phil,
I tried to work through this but have no Perl experience.
I could use some help.
Here's a link to a file.
Sample file with unnamed tag (http://vernbeau.quickconnect.to/mo/sharing/ExlOq9aEk)
I did dump the metadata from the file.
Here's the condensed xml.
It seems like part of the issue is that this tag is not in a sub-group?
It's directly accessed as xmp:unnamed.
2011-0143-xml.jpg
Oh. Yes. That is a problem. I don't think is is valid RDF/XML. ExifTool won't write a tag with no namespace like this. The best you could do with ExifTool is to remove all non-standard tags:
exiftool -xmp= -tagsfromfile @ -xmp:all FILE
- Phil
That's what I assumed at this point.
Thanks as always for the feedback.