Confusion Writing/Reading a GPS exif Tag

Started by twelvelanterns, November 09, 2015, 08:42:41 PM

Previous topic - Next topic

twelvelanterns

If i use the n switch to read -exif:GPSLongitude and -GPSLongitude i am getting a different result (not a different value) --

exiftool -GPSLatitudeRef -GPSLatitude -n -GPSLongitudeRef -GPSLongitude -n castle.jpg

GPS Latitude Ref                : N
GPS Latitude                    : 53.031305
GPS Longitude Ref               : W
GPS Longitude                   : -8.8136


exiftool -exif:GPSLatitudeRef -exif:GPSLatitude -n -exif:GPSLongitudeRef -exif:GPSLongitude -n castle.jpg

GPS Latitude Ref                : N
GPS Latitude                    : 53.031305
GPS Longitude Ref               : W
GPS Longitude                   : 8.8136


So my question is: Does exiftool actually write the same value for -exif:GPSLongitude and -GPSLongitude ?


--

As an aside i really can't thank you enough for this tool. When i have the funds available i will certainly be making a donation. Thanks again.

StarGeek

The difference between the two results is the source of those tags.  In the second command, you specified the EXIF block.  The GPS tags in the EXIF block are unsigned and require you to also read the Ref tags to decode the coordinates properly.  In the first command, you didn't specify where to read the tags from so ExifTool gave you the Composite tags, which will add the negative on West or South references for you.  If you add -g1 -a to your command, you'll get something like this, which will show you where the tags are pulled from:
---- GPS ----
GPS Latitude Ref                : N
GPS Latitude                    : 12.11739
GPS Longitude Ref               : W
GPS Longitude                   : 68.2346
---- Composite ----
GPS Latitude                    : 12.11739
GPS Longitude                   : -68.2346


ExifTool is writing the data correctly, but if the coordinate is negative, it's up to you to make sure that you write the EXIF Ref tag properly.  One way to work around this is to write to the XMP GPS tags (XMP:GPSLatitude, XMP:GPSLongitude) as those tags do accept negative numbers.  Then, if you need the EXIF GPS tags written to, you can then copy them from the XMP using the xmp2gps.args file that's included in the full distribution.
* 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).

twelvelanterns

Thanks so much.

If i write to -exif:GPSLatitudeRef that will also change the composites -GPSLatitudeRef and -GPSLatitude when they are read?

Just as an aside; i have found less adoption of XMP (specifically "-XMP:GPS...") without any other tags present. Don't get me wrong, though; i'd love to consolidate. In my work with cryptography standards, i've noticed it takes the net about ten years to adopt. I really hope that's not going to be the case with metadata on consumer media.

Phil Harvey

Quote from: twelvelanterns on November 10, 2015, 01:31:26 PM
If i write to -exif:GPSLatitudeRef that will also change the composites -GPSLatitudeRef and -GPSLatitude when they are read?

It will change Composite:GPSLatitude (if GPS:GPSLatitude exists too), but Composite:GPSLatitudeRef is a convenience tag derived from XMP:GPSLatitude.  See the Composite tags documentation for details.

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

twelvelanterns

Ok, great. Thanks for answering my questions. I'm going to be spending time with the Documentation as i use this tool going forward.

I hope you folks enjoy the rest of your day.