Copying from one tag to another

Started by Guy Tare, August 07, 2016, 01:06:29 PM

Previous topic - Next topic

Guy Tare

Using ExifTool on MacOS X 10.6.8, I am trying to copy names from RegionName to Subject inside the same picture.
I thought this would work :

$ exiftool '-xmp-dc:subject<$-xmp:RegionName' test.jpg

... but it does not !

Warning: No writable tags found - test.jpg
    0 image files updated
    1 image files unchanged


I don't understand the error message, because I can write into Subject (with a little warning):

$ exiftool -xmp-dc:subject+='tftitouee' test.jpg
Warning: [minor] Fixed incorrect list type for XMP-dc:Subject - test.jpg
    1 image files updated

StarGeek

If you want to copy the RegionName tags and overwrite any previous Subject tags, use this:
exiftool '-xmp-dc:subject<xmp:RegionName' test.jpg

If you want to add the RegionName tags and keep any previous Subject tags, use this:
exiftool '-xmp-dc:subject+<xmp:RegionName' test.jpg
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Guy Tare

#2
Sorry, I was not using the latest version !

StarGeek

The error is telling you that test.jpg doesn't have a RegionName tag.  What is the result of exiftool -xmp:RegionName test.jpg?
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Guy Tare

It does exist
$ exiftool -xmp:RegionName test.jpg
Region Name                     : Claudinad


With the last version of ExifTool, it seems to work better

$ exiftool '-xmp-dc:subject<-xmp:RegionName' test.jpg
Warning: [minor] Fixed incorrect list type for XMP-dc:Subject - test.jpg
    1 image files updated


But...

$ exiftool -xmp:subject test.jpg
Subject                         : Chatou


It should be "Chatou, Claudinad" now.



StarGeek

Make sure your command is correct.  There is not a hyphen before the tag you want to copy from.  There also seems to be a problem with the XMP in your file, so add the -m option to ignore the minor error.  Finally, do you want to add the region to subject or overwrite? The example you edited out was to add the RegionName, the current example is to overwrite.

Overwrite subject with the contents of RegionName with -m to ignore minor errors
exiftool '-xmp-dc:subject<xmp:RegionName' -m test.jpg

Add RegionName to subject with -m to ignore minor errors
exiftool '-xmp-dc:subject+<xmp:RegionName' -m test.jpg

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

We have a couple of issues here I think: Common mistake 5a, and possibly FAQ 3.  Also, the incorrect List type for XMP-dc:Subject could be causing problems.  If you could post the original file we could tell for sure.

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

Guy Tare

It is working, I could add RegionName to Subject.

The problems were:
1) I was using an outdated version,
2) I did not read the Common Mistakes page,
3) I was unable to correctly copy one command line.

At least, I posted in the good place: Newbies !

Here is the file if you want to investigate the incorrect list type warning.

Phil Harvey

I'm glad you figured this out.

Thanks for the sample.  In this sample, XMP-dc:Subject is incorrectly sorted as a sequential (Seq) list, where it should be an unordered (Bag) list.  If you write the Subject with ExifTool, this will be fixed and the list type will be changed to Bag as it should be.

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