image icon indicating copy to clipboard operation
image copied to clipboard

How to set GPS related exif tags?

Open Flajt opened this issue 6 months ago • 4 comments

Hello, first of all, a nice package for the exif-related parts of images (I'm dying to try and save a small amount of data).

I want to save a GPSLongitude & GPSLatitude tag in my jpg file.

However, I can't get it to work:

I tried:

// with and without toString()
image.exif.gpsIfd[0x0002] = locationModel.latitude.toString();
image.exif.gpsIfd[0x0004] = locationModel.longitude.toString();

// Also for latitude ofc
image.exif.gpsIfd["GPSLongitude"] = locationModel.longitude.toString();

// With the imageIfd
image.exif.imgIfd["GPSLongitude"] = locationModel.longitude.toString();

// With the imageIfd and hex value
image.imageifd.gpsIfd[0x0004] = locationModel.longitude.toString();

The GPSOffset is being calculated an added, but not my Coordinates : /

Here a the map containg the data that is added (I anonymized some stuff):

{271: Apple, 272: iPhone ****, 282: 72/1, 283: 72/1, 296: 2, 305: Decentproof 1.0.0, 306: ****, 316: iPhone ****, 34665: 236, 37510: <data>, 34853: 2264}

The gpsIfd is just empty.

I've considered forking and extending the setters like userComment etc. but idk if that would resolve it. Since I'm not yet 100% understanding the codebase.

Flajt avatar Aug 25 '24 16:08 Flajt