Hi everyone, i'm hoping someone might be able to tell me what command line i should use to achieve the following:
Im running exiftool on windows 10. I want to geotag all .jpg files in a directory including its sub directories, but only if the camera make is NIKON and if no gps data is present. The source file for the geo data is a big google takeout .kml file. The GPS data should be shifted 2 hours forward from what is in the klm file.
Could anyone tell me how the command for this would need to be?
Thanks in advance!
See here (https://exiftool.org/geotag.html), but your command could look like this:
exiftool -geosync=2:00 -geotag=my.kml -if "$make =~ /nikon/i and not $gpslatitude" DIR
But I suspect you may not really want to shift the times by 2 hours. The KML times are probably UTC. What time zone are you in?
- Phil
GMT +2 so that should be the same as UTC+2. Would i also need to add -r for recursive ?
Right. You need -r and probably drop the -geosync
- Phil
Thank you for your help! However why do you say I probably should drop the geosync tag? Should I not correct for the time zone difference?
No. If the time zone is specified in the KML file then ExifTool will handle this.
If a time doesn't contain zone, then it is assumed to be in the local system time zone. In this case you may need to use -geosync. Add the -v2 option to your command to see what times are being used from the KML file.
- Phil
so for some files i get the following error
Warning: [minor] Error reading PreviewImage from file - IMG_20150222_120359.JPG
Warning: No writable tags set from IMG_20150222_120359.JPG
Nothing changed in IMG_20150222_120359.JPG
Any way to have exiftool correct this?
The PreviewImage problem is normal if you have used other software to edit the images.
See Geotagging troubleshooting tip #2 (https://exiftool.org/geotag.html#Troubleshooting) for your other problem.
- Phil
Thats strange,
i get the error on for example this file:
Warning: No writable tags set from IMG_20160813_143130.JPG
Nothing changed in IMG_20160813_143130.JPG
following the FAQ and running exiftool -s -time:all against it:
FileModifyDate : 2016:08:24 08:22:25+02:00
FileAccessDate : 2019:06:30 09:03:06+02:00
FileCreateDate : 2019:05:10 19:15:11+02:00
ModifyDate : 2016:08:13 14:31:30
DateTimeOriginal : 2016:08:13 14:31:30
CreateDate : 2016:08:13 14:31:30
TimeZone : +01:00
DaylightSavings : No
DateDisplayFormat : D/M/Y
PowerUpTime : 0000:00:00 00:00:00
SubSecTime : 03
SubSecTimeOriginal : 03
SubSecTimeDigitized : 03
SubSecCreateDate : 2016:08:13 14:31:30.03
SubSecDateTimeOriginal : 2016:08:13 14:31:30.03
SubSecModifyDate : 2016:08:13 14:31:30.03
So it seems to me the required tag is in the file?
Could you send me the file and the track log so I can try this? My email is philharvey66 at gmail.com
- Phil
I just send you a email. Thanks for your help!
Hmmm. This works for me with ExifTool 11.53:
> exiftool -geotag tmp/history-2016-08-13.kml tmp/IMG_20160813_143130.JPG
Warning: [minor] Error reading PreviewImage from file - tmp/IMG_20160813_143130.JPG
1 image files updated
> exiftool tmp/IMG_20160813_143130.JPG -a -gps:all
GPS Version ID : 2.3.0.0
GPS Latitude Ref : North
GPS Latitude : 52.387490
GPS Longitude Ref : East
GPS Longitude : 5.235745
GPS Time Stamp : 18:31:30
GPS Date Stamp : 2016:08:13
But it could be that my time zone is different from yours (I'm -05:00). If so, and your time zone puts your DateTimeOriginal outside the track, then you should get a warning. Try adding -v3 to your command to see all of the gory details.
Also, you sent me a different file from the one that gave you the problem. Are you sure the file you sent gives you a problem?
- Phil