ExifTool Forum

ExifTool => Newbies => Topic started by: PeterC on November 12, 2019, 07:23:57 AM

Title: Issue adding GPS lat/long such that location is available on iPhone.
Post by: PeterC on November 12, 2019, 07:23:57 AM
I am trying to added gps data to mp4 and mov files so that locations are available on my iphone.

C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -gpslatitude=42.5 -gpslongitude=42.5 "C:Photos\test\test2.mp4"
    1 image files updated

The command seems to run but the location is not visible in photos on my iPhone.   the latitude and longitude are not showing up in the [Composite] but are showing  up under [XMP-exif].   Is that the reason the Iphone is not recognizing the location?   


"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -a -G1 -s "C:\Photos\test\test2.mp4"
[ExifTool]      ExifToolVersion                 : 11.75
[System]        FileName                        : test2.mp4
...
[XMP-x]         XMPToolkit                      : Image::ExifTool 11.75
[XMP-exif]      GPSLatitude                     : 42 deg 30' 0.00" N
[XMP-exif]      GPSLongitude                    : 42 deg 30' 0.00" E
...
[Composite]     GPSLatitudeRef                  : North
[Composite]     GPSLongitudeRef                 : East
[Composite]     GPSPosition                     : 42 deg 30' 0.00" N, 42 deg 30' 0.00" E


C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -composite:gpslatitude="42.5" -composite:gpslongitude="42.5" "C:\Photos\test\test2.mp4"
Warning: Sorry, composite:GPSLatitude doesn't exist or isn't writable
Warning: Sorry, composite:GPSLongitude doesn't exist or isn't writable
Nothing to do.

C:\Users\Peter>"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -quicktime:gpslatitude="42.5" -quicktime:gpslongitude="42.5" "C:\Photos\test\test2.mp4"
Warning: Sorry, quicktime:GPSLatitude doesn't exist or isn't writable
Warning: Sorry, quicktime:GPSLongitude doesn't exist or isn't writable
Nothing to do.


Thanks in advance
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: Phil Harvey on November 12, 2019, 07:33:55 AM
Hi Peter,

First, make sure you are using ExifTool 11.69 or later.

Then, I think that Apple prefers the GPS coordinates for MOV and MP4 videos in Keys:GPSCoordinates (https://exiftool.org/TagNames/QuickTime.html), so try this:

"c:\users\peter\appdata\roaming\geosetter\tools\exiftool.exe" -keys:gpscoordinates=42.5,42.5 "C:Photos\test\test2.mp4"

- Phil
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: PeterC on November 12, 2019, 06:32:07 PM
iPhone recognizes coordinates when loaded as -keys:gpscoordinates=42.5,-42.5 .

Thanks again Phil.

Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: PeterC on December 01, 2019, 05:39:24 PM
Hi Phil (or anyone with more experience than i).

With your help I happily put the locations etc into my older images.   I put my work on this down for a month and just started working on newer photos.

when I run the line below, the DateTimeOriginal is sucessfully updated.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -DateTimeOriginal="2019:09:21 19:27:07" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    1 image files updated

However, when I run the line below, the DateTimeOriginal is sucessfully updated but the coordinates are not added.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -keys:gpscoordinates=31.4261139,-34.05948 -DateTimeOriginal="2019:09:21 19:27:07" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    1 image files updated

When I run the line below the coordinates are not added.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" -keys:gpscoordinates="31.4261139,-34.05948" "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
    0 image files updated
    1 image files unchanged

When I run the following lines, not tags are returned.   I am using 11.77 on Windows 10.
C:\Users\Peter>"c:\Program Files (x86)\GeoSetter\tools\exiftool.exe" "-gps*" -G1 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"

Any ideas what is am doing wrong?

Thanks.
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: StarGeek on December 01, 2019, 07:14:31 PM
Keys:GPSCoordinates is a video tag, not an image tag.  There are four tags you need to use to set a GPS coordinate in an image, GPSLatitude/GPSLongitude/GPSLatitudeRef/GPSLongitudeRef.  Because the GPSLatitude/GPSLongitude tags are unsigned, they can't contain negative numbers, so there is a Ref (Directional Reference) tag to go with that.  They can be set to N/S/E/W or you can just use the same number that you set the actual coordinate with and exiftool will figure it out.
exiftool -GPSLatitude=31.4261139 -GPSLongitude=-34.05948 -GPSLatitudeRef=31.4261139 -GPSLongitudeRef=-34.05948 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
or
exiftool -GPSLatitude=31.4261139 -GPSLongitude=-34.05948 -GPSLatitudeRef=N -GPSLongitudeRef=W "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"

Edit: I just now realized, you could use a wildcard and set both at once.
exiftool -GPSLatitude*=31.4261139 -GPSLongitude*=-34.05948 "C:\Photos\Library\2019\20190701-20191031\unmodified\IMG_1220.JPG"
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: Phil Harvey on December 01, 2019, 09:26:14 PM
Quote from: StarGeek on December 01, 2019, 07:14:31 PM
Edit: I just now realized, you could use a wildcard and set both at once.

Cool!  I hadn't thought of that.

- Phil
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: PeterC on December 02, 2019, 08:25:40 AM
Hi StarGeek/Phil.   

Thanks so much for helping this newbie.   
So I know that for MOV and MP4, I can use     -keys:gpscoordinates=42.5,-42.5
And for JPG, JPEG, HEIC, I can used               -GPSLatitude*=42.5 -GPSLongitude*=-42.5

However,  the later approach does not seems quite complete for PNG files.   The data goes into the metadata fine as
[GPS]           GPS Version ID                  : 2.3.0.0
[GPS]           GPS Latitude Ref                : North
[GPS]           GPS Longitude Ref               : West
[Composite]     GPS Latitude                    : 42 deg 30' 0.00" N
[Composite]     GPS Longitude                   : 42 deg 30' 0.00" W
[Composite]     GPS Position                    : 42 deg 30' 0.00" N, 42 deg 30' 0.00" W
However, for the PNG file, the location does not show up when I view the File Properties in Windows, nor in the Windows Photo application, nor when I load the file onto my iPhone.   Do I need to also populate other fields to get them to appear in Windows 10 or iPhone?

Thanks in advance.
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: Phil Harvey on December 02, 2019, 08:34:03 AM
Support for metadata in PNG images is seriously lacking in most software other than ExifTool.

- Phil
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: StarGeek on December 02, 2019, 11:04:55 AM
Quote from: PeterC on December 02, 2019, 08:25:40 AM
However, for the PNG file, the location does not show up when I view the File Properties in Windows, nor in the Windows Photo application, nor when I load the file onto my iPhone.   Do I need to also populate other fields to get them to appear in Windows 10 or iPhone?

I can't speak to the iPhone except to echo what Phil said.  I've tested over 1,400 tags in PNG files on Windows and Windows will only read one tag, PNG:CreationTime, which it displays as "Date Taken".
Title: Re: Issue adding GPS lat/long such that location is available on iPhone.
Post by: PeterC on December 02, 2019, 12:31:16 PM
Thank-you Phil and StarGeek for the all your help.