ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: waclaw66 on January 24, 2024, 02:01:34 AM

Title: GPS position with no respect of GPSLongitudeRef
Post by: waclaw66 on January 24, 2024, 02:01:34 AM
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"
Title: Re: GPS position with no respect of GPSLongitudeRef
Post by: wywh on January 24, 2024, 05:17:15 AM
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 (https://exiftool.org/forum/index.php?topic=14943.msg80546#msg80546)

- Matti
Title: Re: GPS position with no respect of GPSLongitudeRef
Post by: Phil Harvey on January 24, 2024, 07:41:48 AM
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
Title: Re: GPS position with no respect of GPSLongitudeRef
Post by: Neal Krawetz on January 24, 2024, 10:05:46 AM
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?
Title: Re: GPS position with no respect of GPSLongitudeRef
Post by: Phil Harvey on January 24, 2024, 10:13:04 AM
Page 19 in the EXIF for XMP specification (https://www.cipa.jp/std/documents/e/DC-X010-2017.pdf#page=23).

- Phil

Edit: That was the older 2.31 specification.  The current 2.32 may be downloaded here (https://www.cipa.jp/std/documents/download_e.html?DC-010-2020_E).  Still page 19.
Title: Re: GPS position with no respect of GPSLongitudeRef
Post by: Neal Krawetz on January 24, 2024, 12:39:44 PM
Quote from: Phil Harvey on January 24, 2024, 10:13:04 AMPage 19 in the EXIF for XMP specification (https://www.cipa.jp/std/documents/e/DC-X010-2017.pdf).

- Phil

Edit: That was the older 2.31 specification.  The current 2.32 may be downloaded here (https://www.cipa.jp/std/documents/download_e.html?DC-010-2020_E).  Still page 19.
Sheesh... Yup, definitely will cause problems. Thank you.