ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: pofeltag on January 30, 2025, 06:55:17 PM

Title: Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates
Post by: pofeltag on January 30, 2025, 06:55:17 PM
I have a tif file (jpg works the same) scanned in.
None of the EXIF GPS fields are set.
I can set the EXIF:Latitude and EXIF:Longitude fields, but when I try to set the *Ref fields, I get the following error.  I am setting decimal coordinates for the GPS tags.
I am using the following command with the following results.

exiftool -GPSLongitudeRef=South n.jpg
Warning: Can't convert GPS:GPSLongitudeRef (not in PrintConv)
Nothing to do.

I tried saving the decimal coordinates with a minus for West or South hoping would trigger exiftool to fill in the appropriate East/West & North/South values, but it doesn't. 
The coordinates I am using are similar to: 38.23789741,-101.68091394 separated appropriately for Latitude and Longitude.  I doesn't make any difference if the Latitude or Longitude fields are set or empty.  It doesn't make any difference if the value has a beginning minus or not.

Do you have any suggestions how to proceed?
Title: Re: Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates
Post by: StarGeek on January 30, 2025, 09:21:10 PM
Longitude is East/West. Latitude is North/South.

IMO, it's best to let exiftool figure out the references. The first way is to pass the numbers to all the tags
exiftool -GPSLatitude=38.23789741 -GPSLatitudeRef=38.23789741 -GPSLongitude=-101.68091394 -GPSLongitudeRef=-101.68091394 file.tif

Even easier, use a wildcard which will fill out the main tag and the reference tag at once. The quotes are needed if you're using Mac/Linux
exiftool "-GPSLatitude*=38.23789741" "-GPSLongitude*=-101.68091394" file.tif

And even easier is the GPS Composite tag
exiftool "-GPSPosition=38.23789741,-101.68091394" file.tif

Examples:
C:\>exiftool_12.92 -P -overwrite_original  -GPSLatitude=38.23789741 -GPSLatitudeRef=38.23789741 -GPSLongitude=-101.68091394 -GPSLongitudeRef=-101.68091394 y:\!temp\Test3.jpg
    1 image files updated

C:\>exiftool_12.92 -P -overwrite_original "-GPSLatitude*=38.23789741" "-GPSLongitude*=-101.68091394" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool_12.92 -P -overwrite_original "-GPSPosition=38.23789741,-101.68091394" y:\!temp\Test5.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -n -gps* y:\!temp\Test3.jpg y:\!temp\Test4.jpg y:\!temp\Test5.jpg
======== y:/!temp/Test3.jpg
[GPS]           GPSVersionID                    : 2 3 0 0
[GPS]           GPSLatitudeRef                  : N
[GPS]           GPSLatitude                     : 38.237897409975
[GPS]           GPSLongitudeRef                 : W
[GPS]           GPSLongitude                    : 101.680913940014
[Composite]     GPSLatitude                     : 38.237897409975
[Composite]     GPSLongitude                    : -101.680913940014
[Composite]     GPSPosition                     : 38.237897409975 -101.680913940014
======== y:/!temp/Test4.jpg
[GPS]           GPSVersionID                    : 2 3 0 0
[GPS]           GPSLatitudeRef                  : N
[GPS]           GPSLatitude                     : 38.237897409975
[GPS]           GPSLongitudeRef                 : W
[GPS]           GPSLongitude                    : 101.680913940014
[Composite]     GPSLatitude                     : 38.237897409975
[Composite]     GPSLongitude                    : -101.680913940014
[Composite]     GPSPosition                     : 38.237897409975 -101.680913940014
======== y:/!temp/Test5.jpg
[GPS]           GPSVersionID                    : 2 3 0 0
[GPS]           GPSLatitudeRef                  : N
[GPS]           GPSLatitude                     : 38.237897409975
[GPS]           GPSLongitudeRef                 : W
[GPS]           GPSLongitude                    : 101.680913940014
[Composite]     GPSLatitude                     : 38.237897409975
[Composite]     GPSLongitude                    : -101.680913940014
[Composite]     GPSPosition                     : 38.237897409975 -101.680913940014
    3 image files read
Title: Re: Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates
Post by: pofeltag on January 31, 2025, 10:20:29 AM
Got it, it works perfectly.  Thank you
I knew from FAQ 14 that exiftool was supposed to accept this GPS format, but didn't know how to present it.
Title: Re: Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates
Post by: Phil Harvey on January 31, 2025, 10:49:52 AM
Note that the input coordinates should be signed to set the proper N/S/E/W quadrant.  Some of StarGeek's commands were missing the negative for the western hemisphere.  They should have been:

exiftool -GPSLatitude=38.23789741 -GPSLatitudeRef=38.23789741 -GPSLongitude=-101.68091394 -GPSLongitudeRef=-101.68091394 file.tif

exiftool "-GPSLatitude*=38.23789741" "-GPSLongitude*=-101.68091394" file.tif

but the examples in the code block were correct.

- Phil
Title: Re: Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates
Post by: StarGeek on January 31, 2025, 11:08:28 AM
Dang it, I thought I caught all that. Fixed