Linux exiftool 12.92 doesn't allow EXIF GPS North/South East/West updates

Started by pofeltag, January 30, 2025, 06:55:17 PM

Previous topic - Next topic

pofeltag

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?

StarGeek

#1
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
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

pofeltag

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.

Phil Harvey

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

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype