I use Darktable to manage my personal picture collection. During one of my travels, something went wrong with the timezones, and I spent a couple of days fixing that by modifying the date/time in Darktable geotagging. Darktable saves this date/time in a .xmp sidecar file in this format: `picture123.jpg.xmp` under `exif:DateTimeOriginal`. Sadly, -as far as I can find- there is no easy way to just write this metadata to the original file within Darktable.
For renaming, sorting, etc., I would like to copy this `xmp:DateTimeOriginal` to the `DateTimeTaken` and `DateTimeCreated` tags of the original .jpg file.
I have been trying different exiftool commands to try to achieve this, but since this tool is so powerful, I have a hard time finding the right way forward. Plus I strongly fear that I will eventually screw up my photo collection. (I do have back-ups, just in case)
Can someone help me defining a command that can copy over the exif:DateTimeOriginal from the [name].jpg.xmp to DateTimeTaken and DateTimeCreated in the original [name].jpg ?
The closest I could come for now is running these commands after each other:
exiftool -tagsfromfile .\DSCN0709.JPG.xmp -xmp:all .\DSCN0709.JPG
exiftool "-AllDates<xmp:DateTimeOriginal" .\DSCN0709.JPG
exiftool "-FileCreateDate<xmp:DateTimeOriginal" .\DSCN0709.JPG
However, when I try to adjust these to run all files in a directory, I mostly get lots of errors.
Your help is greatly appreciated.
You need to find the ExifTool tag names corresponding to what you are calling DateTimeTaken and DateTimeCreated. See FAQ 2 (https://exiftool.org/faq.html#Q2) for this. Then copy xmp:DateTimeOriginal to these tags.
If you get errors then there are likely format problems with the files, but I can't say anything more without knowing the specific errors. But I'm guessing they were warnings, not errors.
- Phil
You might also try the xmp2exif.args file (https://raw.githubusercontent.com/exiftool/exiftool/master/arg_files/xmp2exif.args) to copy the data, as it will translate the XMP tags to the corresponding EXIF tags. Save that file into the same directory as exiftool or remember the path if you save it somewhere else.
Just verifying, the XMP files include the JPG extension? Most other programs that use XMP sidecar files drop the extension.
Your command would be something like
exiftool -TagsFromFile %d%f.%e.xmp -@ xmp2exif.args /path/to/files/