Convert Shotwell Photo Metadata to Digikam Metadata
Mostly notes to myself.
Shotwell stores most of its information in a database. Which I lost. Because I'm an idiot.
But a bunch of metadata is also stored in the image's EXIF metadata!
Most importantly is the "Original File Name" which should become the "Description" in DigiKam. Unfortunately, there's no way to copy those values automatically on import.
So here's a one-liner which will read the "Original File Name" and store it in the "Title" EXIF - ready for DigiKam to parse!
Bash
exiftool "-XMP-dc:Title<XMP-getty:OriginalFileName" whatever.jpg
If you want to make sure any existing Title isn't overwritten, use:
Bash
exiftool "-XMP-dc:Title<${XMP-getty:OriginalFileName}" -if "not defined $XMP-dc:Title" whatever.jpg
Finally, to do it recursively, across all files:
Bash
exiftool -r "-XMP-dc:Title<${XMP-getty:OriginalFileName}" -if "not defined $XMP-dc:Title" /path/to/images