GPS position with no respect of GPSLongitudeRef

Started by waclaw66, January 24, 2024, 02:01:34 AM

Previous topic - Next topic

waclaw66

Hi!

exiftool decodes xmp file

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:exif="http://ns.adobe.com/exif/1.0/"
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
         <exif:GPSLongitude>81.574116666666669</exif:GPSLongitude>
         <exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
         <exif:GPSHPositioningError>0.0</exif:GPSHPositioningError>
         <exif:GPSSpeedRef>K</exif:GPSSpeedRef>
         <exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
         <exif:GPSLatitude>28.416161666666667</exif:GPSLatitude>
         <exif:GPSImgDirectionRef>T</exif:GPSImgDirectionRef>
         <exif:GPSTimeStamp>2001-01-01T00:00:00Z</exif:GPSTimeStamp>
         <exif:GPSSpeed>0.0</exif:GPSSpeed>
         <exif:GPSImgDirection>0.0</exif:GPSImgDirection>
         <photoshop:DateCreated>2016-01-23T10:36:32-05:00</photoshop:DateCreated>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

as

ExifTool Version Number         : 12.72
File Name                       : immich-xmp-test-0.jpg.xmp
Directory                       : .
File Size                       : 1013 bytes
File Modification Date/Time     : 2024:01:21 12:47:32+01:00
File Access Date/Time           : 2024:01:23 07:36:06+01:00
File Inode Change Date/Time     : 2024:01:23 07:36:06+01:00
File Permissions                : -rw-rw-r--
File Type                       : XMP
File Type Extension             : xmp
MIME Type                       : application/rdf+xml
XMP Toolkit                     : XMP Core 6.0.0
GPS Longitude                   : 81 deg 34' 26.82" E
GPS Horizontal Positioning Error: 0.0 m
GPS Speed Ref                   : km/h
GPS Latitude                    : 28 deg 24' 58.18" N
GPS Img Direction Ref           : True North
GPS Date/Time                   : 2001:01:01 00:00:00Z
GPS Speed                       : 0.0
GPS Img Direction               : 0.0
Date Created                    : 2016:01:23 10:36:32-05:00
GPS Latitude Ref                : North
GPS Longitude Ref               : East
GPS Position                    : 28 deg 24' 58.18" N, 81 deg 34' 26.82" E

"GPS Longitude Ref" and "GPS Position" should point to "West"

wywh

What generated that .xmp? macOS 10.15-14 Catalina - Sonoma Photos.app outputs such nonstandard GPS in a .xmp that puts western and southern locations to the other side of the globe.

The best workaround is to fix it with:

exiftool -P -overwrite_original -ext xmp -XMP-exif:All= -tagsFromFile @ -XMP-exif:All '-XMP-exif:GPSLongitude<${XMP-exif:GPSLongitude#}${XMP-exif:GPSLongitudeRef#}' '-XMP-exif:GPSLatitude<${XMP-exif:GPSLatitude#}${XMP-exif:GPSLatitudeRef#}' .
https://exiftool.org/forum/index.php?topic=14943.msg80546#msg80546

- Matti

Phil Harvey

That XMP is written incorrectly.  The idiots at CIPA got rid of the reference directions in their EXIF for XMP specification, which (predictably) has let to implementation errors such as this.

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

Neal Krawetz

Quote from: Phil Harvey on January 24, 2024, 07:41:48 AMThat XMP is written incorrectly.  The idiots at CIPA got rid of the reference directions in their EXIF for XMP specification, which (predictably) has let to implementation errors such as this.
I've seen this! I just didn't know the cause. I totally believe you, but do you have a reference for this?

Phil Harvey

#4
Page 19 in the EXIF for XMP specification.

- Phil

Edit: That was the older 2.31 specification.  The current 2.32 may be downloaded here.  Still page 19.
...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 ($).

Neal Krawetz

Quote from: Phil Harvey on January 24, 2024, 10:13:04 AMPage 19 in the EXIF for XMP specification.

- Phil

Edit: That was the older 2.31 specification.  The current 2.32 may be downloaded here.  Still page 19.
Sheesh... Yup, definitely will cause problems. Thank you.