Copy GPS info from XMP to EXIF group in the same file

Started by Archive, May 12, 2010, 08:54:29 AM

Previous topic - Next topic

Archive

[Originally posted by multcam on 2009-01-09 13:08:09-08]

Hi,

I have three questions. I tried to figure it out with the examples and experimented with some commands but could not figure out how to do it.

I have many photo's with GPS info in the XMP group, but NOT in the EXIF group. The photo's are JPG files.
I want to copy all the GPS information from the XMP group of a JPG file to the EXIF group in the same file.

I have 3 questions
1) How can I copy all the GPS related tags from XMP group to the EXIF group?
2) How can I do that for all the JPG files in a directory?
3) Is it possible to do it for a whole tree of directories. So recusively?

Thanks for all the advice.

Dick
the Netherlands

Archive

[Originally posted by exiftool on 2009-01-09 13:21:22-08]

Hi Dick,

I'll try to answer your questions:

1) Most of the XMP GPS information can be copied to same-named
tags in the EXIF, but unfortunately the reference directions are stored
separately in EXIF but not XMP, so they must be handled specially:

Code:
exiftool "-gps:all<xmp-exif:all" -gpslatituderef -gpslongituderef  FILE

2) If FILE is a directory name, then exiftool will process all files
in the directory.

3) Add the -r option to also process files in sub-directories
(ie. the whole directory tree).

Note that this command will create "_original" files to back up all of your
original images.  If you already have backups, add the -overwrite_original
option to the command line.

- Phil

Archive

[Originally posted by multcam on 2009-01-09 14:09:54-08]

Hi Phil,

Thank you very much. It works.
I searched the forum with the words copy xmp to exif and found no help. Later on it searched with GPS and came across threads 9373.
So I have one more question.

The above command:
Code:
exiftool "-gps:all<xmp-exif:all" -gpslatituderef -gpslongituderef


In thread 9373 you mention also the command:
Code:
exiftool "-gps:all<xmp-exif:all" "-gps:all<composite:all" "-gpsdatestamp<gpsdatetime" "-gpstimestamp<gpsdatetime"
.
I tried this one also.

The difference between the first and the last command is that the exif field GPSTimeStamp and GPSDateStamp are missing with the first command.
Is this serious and what should be preferred?

Greetings,

Dick

Archive

[Originally posted by exiftool on 2009-01-09 14:50:46-08]

Right.  I'm glad you found the other thread.  I had
forgotten about the GPS timestamp difference.
The second command is the one you want.

Since this has come up before, maybe it deserves
a ".args" file in the exiftool distribution.

- Phil

Archive

[Originally posted by multcam on 2009-01-10 10:16:55-08]

Hi Phil,

Just to let you know the result. It works as a charme. Awesome!

I used the commandline:

Code:
exiftool -r -overwrite_original "-gps:all<xmp-exif:all" "-gps:all<composite:all" "-gpsdatestamp<gpsdatetime" "-gpstimestamp<gpsdatetime" "M:\Foto's\"
.

M:\foto's is the top directory of all my pictures. With this single command it updated 4500 photo's. Great!

Background: I geotag my pictures with GeoSetter (which uses ExifTool). Then I import them into Lightroom. Because I like to keep my photo's original, after importing them in Lightroom with the Geotag information I copy back the originals. In a sense I fool Lightroom because I replace the changed file from Geosetter after import with the original file.

It seems to me that when exporting photo's from Lightroom it copies the EXIF information from the actual file in the directory instead of exporting it from its database. So when exporting and the changed file is still there, the exported file has de EXIF:GPS information, but when I have copied back the original file without the GPS information, then the exported file from Lightroom has no EXIF:GPS information. Yet it has XMP:GPS information.

So, because of my workflow, I had 4500 exported photo's from Lightroom without EXIF:GPS information.
Now this has been corrected with ExifTool. Thanks alot for this GREAT TOOL!

Dick