Author Topic: Copy GPS information from one picture into all pictures of a directory  (Read 1789 times)

XftlArd

  • Newbie
  • *
  • Posts: 2
Good afternoon,

I am a beginner with ExifTool. I want to fullfill all files from a specific directory with the GPS coordinates from one specific picture, saved in an another directory.
I managed to put the GPS information from the reference picture in a CSV file (exiftool -common -csv DIR > out1.csv). Then, I copied informations of the first line, numerous times, in order to have as many lines as pictures in my directory, manually. I wrote these coordinates in each file of the directory, with ExifTool (exiftool -csv=Dir/out1.csv Dir2).
But, I find that it needs to many manual operations to do that.
Is it possible to do that automatically?
If yes, is it possible to avoid any over-writing, if some GPS informations exist, or to check if GPS information exist and jump to the next picture?

Thank You


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16724
    • ExifTool Home Page
If the gps coordinates are already in an image, it is easiest to just copy them over:

exiftool -tagsfromfile SRCFILE -gps:all -wm cg DIR

where SRCFILE is your source file, and DIR is one or more target files and/or directory names.

Here the write mode is set so that existing tags are not changed (the -wm cg option), which should do what you wanted..

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

XftlArd

  • Newbie
  • *
  • Posts: 2
Thank you very much Phil!

Can I confess you that I think "how simple it is, when you know perfectly your language or software"

Regards