Author Topic: Copying from one tag to another  (Read 3338 times)

Guy Tare

  • Newbie
  • *
  • Posts: 4
Copying from one tag to another
« 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

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3785
Re: Copying from one tag to another
« Reply #1 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
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Guy Tare

  • Newbie
  • *
  • Posts: 4
Re: Copying from one tag to another
« Reply #2 on: August 07, 2016, 02:28:40 PM »
Sorry, I was not using the latest version !
« Last Edit: August 07, 2016, 02:41:09 PM by Guy Tare »

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3785
Re: Copying from one tag to another
« Reply #3 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?
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Guy Tare

  • Newbie
  • *
  • Posts: 4
Re: Copying from one tag to another
« Reply #4 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.



StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3785
Re: Copying from one tag to another
« Reply #5 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

Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: Copying from one tag to another
« Reply #6 on: August 07, 2016, 04:55:42 PM »
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, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Guy Tare

  • Newbie
  • *
  • Posts: 4
Re: Copying from one tag to another
« Reply #7 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.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16687
    • ExifTool Home Page
Re: Copying from one tag to another
« Reply #8 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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).