I have noticed, that several photos have XMP GPS tags. When I import this photos to digiKam album, digiKam stores invalid coordinates in DB MariaDB [digikam4]> SELECT latitude,latitudeNumber,longitude,longitudeNumber FROM ImagePositions WHERE latitudeNumber>90; +------------------+--------------------+-----------+--------------------+ | latitude | latitudeNumber | longitude | longitudeNumber | +------------------+--------------------+-----------+--------------------+ | NULL | 817.1666666666666 | NULL | 885.6166666666667 | | NULL | 773.9166666666666 | NULL | 988.2666666666667 | | 266,38.00000000N | 266.6333333333333 | NULL | 1455.2833333333333 | | 267,16.00000000N | 267.26666666666665 | NULL | 1459.9333333333334 | | NULL | 785.0666666666667 | NULL | 981.0666666666667 | +------------------+--------------------+-----------+--------------------+ If I remove XMP GPS coordinates from these photos (exiv2 -v -M 'del Xmp.exif.GPSLongitude' -M 'del Xmp.exif.GPSLatitude') digiKam read correct GPS info from EXIF tags. Reproducible: Always Actual Results: Photos with XMP GPS tags are not visible in "Map" view and "Map Search" sidepane. digiKam hangs if I try to open Geolocation sidepane for such picture. Expected Results: 1. digiKam should validate coordinates before inserting into DB; 2. digiKam should try to read EXIF GPS coordinates if reading XMP GPS coordinates failed.
Created attachment 82067 [details] Example picture with XMP GPS tags
To prevent accidental hangs of digiKam I've added following trigger to my MySQL DB CREATE TRIGGER `ImagePositions_BINS` BEFORE INSERT ON ImagePositions FOR EACH ROW -- Edit trigger body code below this line. Do not edit lines above this one BEGIN DECLARE msg varchar(255); IF (NEW.latitudeNumber>90 OR NEW.latitudeNumber<-90) THEN SET msg = concat('Latitude out of bounds (', cast(NEW.latitudeNumber AS CHAR), ')'); SIGNAL sqlstate '45000' SET message_text = msg; END IF; IF (NEW.longitudeNumber>180 OR NEW.longitudeNumber<-180) THEN SET msg = concat('Longitude out of bounds (', cast(NEW.longitudeNumber AS CHAR), ')'); SIGNAL sqlstate '45000' SET message_text = msg; END IF; END And similar trigger for BEFORE UPDATE. Unfortunately, MariaDB does not support CHECK CONSTRAINT unlike SQLite. I suppose checks for valid coords should be added to standart DB schema.
digiKam 3.5.0 is out. Can you give a fresh feedback about your report ? Crash still reproducible ? Thanks in advance Gilles Caulier
I can still reproduce this bug with digiKam 3.5.0 and sample picture that I have provided before ("Example picture with XMP GPS tags").
digiKam 4.0.0 is out : http://www.digikam.org/node/713 Please check if this entry still valid with this new version. Thanks in advance Gilles Caulier
Following comment #4, i close this file now... Gilles Caulier