Write specified tags into .xmp file with name of existing raw file

Started by richo, November 08, 2020, 12:41:54 PM

Previous topic - Next topic

richo

Is it possible to only write specified tags into .xmp file which names i basedon existing raw file in the folder?
I tried

exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -o %d%f.xmp  2020-10-24-00000?.raf

but it copied all tags from the raf files
-r-

StarGeek

See the Metadata Sidecar Files page.

It would basically be example #13 but replace the -TagsFromFile @ with the tags you want to set
exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -srcfile %d%f.xmp /path/to/files/
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Quote from: StarGeek on November 08, 2020, 01:04:01 PM
exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -srcfile %d%f.xmp /path/to/files/

You may want to exclude XMP files from this command in case some already existed.  ie)

exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -srcfile %d%f.xmp --ext xmp /path/to/files/
...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 ($).

richo

-r-

richo

Please excuse me if I am annoying, but I really love power of this tool now for many years and every time I learn something there is new idea popping out.
Now you showed me how to write only specified tags to xmp named after a raw file. Now I have folder where are some images for whos I have gps track file and few of them I do not have. I know where those not in gps track file where created and I have GPS coordinate of the place.

Is it possible to create xmp file with those coordinates, but only for those RAW files which do not have already xmp file?
Thank you.
-r-

Phil Harvey

I would have to say that this is possible, but I don't understand exactly what you want so I can't give an example.  Something like this perhaps?:

exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -o %d%f.xmp --ext xmp /path/to/files/

You will get errors for all the XMP files that already exist.

- Phil

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

richo

Quote from: Phil Harvey on November 10, 2020, 06:55:42 AM
I don't understand exactly what you want so I can't give an example.

I first run -geotag using my tracking.gps file on and creates sidecar xmp for all raw file. Some of them will be not covered by tracking.gps because i did not have my tracking turned on. those will not have xmp file created. I will manually locate GPS coordinates (based on picture i will remember when was it and use online maps to find coordinates).
For those I like to run command similar to what you wrote. It is often that multiple photos are shot on same location so I like to run (based on your last example something like this:

exiftool -GPSLatitude=46.9652522N -GPSLongitude=8.4770156E -o %d%f.xmp --ext xmp 2020-10-25-0023?.raf

which should take all raw files ending with 30...39. for example, it may be the case that *30 *31 already have xmp files, those I do not want to change.


-r-

Phil Harvey

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