ExifTool Forum

ExifTool => Newbies => Topic started by: Guy Tare on August 07, 2016, 01:06:29 PM

Title: Copying from one tag to another
Post by: Guy Tare on August 07, 2016, 01:06:29 PM
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
Title: Re: Copying from one tag to another
Post by: StarGeek on August 07, 2016, 01:31:59 PM
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
Title: Re: Copying from one tag to another
Post by: Guy Tare on August 07, 2016, 02:28:40 PM
Sorry, I was not using the latest version !
Title: Re: Copying from one tag to another
Post by: StarGeek on August 07, 2016, 02:37:52 PM
The error is telling you that test.jpg doesn't have a RegionName tag.  What is the result of exiftool -xmp:RegionName test.jpg?
Title: Re: Copying from one tag to another
Post by: Guy Tare on August 07, 2016, 03:46:54 PM
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.


Title: Re: Copying from one tag to another
Post by: StarGeek on August 07, 2016, 04:09:52 PM
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

Title: Re: Copying from one tag to another
Post by: Phil Harvey on August 07, 2016, 04:55:42 PM
We have a couple of issues here I think: Common mistake 5a (https://exiftool.org/mistakes.html#M5), and possibly FAQ 3 (https://exiftool.org/faq.html#Q3).  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
Title: Re: Copying from one tag to another
Post by: Guy Tare on August 08, 2016, 02:10:14 AM
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.
Title: Re: Copying from one tag to another
Post by: Phil Harvey on August 08, 2016, 07:36:23 AM
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