ExifTool Forum

ExifTool => Newbies => Topic started by: lavAzza on August 04, 2020, 09:32:49 AM

Title: Add tag and copy data from source
Post by: lavAzza 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
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.
Title: Re: Add tag and copy data from source
Post by: StarGeek 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 (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) 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.
Title: Re: Add tag and copy data from source
Post by: lavAzza 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.