Author Topic: Add tag and copy data from source  (Read 105 times)

lavAzza

  • Newbie
  • *
  • Posts: 9
Add tag and copy data from source
« on: August 04, 2020, 09:32:49 AM »
Hello.
I thought I could handle this simple task, but I couldn't.(

I need to copy GPS coordinates from jpg files to another jpg files.
I try to
Code: [Select]
exiftool -tagsfromfile %%d%%f.jpg "-all:all>all:all" -overwrite_original -ext jpg .\change\but it is not work. As I understand because target file have no this tags.
Source file have data:
GPS Version ID                  : 2.2.0.0
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Altitude Ref                : Unknown (0 0)
GPS Altitude                    : 521.7 m Below Sea Level
GPS Latitude                    : 54 deg 37' 38.64" N
GPS Longitude                   : 58 deg 45' 0.06" E
GPS Position                    : 54 deg 37' 38.64" N, 58 deg 45' 0.06" E

How to solve?
Thank you.

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 3951
Re: Add tag and copy data from source
« Reply #1 on: August 04, 2020, 10:43:16 AM »
Your command only copies tags back into the same file.  For example, if you have a file .\change\IMG_001.jpg, the %d will use the directory .\change\ and the %f will use the base filename IMG_001 and you add .jpg for the extension.  The resulting source name is .\change\IMG_001.jpg, the same file you are trying to copy tags to.  The format for the -TagsFromFile option is -TagsFromFile SOURCE -TAGS DESTINATION

Where are your source files located?

Also, you can simply use -All:All, you don't need to redirect the tag copy.
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.

lavAzza

  • Newbie
  • *
  • Posts: 9
Re: Add tag and copy data from source
« Reply #2 on: August 04, 2020, 11:51:06 AM »
Yes you are right. I didn't understand the meaning of %% d. I removed this variable and now everything works.
Thank you very much.