Copy IPTC data to XMP for directory ans all subdirectories

Started by mülli, September 23, 2013, 02:47:42 PM

Previous topic - Next topic

Phil Harvey

I was thinking about this again and realized I had things wrong.  The summary goes to stdout and the errors go to stderr.  On the Mac, this is what happens with errors:

> exiftool t1 -artist=me > t.out
Error: Writing of this type of file is not supported - t1

> cat t.out
    0 image files updated
    1 files weren't updated due to errors


I'm pretty sure this will be the same for Windows (but you would use the "type" command instead of "cat").

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

mülli

Thank you very much for your help Phil!

Best regards,
Christoph

mülli

Quote from: Phil Harvey on September 25, 2013, 01:27:36 PM
The error that stopped the writing is a duplicate XMP tag.  ExifTool will delete one of the duplicate values when this is rewritten, hence the minor error.
- Phil

Phil, allow me one last question: Is this a "false behaviour" of Gimp or is it just the specific way it deals with metadata like other programs which handle it all a different way? I ask this because if it's a "real" error I'd add it to the developer's error log.

Best regards,
Christoph

Phil Harvey

Hi Christoph,

I consider it a real error.  There shouldn't be any duplicate tags in the XMP.

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

mülli

Hello Phil,

you're right, it seems to be a bug of Gimp!
I've done some tests with other programs and contacted the developers of gimp as well as the developer of XnView.
http://newsgroup.xnview.com/viewtopic.php?f=36&t=28720
https://bugzilla.gnome.org/show_bug.cgi?id=709219
XnView uses the Adobe XMP Toolkit, which is not able to edit xmp data on images where gimp rewrote the xmp ans produced double fields. The same problem with iTag (http://www.itagsoftware.com/):
On all images I edited with gimp I get the message: "Exiv2-Library cant't read the image.
In the past years I edited a lot of images with Gimp, is there a way to find those with duplicate XMP and repair is? My images with IPTC-Desciptions are "automatically" repaired with the commandline you gave me, but it would be great if I could rewrite the XMP of all other images where gimp produced the error, too.

Thank you for your help and patience,
Christoph

Phil Harvey

Hi Christoph,

I can't think of any easy way to find all the affected files.  You could try writing them all then search for "Duplicate XMP property" in the ExifTool output, but this isn't a very elegant solution:

exiftool -xmp:title=x -o dummy/ -r DIR

Then delete the dummy output directory when you are done.

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