Re: [gexiv2] gexiv2 decimal digits in the GPS tags



On Tue, Oct 20, 2015 at 10:06 PM, Eyal Saiet <ejsaiet alaska edu> wrote:
Thanks for the fast response. I even tried to add zeros:

y_loc=71.3779511370000 ; m.set_gps_info(float(x_loc),float(y_loc),float(z_loc));m.get_gps_latitude()

True 71.37795113694443

 Can I make the conversion myself and write with set_gps_info() in degree, minutes seconds myself?
Do you have any ideas around this? Overall the get_gps_latitude() is very close.
Thanks again.


Yeah it's just a helper function, you can set the exif fields directly
if you want to, but it's a bit of a pain. Here's the code if you want
to see how it works:

https://git.gnome.org/browse/gexiv2/tree/gexiv2/gexiv2-metadata-gps.cpp

Note eg you need to set both "Exif.GPSInfo.GPSLongitude" and
"Exif.GPSInfo.GPSLongitudeRef" together for longitude to work (and
same for latitude).

So for example something like this:

m['Exif.GPSInfo.GPSLongitudeRef'] = 'N'
m['Exif.GPSInfo.GPSLongitude'] = '46/1 5403/100 0/1'

(the degrees, minutes, and seconds are stored as fractions in a
string, if I recall correctly).

I used to do this myself before I found gexiv2 library, I thought
gexiv2 was a dream compared to doing it manually ;-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]