Help - geotaging folder of jpgs with location data in csv

Started by Western_Rambler, December 16, 2022, 04:47:22 PM

Previous topic - Next topic

Western_Rambler

Greetings. I've just spent the last three hours exploring this wonderful tool. I've watched youtubes and have browsed the forums.

I am trying to accomplish a seemingly simple task that others have successfully completed, but I am running into issues I cannot resolve.

I have a folder containing 111 jpegs that need geotags.
I have a csv file containing file name of each photo and lat/longs.

My CSV is formatted as follows:
SourceFile    GPSLongitude    GPSLatitude    GPSAltitude
F:\Tickel_Photos\2_Topo\10024.jpg    39.04220346    -107.9593412    10171.561
F:\Tickel_Photos\2_Topo\10025.jpg    39.04220372    -107.9592713    10170.415
I've tried to use the following two lines without success:

Exiftool -csv="F:\Tickel_Photos\2_Topo\TOPO_LAT_LONG.csv" "F:\Tickel_Photos\2_Topo"

Exiftool -GPS:"all<XMP-exif:all" "-GPS:GPSLongitude<Composite:GPSLongitude" "-GPS:GPSLatitude<Composite:GPSLatitude" "F:\Tickel_Photos\2_Topo"

And the first message I get when running the code is this:

Exiftool : Error: Format error in file - F:/Tickel_Photos/2_Topo/21746_1.jpg
At line:1 char:1
+ Exiftool -csv="F:\Tickel_Photos\2_Topo\TOPO_LAT_LONG.csv" "F:\Tickel_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: Format e...opo/21746_1.jpg:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Error: Format error in file - F:/Tickel_Photos/2_Topo/21746_2.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21747_1.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21747_2.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21748.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21888.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21890.jpg
Error: Format error in file - F:/Tickel_Photos/2_Topo/21891.jpg
    1 directories scanned
  102 image files updated
    8 files weren't updated due to errors
Exiftool : Warning: No writable tags set from F:/Tickel_Photos/2_Topo/10024.jpg
At line:2 char:1
+ Exiftool -GPS:"all<XMP-exif:all" "-GPS:GPSLongitude<Composite:GPSLong ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Warning: No wri..._Topo/10024.jpg:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Warning: No writable tags set from F:/Tickel_Photos/2_Topo/10025.jpg
...
Warning: No writable tags set from F:/Tickel_Photos/2_Topo/21629_2.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21746_1.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21746_2.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21747_1.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21747_2.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21748.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21888.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21890.jpg
Error: File is empty - F:/Tickel_Photos/2_Topo/21891.jpg
    1 directories scanned
    0 image files updated
  102 image files unchanged
    8 files weren't updated due to errors


Obvious syntax error is not so obvious to me. Please help - thank you!

Western_Rambler

I think my main issue is "Warning: No writable tags set from <directory/file.jpg>

Any help would be greatly appreciated!

StarGeek

Quote from: Western_Rambler on December 16, 2022, 04:47:22 PMMy CSV is formatted as follows:
SourceFile    GPSLongitude    GPSLatitude    GPSAltitude
F:\Tickel_Photos\2_Topo\10024.jpg    39.04220346    -107.9593412    10171.561
F:\Tickel_Photos\2_Topo\10025.jpg    39.04220372    -107.9592713    10170.415

This is not a CSV file, this is a tab separated file.  I'm assuming that this is originating in a spreadsheet of some sort.  Make sure you save it as a Comma Separated file.  For example, using LibreOffice, you would make sure "edit filters" is checked and you would get this window, which has comma and double quotes correctly set


QuoteAnd the first message I get when running the code is this:

Exiftool : Error: Format error in file - F:/Tickel_Photos/2_Topo/21746_1.jpg
At line:1 char:1
+ Exiftool -csv="F:\Tickel_Photos\2_Topo\TOPO_LAT_LONG.csv" "F:\Tickel_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: Format e...opo/21746_1.jpg:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

It looks like you are using PowerShell.  I would suggest using CMD instead.  Or look carefully at how PS is highlighting your command. PS does a lot of really stupid parsing of commands, among other issues.  Each group in the command should be highlighted the same way.

Finally, you are missing the GPS reference directions in your data.  The GPS group (which is in the EXIF group) splits the coordinate and the direction into two separate tags.  So you have to set GPSlatitude, GPSLongitude, GPSAltitude, GPSlatitudeRef, GPSLongitudeRef, and GPSAltitudeRef separately. The easiest thing to do is to copy/paste your GPS columns and add REF to the end.  Your CSV file should look like this
SourceFile,GPSLongitude,GPSLatitude,GPSAltitude,GPSLongitudeRef,GPSLatitudeRef,GPSAltitudeRef
F:\Tickel_Photos\2_Topo\10024.jpg,39.04220346,-107.9593412,10171.561,39.04220346,-107.9593412,10171.561
F:\Tickel_Photos\2_Topo\10025.jpg,39.04220372,-107.9592713,10170.415,39.04220372,-107.9592713,10170.415
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Western_Rambler

Thanks for the help, StarGeek. Much appreciated. I was able to get the tool to run successfully!