Write usable GPS tags to image

Started by mho, May 27, 2025, 10:10:20 AM

Previous topic - Next topic

mho

Hi everyone,

I feel like this should be quite easy, but I was not able to get it to work.

I am creating images with Python and would like to add GPS tags with exiftool to those images. It seems that all tags I tried to include (GPSLatitude, GPSLatitudeRef, GPSLongitude, GPSLongitudeRef, GPSAltitude, GPSAltitudeRef) all have been included in the file.

While that seems to be correct, I am not able to work with those tags outside of exiftool. Windows Explorer file details pane shows no GPS position at all and other software (photogrammetric software, such as Agisoft Metashape) does not recognize any geo information for that image.

I would be very happy if you could lead me in the right direction.

Thank you in advance!

Cheers,
Mario

img_with_gps_tags.PNG

StarGeek

Quote from: mho on May 27, 2025, 10:10:20 AMWhile that seems to be correct, I am not able to work with those tags outside of exiftool. Windows Explorer file details pane shows no GPS position at all and other software (photogrammetric software, such as Agisoft Metashape) does not recognize any geo information for that image.

tl;dr The programs you are using don't support metadata in PNG files.

If you are using Windows 10 or earlier, then you won't see any metadata in PNG files except for "Date Taken", and only if the date is written to a specific PNG tag. See the Windows Metadata thread to see what tags Windows reads to fill its various properties.

I do not have Windows 11, so I have not been able to test PNG files with it, but I have heard that PNG metadata support has been increased in that.

But beyond that, Windows 10 does not properly read GPS tags anyway. It will only read the coordinate value and GPS coordinates are split into two tags, one with the coordinates and the other with the reference direction (N/S/E/W/Above/Below sea level). So any coordinates in the Southern or Western hemisphere are always returned as if they were Northern/Eastern hemisphere.

Beyond that, metadata in PNG files has poor support across the board. EXIF metadata standard for PNG files is now nearly 8 years old there are still many programs that do not read metadata in PNG files.
"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

mho

Wow, that already solved my problem. I did switch to JPG and now everything works fine.
Feeling a bit stupid for not thinking about that before...

Anyway, thanks a lot! Very kind!

StarGeek

Quote from: mho on Today at 04:36:44 AMFeeling a bit stupid for not thinking about that before...

Oh, there's no reason to feel stupid. Metadata is a complete mess with multiple standards (see xkcd Standards), where some companies ignore the standards to make up their own tags (see comments on XMP-acdsee tags), making it nearly impossible for everything to be supported. It has taken literally over a decade for me to figure out as much as I have.
"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