Synchronizing XMP->IPTC with xmp2iptc.args and empty XMP tags

Started by Mac2, August 29, 2013, 01:58:27 PM

Previous topic - Next topic

Mac2

I use ARG files to make complex changes to the XMP data contained in JPEG image files.
At some later point I run xmp2iptc.args to copy XMP data into the IPTC record.

exiftool -xmp:description=test 1.jpg
exiftool -@ xmp2iptc.args 1jpg


After this sequence, both the XMP:description and IPTC:caption-abstract have the same value: 'test'.

exiftool -xmp:description= 1.jpg
exiftool -@ xmp2iptc.args 1jpg


Here I set the xmp:description to empty, which effectively removes the tag from the file.
But the IPTC record retains the 'test' caption. I would have expected that the caption is empty.

I can of course add an -iptc:all= before calling xmp2iptc.args to make this work, but that would delete all IPTC data.

Am I doing something wrong, or is there a way to propagate empty XMP tags into their IPTC counterparts?


StarGeek

Quote from: Mac2 on August 29, 2013, 01:58:27 PM
I can of course add an -iptc:all= before calling xmp2iptc.args to make this work, but that would delete all IPTC data.

Unless you are adding IPTC tags that aren't covered by the xmp2iptc, I would think this would be the way to go.  It really wouldn't matter that you are removing them because they're getting refilled with the appropriate xmp tags.
"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, the xmp2iptc.args file only copies existing XMP to IPTC.  It doesn't attempt to delete any IPTC for XMP tags that are missing.  As you said, using -iptc:all= is the thing to do in this case.  ExifTool has no way to tell which IPTC tags have XMP counterparts (because, in fact, they all do in theory, since XMP is extensible), so this is the only thing ExifTool would be able to do anyway if you wanted missing tags to be deleted.

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

Mac2

Thanks, StarGeek and Phil

this is how I will do it then for IPTC.

What about EXIF in this context? I surely don't want to strip the EXIF record from the target file before I run xmp2exif.args or xmp2gps.args.

I don't think that the problem with deleted tags will be as prominent here. What springs to my mind are

Exif:ImageDescription
Exif:Software
Exif:Copyright
Exif:Artist

which will be affected if their counterparts in XMP are deleted and then xmp2exif.args is run. I think to to be on the safe side I will use this in an ARGS file:


Exif:ImageDescription=
Exif:Software=
Exif:Copyright=
Exif:Artist=

-tagsfromfile
<file name>
...
-@
xmp2exif.args
...
<file name>


This should ensure that the most often used text tags get deleted before they are re-filled from XMP (or not).


Phil Harvey

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