Bug 382646 - XMP sidecar file doesn't contain GPS tags
Summary: XMP sidecar file doesn't contain GPS tags
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Sidecar (show other bugs)
Version: 5.6.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-24 06:32 UTC by Michael
Modified: 2019-08-04 20:37 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0


Attachments
Metadata settings in digiKam (125.16 KB, image/png)
2019-02-21 05:33 UTC, Mark F
Details
Sidecar file written after geocoding the image in digiKam and selecting 'write metadata'. (3.72 KB, application/octet-stream)
2019-02-21 05:34 UTC, Mark F
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2017-07-24 06:32:46 UTC
When I geo-tag my RAW files in digikam using GPX files, digikam doesn't write the GPS location tags into the according XMP sidecar file. The only GPS tag I found is "exif:GPSVersionID".

Michael Zabel
Comment 1 Mark F 2019-02-21 05:33:10 UTC
Created attachment 118243 [details]
Metadata settings in digiKam

I also ran into this. I used digiKam to correlate a GPX track with some NEF files, and then also manually set the coordinates in some of them which weren't in the GPX file's time range. That part worked great. But then when I went to save the GPS info to my files, I found that it isn't supported to write directly to the RAW file, and it also doesn't seem to show up in the XMP sidecar file.

I would like to have the GPS data in my image files for portability. If it's just in digiKam's database, then of course it cannot be used in other apps. I intend to use RawTherapee or Darktable for image adjustments, probably, so finally exporting a JPEG with GPS metadata would happen from them. I also just migrated from LightRoom, so I'm very focused on making sure whatever solution I use next stores all the metadata I care about in the files, not in its own catalog/database.

Thanks in advance for any help, and for writing/sharing digiKam!
Comment 2 Mark F 2019-02-21 05:34:33 UTC
Created attachment 118244 [details]
Sidecar file written after geocoding the image in digiKam and selecting 'write metadata'.
Comment 3 Maik Qualmann 2019-02-21 08:49:14 UTC
I can not confirm the problem anymore. With digiKam compiled against Exiv2-0.27 are also the coordinates in the XMP file available.

Maik
Comment 4 caulier.gilles 2019-02-21 08:52:24 UTC
I also tested with digiKam AppImage bundle version 6.0.0 which is compiled with Exiv2 0.27 and problem cannot be reproduced...

Gilles Caulier
Comment 5 Mark F 2019-02-22 00:38:41 UTC
Thanks Maik and Gilles for looking into this so fast!

Weird that it doesn't happen for you. I was using the AppBundle (digikam-6.0.0-x86-64.appimage), and am on Ubuntu 18.04.2. I originally had the 'write metadata to RAW files' option turned off in digiKam (having followed the recommendation in the setup wizard), but then after I hit 'apply' in the correlator tool and getting an error saying it hadn't written any information, I adjusted the settings to write to XMP sidecars and tried the 'write metadata' menu option (which produced the XMP file attached earlier).


I worked around this by reading the location details from the SQLite db, and then using exiftool (v10.80) to write the values directly to my NEF files:

sqlite3 digikam4.db
sqlite> .headers on
sqlite> .mode csv
sqlite> .output geotags.csv
sqlite> SELECT name, latitudeNumber, longitudeNumber, altitude FROM ImagePositions JOIN Images WHERE Images.id = ImagePositions.imageId;

"""
#!/usr/bin/env python3
import csv
import os
import subprocess

PHOTO_DIR = os.path.join('my', 'photos')

with open('geotags.csv') as geotags_file:
  geotags_reader = csv.DictReader(geotags_file)
  for row in geotags_reader:
    name = row['name']
    lat, lng = float(row['latitudeNumber']), float(row['longitudeNumber'])
    alt = row['altitude']
    print('%s: %s,%s %s' % (name, lat, lng, alt))
    subprocess.check_call([
        'exiftool',
        # https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/GPS.html
        '-GPSLongitude=%s' % abs(lng),
        '-GPSLatitude=%s' % abs(lat),
        '-GPSLongitudeRef=%s' % ('East' if lng > 0 else 'West'),
        '-GPSLatitudeRef=%s' % ('North' if lat > 0 else 'South'),
        '-GPSAltitude=%s' % alt,
        '-GPSAltitudeRef=+',
        os.path.join(PHOTO_DIR, name),
    ])
"""
Comment 6 Maik Qualmann 2019-02-22 08:47:09 UTC
Do you use MySQL? This problem may be related to MySQL and AppImage (Bug 374302). Setting LC_NUMERIC before the AppImage start helps.

Maik
Comment 7 caulier.gilles 2019-02-22 08:51:58 UTC
MAik,

Do you hint me to add LC_NUMERIC in AppImage startup script ?

https://cgit.kde.org/digikam.git/tree/project/bundles/appimage/data/AppRun?h=development/dplugins

Gilles
Comment 8 Maik Qualmann 2019-02-22 18:19:44 UTC
I do not know if we can actually unify it. I have a local MySQL server, the system is set up in German locale (LANG=de_DE.UTF-8). With my native version no problems. When I use the AppImage I have no more coordinates (interpretation for the decimal separator, period or comma). When I start with "LC_NUMERIC=C ./digikam-6.1.0.appimage", all coordinates are present. The question is whether it may cause problems for users with other system locale if it is permanently installed in the AppImage.

Maik
Comment 9 Maik Qualmann 2019-04-17 06:52:16 UTC
*** Bug 406611 has been marked as a duplicate of this bug. ***
Comment 10 Maik Qualmann 2019-04-17 06:52:23 UTC
*** Bug 406612 has been marked as a duplicate of this bug. ***
Comment 11 Maik Qualmann 2019-04-27 05:35:34 UTC
*** Bug 406941 has been marked as a duplicate of this bug. ***
Comment 12 caulier.gilles 2019-07-24 05:44:51 UTC
Hi,

This problem still reproducible using last Linux AppImage bundle 6.2.0 pre release available here : https://files.kde.org/digikam/

Thanks in advance

Gilles Caulier
Comment 13 Kristian 2019-08-04 20:20:18 UTC
I just updated from 6.1.0 to 6.2.0 on Arch Linux and the issue is gone now.
Comment 14 Maik Qualmann 2019-08-04 20:37:31 UTC
Thanks for the feedback. I close the bug now.

Maik