Geotagging in digiKam with a Lazy Bash Script

(system) #1

Geotagging in digiKam with a Lazy Bash Script

Sometimes, the easiest way to geotag photos in digiKam is to copy and paste geographical coordinates from an existing photo. I usually use Google Photos for that, as it conveniently displays geographical coordinates of the currently viewed photos in the information sidebar.

There is only one problem with this technique: copying and pasting the geographical coordinates directly doesn't work.

Continue reading

This is a companion discussion topic for the original entry at


Hello @dmpop

Thanks for sharing the script.
I am wondering if that would be easy to convert these to the format that digiKam accepts:


I guess I should modify this part in order to make it work for me: -o | tr -d ’ ’

'#!/bin/bash latlon=“geo:”$(xclip -o | tr -d ’ ')
notify-send $latlon -i info
xclip -selection c

(Dmitri Popov) #3

Changing xclip -o | tr -d ' ' to xclip -o | tr -d '-' should do the trick.



I could not figure out how to use tr and rewrote the script

#!/usr/bin/env bash
clipboard_original="$(xclip -o)"
echo "$clipboard_for_digikam_geo" | xclip -selection c

This one converts GPS coordinates copied from mediainfo / ffmpeg output to the format that digiKam Geolocation Editor accepts