| Summary: | GPX files fails to load | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Kristian Karl <kristian.hermann.karl> |
| Component: | Geolocation-Correlator | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | caulier.gilles, metzpinguin, quochungtran1999 |
| Priority: | NOR | ||
| Version First Reported In: | 8.0.0 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/graphics/digikam/commit/d3ce44e9de912b33627235fd910c846599705a19 | Version Fixed/Implemented In: | 8.0.0 |
| Sentry Crash Report: | |||
| Attachments: | test.gpx | ||
|
Description
Kristian Karl
2022-03-22 18:47:36 UTC
I CC the student who provides the PR on Gitlab. Wait and see... Gilles Caulier The track data contains an "extensions" block the first time reading "gpxtpx:TrackPointExtension" the QXmlStreamReader gives an error QXmlStreamReader::UnexpectedElementError.
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:atemp>21</gpxtpx:atemp>
<gpxtpx:hr>97</gpxtpx:hr>
<gpxtpx:cad>77</gpxtpx:cad>
</gpxtpx:TrackPointExtension>
</extensions>
Maik
These elements must be added to the QXmlStreamreader as namespace. Maik The cause is not Comment 3, I leave the task for our student to solve. Is a nice track. Maik Inserting this code after https://invent.kde.org/graphics/digikam/-/blob/master/core/utilities/geolocation/geoiface/tracks/trackreader.cpp#L332 seems to be one solution to the problem. if (xml.name() == QLatin1String("extensions")) { do { xml.readNext(); } while (!(xml.tokenType() == QXmlStreamReader::EndElement && xml.name() == QLatin1String("extensions")) && !xml.hasError()) ; continue; } Also, I don't think this code is used anymore? https://invent.kde.org/graphics/digikam/-/blob/master/core/utilities/geolocation/geoiface/tracks/trackreader.cpp#L147-290 It's certainly a possibility, but there's an easier way. Maik Git commit 6280a012ee10a9e588271568ff17aeaf825a1060 by Maik Qualmann. Committed on 23/03/2022 at 19:53. Pushed by mqualmann into branch 'master'. remove dead code and variables M +18 -201 core/utilities/geolocation/geoiface/tracks/trackreader.cpp M +0 -17 core/utilities/geolocation/geoiface/tracks/trackreader.h https://invent.kde.org/graphics/digikam/commit/6280a012ee10a9e588271568ff17aeaf825a1060 Git commit d3ce44e9de912b33627235fd910c846599705a19 by Maik Qualmann. Committed on 23/03/2022 at 20:00. Pushed by mqualmann into branch 'master'. fix reading child elements FIXED-IN: 8.0.0 M +2 -1 NEWS M +1 -1 core/utilities/geolocation/geoiface/tracks/trackreader.cpp https://invent.kde.org/graphics/digikam/commit/d3ce44e9de912b33627235fd910c846599705a19 I verified the fix this morning. Looks all good now. Thanks Maik :-) Maik, Why not to integrate this GPX file in unit-tests ? Gilles Yes of course we can add it in a small version of the file as unit-test, I do it. Maik Git commit 17dd52d44236204faf6a22fa387591ecc50538fb by Maik Qualmann. Committed on 24/03/2022 at 10:48. Pushed by mqualmann into branch 'master'. add gpx file with child elements to the track unit-test A +78 -0 core/tests/geolocation/geoiface/data/gpx-child-elements.gpx M +17 -7 core/tests/geolocation/geoiface/tracks_utest.cpp https://invent.kde.org/graphics/digikam/commit/17dd52d44236204faf6a22fa387591ecc50538fb |