filter out tags of same name, different capitalization

Started by graemeNPS, August 24, 2016, 12:45:10 PM

Previous topic - Next topic

graemeNPS

I am getting these group:tag value returns from a file
XMP:Isbn 0
XMP:ISBN 0

is there any flag or setting to prevent getting duplicates case insensitive?

StarGeek

That's interesting.  Do you have a sample file you can post?
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

graemeNPS

zip file has a sample jpg, extracted txt, command line, and some notes.

I have no idea how the file was originally generated to end up with two ISBN tags.

StarGeek

#3
The file has two separate ISBN tags.  The one with lower case letters is in the XMP-xmp group and the other is in XMP-prism group.  They can be separately printed with XMP-xmp:ISBN and XMP-prism:ISBN.  But, they shouldn't both show up in your output without the -a option, which isn't in your command line.

It's interesting.  Get all output, they both show up.  Ask for just -isbn, only one will show up.  Use a wildcard (-isbn*) and they both show up. I'm not sure why.  This doesn't happen with other tags in this file which are duplicated, such as DateTimeOriginal, which shows up both in XMP and EXIF.  I think Phil might want to take a look at this.

For a command line solution, you can pick one of the ISBN tags that you don't want to show up and remove it by using two hyphens followed by the name of the tag you want to remove.  The lowercase one appears to be non-standard, so you could add --XMP-xmp:ISBN to the command.  To remove the other one, it would be --XMP-prism:ISBN.

edit: minor corrections, exiftool won't copy XMP-xmp:ISBN, so I'm assuming it's non-standard.

edit 2: Looking at the raw xml in the file, the lowercase ISBN appears to be in the older XMP-xap group, which Exiftool updates internally to the XMP-xmp group.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Yes, interesting.  I'll look into this an post back here when I get a chance.

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

Phil Harvey

Too funny.  I changed one of the ISBN values to "1" for this test:

> exiftool a.jpg -isbn
ISBN                            : 1
> exiftool a.jpg -Isbn
Isbn                            : 0


So the case-insensitivity of ExifTool's interface isn't complete.  This is also the reason why -isbn* returns both tags -- they are actually two different tags as far as ExifTool is concerned since they have different case.  To solve this properly would require a re-design of how ExifTool stores the extracted tags internally.  I don't think I want to do this, so we may just have to live with this quirkiness when it comes to duplicate tags with different case.

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