Longituderef in .jpg and .xmp difference

Started by Alan Clifford, August 24, 2011, 08:20:22 PM

Previous topic - Next topic

Alan Clifford

Hi Phil,  I've tried to reduce to the specific point.

The result from the code below produces different results for .jpg and .xmp, with the longituderef being ignored for the .xmp file.  Or maybe I am using the fields incorrectly?

alan@coprolith:gpslongitudetest$ ./longitudetest.sh
    1 image files updated
GPS Longitude                   : 62 deg 3' 34.19" E
GPS Longitude Ref               : East
    1 image files updated
GPS Longitude                   : 62 deg 3' 34.19" W
GPS Longitude Ref               : West



#!/bin/bash

exiftool -m -P  \
      -gpslongitude=62.05949817909090909080  -gpslongituderef=West \
      -overwrite_original -previewimage= \
      dscf1881.avi.xmp

exiftool -gpslongitude  -gpslongituderef dscf1881.avi.xmp


exiftool -m -P  \
      -gpslongitude=62.05949817909090909080  -gpslongituderef=West \
      -overwrite_original -previewimage= \
      dscf1882.jpg

exiftool -gpslongitude  -gpslongituderef dscf1882.jpg

Alan Clifford

#1
I think I see.  XMP fields are different from exif fields.

Alan

... later

I think maybe it would make sense if I used xmp:longitude with signed numbers for both file types

Alan

Phil Harvey

Hi Alan,

Glad you figured this out.

I would recommend using EXIF for GPS in JPEG since more applications will recognize this information.

In XMP files, with the -G1 option you will see that the GPSLatitude/LongitudeRef tags are Composite.  These are not writable, and are generated only to facilitate copying XMP GPS to EXIF.

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

Alan Clifford

I think I have got myself sorted.  As I can't update .avi and .mov, I'm using a sidecar xmp file.

A small query.  I am now writing both xmp and exif gps stuff to the file.  If the file happens to be the sidecar file, exiftool doesn't seem to object that I am trying to write exif stuff to the xmp file in my bash script.  Is that OK?

    exiftool -m -P  -exif:gpslatitude=${gpslatitude} -exif:gpslatituderef=${gpslatituderef} \
      -exif:gpslongitude=${gpslongitude}  -exif:gpslongituderef=${gpslongituderef} \
      -exif:gpsaltitude=${gpsaltitude} -exif:gpsaltituderef=${gpsaltituderef} \
      -exif:gpsdatestamp=${gpsdatestamp} -exif:gpstimestamp=${gpstimestamp} \
      -xmp:gpslatitude=${xmpgpslatitude} \
      -xmp:gpslongitude=${xmpgpslongitude} \
      -xmp:gpsaltitude=${gpsaltitude} -xmp:gpsaltituderef=${gpsaltituderef} \
      -xmp:gpsdatetime="${xmpgpstimestamp}" \
      -overwrite_original -previewimage= \
      "$xmpphoto"  >&2


At the end of the day, I'm using the Perl and the api to extract $gpsposition and it seems to be working now for both file types.


Alan

Phil Harvey

Hi Alan,

Quote from: AlanClifford on August 25, 2011, 08:57:04 AM
A small query.  I am now writing both xmp and exif gps stuff to the file.  If the file happens to be the sidecar file, exiftool doesn't seem to object that I am trying to write exif stuff to the xmp file in my bash script.  Is that OK?

Yes, this is fine.  FAQ 23 touches on this subject.

QuoteAt the end of the day, I'm using the Perl and the api to extract $gpsposition and it seems to be working now for both file types.

Sounds good.  The Composite GPSPosition tag is designed to be valid for both types of metadata.

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