How to add XMP information into original RAW exif information?

Started by ManuGui, June 07, 2010, 03:18:16 PM

Previous topic - Next topic

ManuGui

Hi everyone,

I tried to find a solution for my problem reading the forum but I did not find an optimal answer...

Here is my problem:
I hawe a JOBO GPS reciever to geotag my pictures. For some reason, the software geotags differently raw files (.CR2 files for my canon EOS 400D) and jpeg files. Latitude/Longitude are either inside JPEG files (in exif infos) or in separated xmp files (for raw files). For sake of homogeneity and also to be able to visualize pictures in a map using iphoto of picasa (I do not use lightroom), I would like to "transfer" geotags from xmp files into original RAW files.

I use currently the following syntax :

exiftool -tagsfromfile %d%f.xmp %d%f.CR2 dir

where dir is the directory where pictures and xmp files are stored.

it seems to work but I fear that all information inside RAW file is reimplaced by the one from XMP file : I would like just to add original information and add geotag information from xmp file. How to do it?

I have also a second question: is it possible to make this command work for a given directory and also for its subdirectories ? example : update pictures in example directory, then in directory/subdirectory?

Thanks in advance for your information. Sorry for my poor english

Best regards,

Emmanuel



Phil Harvey

Hi Emmanuel ,

There is a file called xmp2gps.args in the full exiftool distribution which will do exactly what you want to all files in a directory with this command line:

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

It writes only EXIF GPS tags, and handles the other quirks involved with transferring these XMP tags to EXIF.  The -r option causes exiftool to recurse into subdirectories.

I have attached the xmp2gps.args file to this post for convenience.

- Phil

Edit: added -r option
...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 ($).

ManuGui

Great thanks for this quick answer. This works exactly as I wanted to !

Emmanuel