Sync GPS from txt files

Started by Newsky, August 26, 2015, 04:26:12 AM

Previous topic - Next topic

Newsky

I have two text files in which lists of files with full ways to them are specified. Ways and names of files the identical. In the first folder of the photo without GPS of data, and in the second with GPS this. How GPS can copy only data from files of the first list in files from the second list? Structure (the enclosed folders) are identical, differ only a disk name.
Sorry for my english. I use Google translator

Phil Harvey

Here is the usual way to do this (let's assume the images without GPS are on E: and the images with GPS are on F:)

1) cd E:

2) cd /

3) exiftool -tagsfromfile F:%d%f.%e -gps:all /FOLDER

where /FOLDER is the name of the folder containing the images, starting with a "/".

I can't test this right now on Windows, but I think this should work if I remember correctly how Windows handles working directories.

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

Newsky

The most important in a task that files which need to be processed it is necessary to take from without_gps.txt In both folders more than 33000 photos, and it is necessary to process about 6000 and I can't shift them in other folder because all of them lie in different places.
Without_gps.txt:
Quoted:\photo\Apple\Camera\2012\2012-11\2012-11-17 17-22-38.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-32-21.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-36-21.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-21 13-47-35.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-21 16-18-23.jpg
with_gps.txt:
QuoteE:\photo\Apple\Camera\2012\2012-11\2012-11-17 17-22-38.jpg
E:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-32-21.jpg
E:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-36-21.jpg
E:\photo\Apple\Camera\2012\2012-11\2012-11-21 13-47-35.jpg
E:\photo\Apple\Camera\2012\2012-11\2012-11-21 16-18-23.jpg
Sorry for my english. I use Google translator

Phil Harvey

I can't test this right now on Windows, but something like this may work:

exiftool -tagsfromfile e:%:1d%f.%e -gps:all -@ Without_gps.txt

But I'm not sure that %:1d will remove just the drive letter.  You'll have to test on Windows to see what happens.

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

Newsky

Quote from: Phil Harvey on August 26, 2015, 09:09:14 AM
exiftool -tagsfromfile e:%:1d%f.%e -gps:all -@ Without_gps.txt

This option worked perfectly! But ... the Cyrillic, Cyrillic ... :(
Process only those files that were not in the way the Cyrillic



Then I decided to try this option:
Quote1) cd E:

2) cd /

3) exiftool -tagsfromfile F:%d%f.%e -gps:all /FOLDER

Leaving only the necessary files, run the above code, and that something is not right ...

Sorry for my english. I use Google translator

Phil Harvey

Why is it looking for .psd and .tif files?  I thought the images were .jpg.

If WIthout_gps.txt contains special characters, then you must specify the character set.  Hopefully it is UTF-8, and if so this is the command:

exiftool -tagsfromfile e:%:1d%f.%e -gps:all -charset filename=utf8 -@ Without_gps.txt

Also, to display the filenames properly you must either change cmd.exe to UTF8, or specify the character set you are using, maybe like this:

exiftool -tagsfromfile e:%:1d%f.%e -gps:all -charset filename=utf8 -charset latin2 -@ Without_gps.txt

See FAQ 10 for more information.

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

Newsky

Yes, yes, just jpg files. I just had to put in a folder, all files without the GPS coordinates, otherwise there is no way, and to handle PSD, Tiff is not necessary.
Sorry for my english. I use Google translator

Phil Harvey

Then I don't understand why the .psd and .tif files were apparently inside WIthout_gps.txt

Anyway, you may want to add -ext jpg to your command to process only .jpg files.

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

Newsky

I think I understand why you are asking about :) PSD. In the log, visible only error with PSD, TIFF, but JPG exactly the same error "file not found" and it is clear why. At first, I found in the LR all photos without geotags, noted their "red", and then, in Total Commmander found all new and changed files are copied the full path of the selected files. So I got the list. There were-and PSD.
To deal with encoding, I read the FAQ on your link (certainly not in the first :) ). But I will add key -ext jpg
Sorry for my english. I use Google translator

Newsky

I do not cease to thank you, Phil! Everything went really well. Thanks for the help!
Quote1774 image files updated
4652 image files unchanged
-- press any key --
Sorry for my english. I use Google translator

Newsky

There was a similar question. How can process images (such as exiftool -Comment="This is a new comment") from a text list?
text_list.txt:
Quoted:\photo\Apple\Camera\2012\2012-11\2012-11-17 17-22-38.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-32-21.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-18 13-36-21.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-21 13-47-35.jpg
d:\photo\Apple\Camera\2012\2012-11\2012-11-21 16-18-23.jpg
Sorry for my english. I use Google translator

Phil Harvey

exiftool -Comment="This is a new comment" -@ text_list.txt
...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 ($).

Newsky

Simple as that from ExifTool !!! Thank you!
Sorry for my english. I use Google translator

Newsky

Quote from: Phil Harvey on August 26, 2015, 09:09:14 AM
I can't test this right now on Windows, but something like this may work:

exiftool -tagsfromfile e:%:1d%f.%e -gps:all -@ Without_gps.txt

But I'm not sure that %:1d will remove just the drive letter.  You'll have to test on Windows to see what happens.

- Phil
I think again, I'm doing something wrong, but I can not understand that ... Again, please help ...
https://youtu.be/ZNkKjAvR-cg
Sorry for my english. I use Google translator

Phil Harvey

I just wanted you to know that I am not ignoring you.  I need to test this out on a Windows computer, and I haven't had a chance to do that yet.

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