[graphics/digikam] /: apply only correlated coordinates to the images

Maik Qualmann <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 9a01f13652d34d6e79f806fb444ae82d8a7f635b by Maik Qualmann.
Committed on 25/07/2026 at 19:00.
Pushed by mqualmann into branch 'master'.

apply only correlated coordinates to the images
BUGS: 523476
FIXED-IN: 9.2.0

M  +1    -1    NEWS
M  +29   -26   core/utilities/geolocation/geoiface/correlator/gpscorrelatorwidget.cpp

https://invent.kde.org/graphics/digikam/-/commit/9a01f13652d34d6e79f806fb444ae82d8a7f635b

diff --git a/NEWS b/NEWS
index 553162cc00..c2212b13c9 100644
--- a/NEWS
+++ b/NEWS
@@ -54,7 +54,7 @@ BUGFIXES:
 029 --> 485654 - Product Hangs when Trying to apply Geolocations.
 030 --> 519108 - Moving multiple tags into a hierarchy causes crash.
 031 --> 523455 - Delete duplicates button stays greyed out in duplicates tool.
-032 --> 
+032 --> 523476 - GPS Correlator removes GPS data when no correlation found.
 033 --> 
 034 --> 
 035 --> 
diff --git a/core/utilities/geolocation/geoiface/correlator/gpscorrelatorwidget.cpp b/core/utilities/geolocation/geoiface/correlator/gpscorrelatorwidget.cpp
index 52399ef6dc..a75016ae1f 100644
--- a/core/utilities/geolocation/geoiface/correlator/gpscorrelatorwidget.cpp
+++ b/core/utilities/geolocation/geoiface/correlator/gpscorrelatorwidget.cpp
@@ -443,42 +443,45 @@ void GPSCorrelatorWidget::slotItemsCorrelated(const Digikam::TrackCorrelator::Co
             GPSDataContainer newData;
             newData.setCoordinates(itemCorrelation.coordinates);
 
-            if (itemCorrelation.nSatellites >= 0)
+            if (newData.hasCoordinates())
             {
-                newData.setNSatellites(itemCorrelation.nSatellites);
-            }
+                if (itemCorrelation.nSatellites >= 0)
+                {
+                    newData.setNSatellites(itemCorrelation.nSatellites);
+                }
 
-            // if hDop is available, use it
+                // if hDop is available, use it
 
-            if (itemCorrelation.hDop >= 0)
-            {
-                newData.setDop(itemCorrelation.hDop);
-            }
+                if (itemCorrelation.hDop >= 0)
+                {
+                    newData.setDop(itemCorrelation.hDop);
+                }
 
-            // but if pDop is available, prefer pDop over hDop
+                // but if pDop is available, prefer pDop over hDop
 
-            if (itemCorrelation.pDop >= 0)
-            {
-                newData.setDop(itemCorrelation.pDop);
-            }
+                if (itemCorrelation.pDop >= 0)
+                {
+                    newData.setDop(itemCorrelation.pDop);
+                }
 
-            if (itemCorrelation.fixType >= 0)
-            {
-                newData.setFixType(itemCorrelation.fixType);
-            }
+                if (itemCorrelation.fixType >= 0)
+                {
+                    newData.setFixType(itemCorrelation.fixType);
+                }
 
-            if (itemCorrelation.speed >= 0)
-            {
-                newData.setSpeed(itemCorrelation.speed);
-            }
+                if (itemCorrelation.speed >= 0)
+                {
+                    newData.setSpeed(itemCorrelation.speed);
+                }
 
-            GPSUndoCommand::UndoInfo undoInfo(itemIndex);
-            undoInfo.readOldDataFromItem(imageItem);
+                GPSUndoCommand::UndoInfo undoInfo(itemIndex);
+                undoInfo.readOldDataFromItem(imageItem);
 
-            imageItem->setGPSData(newData);
-            undoInfo.readNewDataFromItem(imageItem);
+                imageItem->setGPSData(newData);
+                undoInfo.readNewDataFromItem(imageItem);
 
-            d->correlationUndoCommand->addUndoInfo(undoInfo);
+                d->correlationUndoCommand->addUndoInfo(undoInfo);
+            }
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.