Author Topic: Problem in copying tags  (Read 152 times)

quigley595

  • Jr. Member
  • **
  • Posts: 14
Problem in copying tags
« on: March 05, 2019, 10:46:00 PM »
Folks,
I feel ashamed in asking this, but I just can't get it to work....
 
I want to copy the XMP:Latitude  to the   EXIF:GPSLatitude,  the XMP:Longitude  to the  GPSLongitude,  and the   XMP:RelativeAltitude  to the GPSAltitude  fields, for ALL images in the directory.... 
i tried:   exiftool "-EXIF:XMP:Latitude<GPSLatitude" "-EXIF:XMP:Longitude<GPSLongitude" "-EXIF:XMP:RelativeAltitude<GPSAltitude" *.JPG
This gave me the message:  "Warning: No writable tags set from <file names>"  for all the images in the directory.

Since I couldn't get it to work, I tried to copy just for ONE image, and ONE field  by using:
  • exiftool -TagsFromFile SA_DJI_0069.JPG "-XMP:RelativeAltitude<EXIF:GPSAltitude" SA_DJI_0069.JPG
This returned the following message:
  • Warning: [minor] Error reading PreviewImage from file - SA_DJI_0069.JPG
    Warning: No writable tags set from SA_DJI_0069.JPG
    0 image files updated
    1 image files unchanged
Can anyone help this newbie with the proper coding for this, for all the images?
thanks,
Mike

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: Problem in copying tags
« Reply #1 on: March 05, 2019, 11:17:33 PM »
You're mixing tag group names.  EXIF is one tag group.  XMP is another. 

Also, just to verify, you already have XMP GPS tags set, but not the EXIF GPS tags?  Usually it's the other way around.  Or are these DJI drone tags, which is the only place where RelativeAltitude appears?  If so, are you sure you want to copy RelativeAltitude to GPSAltitude?  It seems to me that AbsoluteAltitude would be the correct tag to copy, but I don't have a sample to compare.

An additional thing to watch for is the fact that the EXIF GPS tags are in two parts.  One part (GPSLatitude/GPSLongitude) which contains the number, then the reference (GPSLatitudeRef/GPSLongitudeRef) which contains the direction (N/S and E/W).  So to have the correct GPS coordinate in the EXIF block, you have to set all four.  Since XMP tags hold the direction and number in the same tag, you can just copy the XMP to both of the EXIF tags.

Your command would look closer to this, though since I'm not quite sure which tags you're actually looking to copy, you may have to adjust
exiftool "-EXIF:GPSLatitude<XMP:GPSLatitude" "-EXIF:GPSLatitudeRef<XMP:GPSLatitude" "-EXIF:GPSLongitude<XMP:GPSLongitude" "-EXIF:GPSLongitudeRef<XMP:GPSLongitude" "-EXIF:GPSAltitude<XMP:RelativeAltitude" -ext .jpg .

I also changed *.jpg to -ext .jpg ..  This uses the -ext (extension) option to limit processing to jpg files and the dot referrers to the current directory.
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.

quigley595

  • Jr. Member
  • **
  • Posts: 14
Re: Problem in copying tags
« Reply #2 on: March 06, 2019, 02:05:34 AM »
StarGeek....
Thanks for that!  I can see now where I was mixing the tag group names.

You are right, the files are missing the XMP GPS tags, and I need to copy the EXIF GPS tags into the relevant XMP GPS tags.
The images are indeed from a DJI drone.    I am trying to investigate the altitude issue, and I thought I would throw in a test on copying other tags at the same time.

You are also correct in saying that the XMP:AbsoluteAltitude is the right value to copy into the EXIF:GPSAltitude, and not the XMP:RelativeAltitude!

Being very new to all this, it is still a bit of a challenge, but you have guided me well, and I will continue to fiddle around with it all.

thanks again !!

Mike

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2365
Re: Problem in copying tags
« Reply #3 on: March 06, 2019, 02:42:25 AM »
Don't be afraid to ask for help.  We're always willing to point you in the right direction.

Keep in mind the command from FAQ #3, as that will give you the full list of data available and where they are.  And remember you can use asterisk wildcards to specify certain tags.  For example, one I use to just show GPS tags is
exiftool -G1 -a -s -gps*
which shows all tags that start with GPS and the groups they belong to.  Though you may have to do something else for the drone tags, as they don't have gps at the beginning.
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.

quigley595

  • Jr. Member
  • **
  • Posts: 14
Re: Problem in copying tags
« Reply #4 on: March 06, 2019, 03:12:09 AM »
thanks again StarGeek.... 
but I have one last question (promise I wont bother you again!)

In my images, some XMP data is missing altogether, eg "XMP:XMP-drone-dji:Latitude"  (and Longitude, and a few others).

How can I copy these fields from an image where they exist, into my images (once there, I can then change the values)....
I have tried a few different things, including:  exiftool -TagsFromFile DJI_0001.JPG -XMP:XMP-drone-dji:Latitude DJI_9999.JPG   but still can't get it to work....

again, huge apologies about this...

thanks
Mike


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14405
    • ExifTool Home Page
Re: Problem in copying tags
« Reply #5 on: March 06, 2019, 07:47:12 AM »
Hi Mike,

Your command should work with the current version of ExifTool.  Support for writing this XMP-drone-dji tag was likely added in version 11.27.

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

quigley595

  • Jr. Member
  • **
  • Posts: 14
Re: Problem in copying tags
« Reply #6 on: March 06, 2019, 09:20:35 AM »
Thanks Phil....
I have just downloaded it, and indeed... that seems to have done it for me...

Gee...  a fantastic tool you all have developed.....  I have a lot of learning yet to do!!!  :)  :)
Thanks a million!

rgds
mike