Writing tags from CSV file

Started by Happy Hobo, December 29, 2023, 03:09:14 AM

Previous topic - Next topic

Happy Hobo

Today, I'm working on 75 pictures that I took with an iPhone 4s long ago.  Several of them have no lat/long and several taken at different DateTimeOriginal have identical GPSDateTime.  These subsets overlap but aren't identical.

I created a CSV file, opened it in a spreadsheet, and corrected the GPSDateTimes by adding the time zone offset.  I looked at the images missing lat/long and recognized the location, so I added that.  So the spreadsheet (which I can save as CSV) has columns headed SourceFile,Lat,Long,GPSDateTime.  I can edit that into a script, but I wonder whether there is a way to update those tags directly from the CSV?

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

StarGeek

Quote from: Happy Hobo on December 29, 2023, 03:09:14 AMSo the spreadsheet (which I can save as CSV) has columns headed SourceFile,Lat,Long,GPSDateTime.

If the headers are actually "Lat" and "Long", then you will have to change them to GPSLatitude/GPSLongitude.  Also, you will have to duplicate the columns and change the headers for the duplicates to GPSLatitudeRef/GPSLongitudeRef.  There is no need to change the values in these columns to E/W/N/S, as exiftool will apply the correct values based upon if the coordinate is negative or positive.

Alternatively, you can add a new column to combine the two columns with a comma separating the two values and use GPSPosition as the header. Something like this I think
=A2&","&B2
In this case you don't need to rename the "Lat" and "Long" columns, exiftool will ignore them.  With GPSPosition, exiftool will write both the GPS coordinate tags and the reference tags.
"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

Happy Hobo

That and FAQ 25 gives me a great answer; thanks.
They're "lat" and "lon" only because I changed them for input to another tool.  But the corrections need to be made before feeding the other tool, so I can just do that and then
run the other tool.