ExifTool refuses to set GPS tags in some images

Started by luis, January 16, 2022, 12:43:28 PM

Previous topic - Next topic

luis

I have many image files that I want to tag with exiftool (linux), but for some of them ExifTool refuses to set the tags and I don't see why.

For example, I have a RAW image B1094480.ORF with this time tags:

$  exiftool B1094480.ORF | egrep -i 'time|date|hour'

File Modification Date/Time     : 2022:01:16 12:16:15-03:00
File Access Date/Time           : 2022:01:16 12:31:37-03:00
File Inode Change Date/Time     : 2022:01:16 12:16:15-03:00
Modify Date                     : 2022:01:09 06:30:16
Exposure Time                   : 1/100
Date/Time Original              : 2022:01:09 06:30:16
Create Date                     : 2022:01:09 06:30:16
Date Time UTC                   : 2022:01:09 10:32:16


and my kml has this content:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>

<name>AVE - 2022-01-09</name>

<Style id="MyStyle">
  <altitudeMode>absolute</altitudeMode>
  <IconStyle><Icon><href>https://luis.impa.br/photo/images/bulletred.png</href></Icon></IconStyle>
  <BalloonStyle><bgColor>00664422</bgColor><text><textColor>fffffff</textColor></text></BalloonStyle>
  <LineString><tessellate>1</tessellate></LineString>
</Style>


<Placemark><name>06:06:58</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:06:58-0400</when></TimeStamp>
  <Point><coordinates>-60.985711,1.479232,61</coordinates></Point>
</Placemark>

...

<Placemark><name>06:26:24</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:26:24-0400</when></TimeStamp>
  <Point><coordinates>-60.983464,1.428661,39</coordinates></Point>
</Placemark>

<Placemark><name>06:27:34</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:27:34-0400</when></TimeStamp>
  <Point><coordinates>-60.983648,1.428262,32</coordinates></Point>
</Placemark>

<Placemark><name>06:28:37</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:28:37-0400</when></TimeStamp>
  <Point><coordinates>-60.983811,1.427719,44</coordinates></Point>
</Placemark>

<Placemark><name>06:29:41</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:29:41-0400</when></TimeStamp>
  <Point><coordinates>-60.983912,1.427461,41</coordinates></Point>
</Placemark>

<Placemark><name>06:30:43</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:30:43-0400</when></TimeStamp>
  <Point><coordinates>-60.983895,1.427331,52</coordinates></Point>
</Placemark>

<Placemark><name>06:31:45</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:31:45-0400</when></TimeStamp>
  <Point><coordinates>-60.983997,1.42724,40</coordinates></Point>
</Placemark>

<Placemark><name>06:32:48</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:32:48-0400</when></TimeStamp>
  <Point><coordinates>-60.984116,1.426984,36</coordinates></Point>
</Placemark>

<Placemark><name>06:33:50</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:33:50-0400</when></TimeStamp>
  <Point><coordinates>-60.984168,1.426769,42</coordinates></Point>
</Placemark>

<Placemark><name>06:34:52</name><styleUrl>#MyStyle</styleUrl>
  <TimeStamp><when>2022-01-09T06:34:52-0400</when></TimeStamp>
  <Point><coordinates>-60.984286,1.426348,32</coordinates></Point>
</Placemark>
...
</Document>
</kml>


So, it should have data for 06:30:16 timestamp. Yet, when I try to tag the image I get an error and no GPS data is set:

$ exiftool -overwrite_original_in_place -m -GPSMapDatum=WGS84 -geotag "./*kml"  B1094480.ORF

Warning: Time is too far from nearest GPS fix in File:Geotime (ValueConvInv) - B1094480.ORF
Warning: No writable tags set from ../../B1094480.ORF
    1 image files updated


What am I doing wrong?

StarGeek

#1
See Geotag Troubleshooting #3.  Add the -v2 option to see what time stamps exiftool is actually using.

Edit:  From that link
      If a timezone is not specified, the local system time zone (as set by the shell's TZ environment variable) is printed in the above message and used to convert the Geotime value to UTC

So my guess is that the -v2 output will show that the time stamp used will be 2022:01:09 06:30:16-03:00 where you would want 2022:01:09 06:30:16Z (00:00 timezone).
* 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).

luis

Running with the -v2 option I get the following output:

exiftool -v2 -overwrite_original_in_place -m -GPSMapDatum=WGS84 -geotag "./ave_220109_060647.kml" Dated_-220109-B_74480.orf

Argument "-Geotime<DateTimeOriginal#" is assumed
Loaded 197 points from XML-format GPS track log file 'RR/zz_gps/ave_220109_060647.kml'
  GPS track start: 2022:01:09 10:06:58.000 UTC
  GPS track end:   2022:01:09 16:56:36.000 UTC
Writing File:Geotag
Writing MIE-GPS:GPSMapDatum
Writing XMP-exif:GPSMapDatum if tag exists
Writing GPS:GPSMapDatum
======== Dated_-220109-B_74480.orf
Setting new values from Dated_-220109-B_74480.orf
  Geotime value:   2022:01:09 09:30:16.000 UTC (local timezone is -03:00)
Warning: Time is too far before track in File:Geotime (ValueConvInv) - Dated_-220109-B_74480.orf
Warning: No writable tags set from Dated_-220109-B_74480.orf
Rewriting Dated_-220109-B_74480.orf...
  Editing tags in: File GPS IFD0 MIE-GPS TIFF XMP
  Creating tags in: File GPS IFD0 MIE-GPS TIFF
  FileType = ORF
  FileTypeExtension = ORF
  MIMEType = image/x-olympus-orf
  Rewriting IFD0
  Rewriting ExifIFD
  Rewriting MakerNoteOlympus2
  Rewriting EquipmentIFD
  Rewriting CameraSettingsIFD
  Rewriting RawDevelopmentIFD
  Rewriting ImageProcessingIFD
  Rewriting FocusInfoIFD
  Rewriting GPS
    - GPS:GPSMapDatum = 'WGS84'
    + GPS:GPSMapDatum = 'WGS84'
  Copying 1 image data blocks
    1 image files updated


So the problem seems to be in the line:

    Geotime value:   2022:01:09 09:30:16.000 UTC (local timezone is -03:00)

The local timezone where I am now is -03:00, while the timezone where the image was taken was -04:00.

So the solution would be to add '-geotime<${DateTimeOriginal}-04:00' ?

StarGeek

Quote from: luis on January 16, 2022, 01:25:00 PM
So the solution would be to add '-geotime<${DateTimeOriginal}-04:00' ?

Test it and see, but that looks like it might be right.
* 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).

luis