[Kde-imaging] [Bug 140297] GPS kipi plugin truncates input coordinates, introducing inacuracy
Gilles Caulier
caulier.gilles at gmail.com
Wed Mar 14 13:11:41 CET 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=140297
caulier.gilles gmail com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles gmail com 2007-03-14 13:11 -------
SVN commit 642431 by cgilles:
libkexiv2 from trunk : patch from Arnd Baecker about to avoid the GPS accuracy loss
BUG: 140297
M +6 -6 kexiv2.cpp
--- trunk/extragear/libs/libkexiv2/kexiv2.cpp #642430:642431
@ -1602,11 +1602,11 @
// as the sign is encoded in LatRef.
// Further note: original code did not translate between
// dd.dddddd to dd mm.mm - that's why we now multiply
- // by 6000 - x60 to get minutes, x100 to get to mmmm/100.
+ // by 6000 - x60 to get minutes, x1000000 to get to mmmm/1000000.
value = Exiv2::Value::create(Exiv2::signedRational);
deg = (int)floor(fabs(latitude)); // Slice off after decimal.
- min = (int)floor((fabs(latitude) - floor(fabs(latitude))) * 6000);
- snprintf(scratchBuf, 100, "%ld/1 %ld/100 0/1", deg, min);
+ min = (int)floor((fabs(latitude) - floor(fabs(latitude))) * 60000000);
+ snprintf(scratchBuf, 100, "%ld/1 %ld/1000000 0/1", deg, min);
value->read(scratchBuf);
d->exifMetadata.add(Exiv2::ExifKey("Exif.GPSInfo.GPSLatitude"), value.get());
@ -1639,11 +1639,11 @
// as the sign is encoded in LongRef.
// Further note: original code did not translate between
// dd.dddddd to dd mm.mm - that's why we now multiply
- // by 6000 - x60 to get minutes, x100 to get to mmmm/100.
+ // by 6000 - x60 to get minutes, x1000000 to get to mmmm/1000000.
value = Exiv2::Value::create(Exiv2::signedRational);
deg = (int)floor(fabs(longitude)); // Slice off after decimal.
- min = (int)floor((fabs(longitude) - floor(fabs(longitude))) * 6000);
- snprintf(scratchBuf, 100, "%ld/1 %ld/100 0/1", deg, min);
+ min = (int)floor((fabs(longitude) - floor(fabs(longitude))) * 60000000);
+ snprintf(scratchBuf, 100, "%ld/1 %ld/1000000 0/1", deg, min);
value->read(scratchBuf);
d->exifMetadata.add(Exiv2::ExifKey("Exif.GPSInfo.GPSLongitude"), value.get());
More information about the Kde-imaging
mailing list