How to clean up EXIF error?

Started by Joanna Carter, March 08, 2021, 12:43:16 AM

Previous topic - Next topic

Joanna Carter

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

Joanna Carter

#1
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                 : inches2
[MakerNotes]    Camera Temperature              : 26 C2
[MakerNotes]    Chromatic Aberration Corr       : Off2
[MakerNotes]    Color Temperature               : 52002
[MakerNotes]    Focal Length                    : 135 mm2
[MakerNotes]    Focus Distance Lower            : 26.34 m2
[MakerNotes]    Focus Distance Upper            : 47.81 m2
[MakerNotes]    Lens Type                       : Canon EF-S 18-200mm f/3.5-5.6 IS2
[MakerNotes]    Max Focal Length                : 200 mm2
[MakerNotes]    Min Focal Length                : 18 mm2
[MakerNotes]    Picture Style                   : Faithful2
[MakerNotes]    White Balance                   : Daylight2
[XMP]           Artist                          : JCh.7
[XMP]           Compression                     : Compression JPEG7
[XMP]           Copyright                       : JCh.. (Photographe) - [Aucun] (Éditeur)7
[XMP]           Date Time                       : 2019:06:27 08:52:224
[XMP]           Date Time                       : 2020:06:17 22:41:212
[XMP]           Make                            : Canon7
[XMP]           Model                           : Canon EOS 600D7
[XMP]           Orientation                     : En haut à gauche7
[XMP]           Primary Chromaticities          : 0,64, 0,33, 0,21, 0,71, 0,15, 0,067
[XMP]           Rating                          : 08
[XMP]           Resolution Unit                 : pouces14
[XMP]           White Point                     : 0,313, 0,3297
[XMP]           X Resolution                    : 7214
[XMP]           Y Cb Cr Coefficients            : 0,299, 0,587, 0,1147
[XMP]           Y Cb Cr Positioning             : Co-sited7
[XMP]           Y Resolution                    : 7214

So, now I know which tags are duplicated, how can I remove the dupes?

Phil Harvey

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 which describes rebuilding corrupted EXIF.

- 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 ($).

Joanna Carter

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.