How to move gps data from xmp to jpg?

Started by alanterra, October 10, 2011, 05:05:35 PM

Previous topic - Next topic

alanterra

Somehow I have a bunch of jpgs with associated xmp files, and the geotagging information is in the xmp file. Is there any (easy) way to copy the geotagging data from the xmp to the jpg?

I tried the <= syntax, but it didn't seem to work:

exiftool -gpsposition *

======== a.JPG
======== a.xmp
GPS Position                    : 25 deg 12' 34.68" N, 110 deg 54' 56.26" W
    2 image files read


exiftool -overwrite_original_in_place '-gpsaltitude<=%f.xmp' '-gpslatitude<=%f.xmp' '-gpslongitude<=%f.xmp' '-gpslatituderef<=%f.xmp' '-gpslongituderef<=%f.xmp' a.JPG

Can't convert GPS:GPSLatitudeRef (not in PrintConv)
Can't convert GPS:GPSLongitudeRef (not in PrintConv)
    1 image files updated


exiftool -gpsposition *

======== a.JPG
GPS Position                    : 5 deg 0' 9.00", 5 deg 0' 9.00"
======== a.xmp
GPS Position                    : 25 deg 12' 34.68" N, 110 deg 54' 56.26" W
    2 image files read



Phil Harvey

In the full Perl ExifTool distribution you will find a file called "xmp2gps.args".  With this file in the current directory, use the following command to do what you want:

exiftool -tagsfromfile %d%f.xmp -@ xmp2gps.args DIR

where DIR is the directory containing your images.  Add the -r option to also process sub-directories.

xmp2gps.args is a simple text file containing exiftool arguments.  You can look at it to see what the arguments should have been to do this yourself.

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