Why does DT XMP contain exif:DateTimeOriginal?

Issue: When importing images that do not have an EXIF “DateTimeOriginal” set, the XMP sidecar that is created has a blank field: exif:DateTimeOriginal=" ".

I really don’t understand this. XMP files don’t contain any exif entries, except for the DateTimeOriginal. (Open an XMP that DT creates, and you’ll find this on line 9.)

The issue is that there are zero tools which can edit the XMP file’s entry for exif:DateTimeOriginal, only the exif data’s DateTimeOriginal itself. So using ExifTool, Digikam, etc., I can update the exif data for DateTimeOriginal, but because the XMP has already been created with that field blank, DT does not respect this update, and there’s no way to change it short of opening each XMP with a text editor.

I would just delete all the XMPs, but those have ratings, edits, etc.

Steps for Reproduction:

  1. Remove DateTimeOriginal information from JPG.
  2. Import into DT.
  3. XMP files will be created. Open XMP. Line 9 will have the entry exif:DateTimeOriginal=" ".

exiftool -DateTimeOriginal="2021:09:03 10:08:00" -overwrite_original -ext xmp /media/user/raw-1/0-discarded/test.xmp

does the job with this example xmp :
test.xmp (7.4 KB)
Execute this command after you stopped dt. Otherwise dt will overwrite your modified xmp with the content of it’s database.
And select Preferences → storage → look for updated xmp files on startup before you launch dt again.

1 Like

Interesting, thanks for the command. I’ve been using ExifToolGUI and it won’t allow editing XMP DateTimeOriginal, for some reason. Same with Digikam. But good to have this as a solid method.

Any reason for DT to copy that exif line over? It doesn’t copy anything else – seems kind of strange, especially because it seems like no other program uses it. (Indeed, no other program gives much to acknowledge it. Digikam can show it in a modified XMP metadata view, but won’t allow you to edit it.)

I stopped using this tool years ago because it has several limitations. The much better way is to use exiftool from the command line.
See darktable 3.7 (development) user manual - sidecar files for a description of the idea behind dt’s sidecar files.

There is a “refresh exif” button darktable 3.6 user manual - selected images

Can be an issue or not. Could you check if this field is not on your original image file ? by the command:
exiv2 -PEIX imagefilename | grep DateTimeOriginal
If there is no such field that may be an issue and you could open an issue here.

You could also set the date in dt with the geotagging module. Would that be a valid workaround ?