[Digikam-devel] GPS coordinate accuracy

Andreas Huggel ahuggel at gmx.net
Tue Nov 28 03:47:15 GMT 2006


-------- Original-Nachricht --------
Datum: Mon, 27 Nov 2006 13:48:18 +0100
Von: Gilles Caulier

> On Monday 27 November 2006 13:43, Arnd Baecker wrote:
> >
> > Manual modification:
> > exiv2 -M "set Exif.GPSInfo.GPSLatitude 51/1 14222/10000 0/1 " 
> > IMG_5356test_manip.JPG works fine both in digikam display and the "Edit
> > geographical
> > coordinates" tool.
> > Only on save not enough digits are used ...
> 
> 
> Right Arnd,
> 
> This is relevant of following Exiv2Iface methods :
> 
> - setGPSInfo()
> - convertToRational()
> 
> ... where digits are lost during double to rational conversion.
> 
> http://websvn.kde.org/trunk/extragear/libs/kipi-plugins/common/exiv2iface/exiv2iface.cpp?rev=606701&view=auto
> 
> Andreas, 
> 
> There is method in Exiv2 to do this conversion without lost digits ?
> If i can use it instead Exiv2Iface::convertToRational()...

There is no such method in Exiv2. If you are happy with 7 decimal places, you could use a simple conversion algorithm similar to that in crwimage.cpp, from line 1015; that should just fit into 32 bit unsigned ints. (Search for "primitive conversion" in the file.)

http://dev.robotbattle.com/~cvsuser/cgi-bin/ns_viewcvs.cgi/exiv2/trunk/src/crwimage.cpp?rev=861&view=markup

Regards,
Andreas

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!



More information about the Digikam-devel mailing list