Bug 189413 - Images without GPS-data are shown on the equator in the geolocation-view
Summary: Images without GPS-data are shown on the equator in the geolocation-view
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Geolocation-Engine (show other bugs)
Version: 0.10.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-11 22:56 UTC by Michael G. Hansen
Modified: 2017-08-19 06:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael G. Hansen 2009-04-11 22:56:44 UTC
Version:           0.10.0 (using KDE 4.2.2)
OS:                Linux
Installed from:    Debian testing/unstable Packages

When images with GPS-information and without GPS-information are selected at the same time and the "Geolocation"-tab is opened, images without GPS-information are shown on the equator at 0,0. The images with GPS-information are shown correctly.

The right behavior would be not to show the images without GPS-information. When only one image is selected, and the image is without GPS-information, it is not shown on the map, as expected.
Comment 1 Michael G. Hansen 2009-04-12 12:24:41 UTC
The problem is a missing check for empty positions in libs/imageproperties/imagepropertiessidebardb.cpp where the list of images to be shown on the map is constructed. The changes below fix it.

--- imagepropertiessidebardb.cpp.original       2009-03-16 16:28:29.000000000 +0100
+++ imagepropertiessidebardb.cpp        2009-04-11 23:34:30.000000000 +0200
@@ -322,15 +322,25 @@
             GPSInfoList list;
             for (ImageInfoList::const_iterator it = d->currentInfos.constBegin(); it != d->currentInfos.constEnd(); ++it)
             {
-                GPSInfo info;
-                info.latitude  = (*it).imagePosition().latitudeNumber();
-                info.longitude = (*it).imagePosition().longitudeNumber();
-                info.altitude  = (*it).imagePosition().altitude();
-                info.dateTime  = (*it).dateTime();
-                info.url       = (*it).fileUrl();
-                list.append(info);
+                if (!(*it).imagePosition().isEmpty())
+                {
+                    GPSInfo info;
+                    info.latitude  = (*it).imagePosition().latitudeNumber();
+                    info.longitude = (*it).imagePosition().longitudeNumber();
+                    info.altitude  = (*it).imagePosition().altitude();
+                    info.dateTime  = (*it).dateTime();
+                    info.url       = (*it).fileUrl();
+                    list.append(info);
+                }
+            }
+            if (list.isEmpty())
+            {
+                m_gpsTab->setCurrentURL();
+            }
+            else
+            {
+                m_gpsTab->setGPSInfoList(list);
             }
-            m_gpsTab->setGPSInfoList(list);

             m_dirtyGpsTab = true;
         }
Comment 2 caulier.gilles 2009-04-12 12:41:32 UTC
SVN commit 952618 by cgilles:

apply patch from Michael G.Hansen
BUG: 189413


 M  +22 -12    imagepropertiessidebardb.cpp  
 M  +2 -2      imagepropertiessidebardb.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=952618