I'm getting the following message in my debug log when my app reads certain (about a dozen out of several thousands) image files...
QuoteCreateMetadataFromXMPBufferInternal:603: Threw error #203 (Duplicate property or field node)
Any ideas how to find this duplicate info and remove it?
I don't see anything obvious using ExifTool from the macOS terminal.
Joanna
I suddenly had a bright idea.
I copied the output of
exiftool -a -G filename.ext to a spreadsheet and filtered and organised the columns that gave me. The number in the end column is the count of how many times the tag appears
| [EXIF] Resolution Unit : inches | 2 |
| [MakerNotes] Camera Temperature : 26 C | 2 |
| [MakerNotes] Chromatic Aberration Corr : Off | 2 |
| [MakerNotes] Color Temperature : 5200 | 2 |
| [MakerNotes] Focal Length : 135 mm | 2 |
| [MakerNotes] Focus Distance Lower : 26.34 m | 2 |
| [MakerNotes] Focus Distance Upper : 47.81 m | 2 |
| [MakerNotes] Lens Type : Canon EF-S 18-200mm f/3.5-5.6 IS | 2 |
| [MakerNotes] Max Focal Length : 200 mm | 2 |
| [MakerNotes] Min Focal Length : 18 mm | 2 |
| [MakerNotes] Picture Style : Faithful | 2 |
| [MakerNotes] White Balance : Daylight | 2 |
| [XMP] Artist : JCh. | 7 |
| [XMP] Compression : Compression JPEG | 7 |
| [XMP] Copyright : JCh.. (Photographe) - [Aucun] (Éditeur) | 7 |
| [XMP] Date Time : 2019:06:27 08:52:22 | 4 |
| [XMP] Date Time : 2020:06:17 22:41:21 | 2 |
| [XMP] Make : Canon | 7 |
| [XMP] Model : Canon EOS 600D | 7 |
| [XMP] Orientation : En haut à gauche | 7 |
| [XMP] Primary Chromaticities : 0,64, 0,33, 0,21, 0,71, 0,15, 0,06 | 7 |
| [XMP] Rating : 0 | 8 |
| [XMP] Resolution Unit : pouces | 14 |
| [XMP] White Point : 0,313, 0,329 | 7 |
| [XMP] X Resolution : 72 | 14 |
| [XMP] Y Cb Cr Coefficients : 0,299, 0,587, 0,114 | 7 |
| [XMP] Y Cb Cr Positioning : Co-sited | 7 |
| [XMP] Y Resolution : 72 | 14 |
So, now I know which tags are duplicated, how can I remove the dupes?
I'm guessing the error is only due to duplicate XMP properties. You could try this, but if there are any non-standard XMP properties they will be deleted:
exiftool -xmp:all= -tagsfromfile @ -xmp:all FILE
This is similar to FAQ 20 (https://exiftool.org/faq.html#Q20) which describes rebuilding corrupted EXIF.
- Phil
Thank you for the initial direction.
In fact, what I ended up doing was to run
exiftool -tagsfromfile filename.jpg -xmp filename.xmp
Opened the xmp file in TextEdit, copied the text to a spreadsheet which gave me a single column, sorted the table on that column, spotted and removed the duplicate rows, saved the file and then ran
exiftool -tagsfromfile filename.xmp -xmp filename.jpg
Fortunately, there were only five files in the end.
BTW, most of the errant tags were actually marked <exif:... not <xmp:... as I had expected, although the xmp:Rating tag was also duplicated.
I do wonder what software he used to get into this state - I do know he runs Linux on his 'puter.