Darktable: Export with the capture date of the original

Created on 30 Mar 2019  路  28Comments  路  Source: darktable-org/darktable

I didn't find any hint if it is possible to export DT pictures with the original capture date so I assume this feature is missing here.

Date helps to keep photos nicely sorted. If all exports have the same (today) date it's not just confusing but also misleading as "correct" the new data format is, because just exported...

Most helpful comment

I agree johans3, this is terrible, it is no fun and was removed by a PR proposed here. This game has been put back and I have suffered it this morning while I had to develop some picture to send to a friend.

Since this cannot be removed as we can't find an agreement among devs, I'll add a pref to kill this game forever. At least choice will be given to the users.

All 28 comments

Be careful to keep in mind that you have 2 dates : file date and exif infos. File date is the date when you export your files and exif infos keep the capture date. On all jpg images I have exported from dt, I have the correct date. Be sure to use an image viewer (or explorer software) that could see exif infos embedded on the image.

You're right to repeat it here, and I considered that point too.

I know about creation date and capture date, I wrote it on purpose, no problem. Usually browsers offer to inspect metadata but sorting through metadata isn't supported everywhere. And most of the time software considers as creation date the time when we downloaded pictures from our camera to our computer.

Wouldn't be nice to export pictures having their original date on it? :)
Any other date is "relatively" uninteresting and more a detail, imo. Just another "creation date" from another software.. So to say.

Use cases can be different - for example if you export several versions of the same photo it may be useful to know when each export was made. I'm not sure if dt adds it to EXIF somewhere. In any case in my opinion exported file is a separate entity from original raw image and it should have file modification date set to the date when it was exported. Time and date when picture was taken is a metadata, so it's correctly placed in EXIF. So I would say this feature doesn't belong into the dt core, someone just should write a lua script that modifies mtime after file is exported.

OK. Mostly I export files when I'm happy with my editing. Most multiples are trashed. Anyway retouching isn't limited to repair photos as good pictures are playground for varieties.

If Lua is not more experimental, then welcome.
Anyway how are we supposed to run this scripts? Didn't see any script menu yet to collect/run said scripts.

Use cases can be different - for example if you export several versions of the same photo it may be useful to know when each export was made. I'm not sure if dt adds it to EXIF somewhere.

Like other well-behaved software, it adds it to tag 0x0132 - "Modify Date". This will generally be the same as the filesystem modification time upon export.

@johans3 The following Lua script will copy the filesystem dates from the original file to the exported one, if that's what you want (works on Linux, needs to be modified for other platforms):

local dt = require "darktable"

dt.register_event("intermediate-export-image",
  function (event, image, filename, format, storage)
      os.execute("touch -r "..image.path.."/"..image.filename.." "..filename)
  end
)

See here for more information about how to use Lua with darktable.

@junkyardsparkle

I don't know about lua but this script seems coded to work out of the box. Mac is Unix and I use touch like you when I wanna modify file date.

After putting your script with suffix *.lua into home/.config/darktable/
I tried to export an edited pic. Should have worked but date hasn't changed unfortunately. I'll read again the link you added

Terrible things happen if I add a folder "lua" inside the path above...DT starts up with a disgusting game.

Edit. Added a luarc file in the path above with: require "ExportCapture date" and created a lua directory in: home/.config/ where I put your script
Again, nothing.

Terrible things happen if I add a folder "lua" inside the path above...DT starts up with a disgusting game.

  • It's not terrible
  • It has nothing to do with the lua folder
  • It only happens once per year
  • Enjoy

Such an Easter egg isn't needed in serious software and has nothing to do with DT.

More than fun it's an unexpected behaviour (we see already enough bugs or harmful stuff around this days - even in proprietary software)

Edit. Even after placing the lua directory (with script inside of course) back in home/.config/darktable/
the date of exported pics don't change

I agree johans3, this is terrible, it is no fun and was removed by a PR proposed here. This game has been put back and I have suffered it this morning while I had to develop some picture to send to a friend.

Since this cannot be removed as we can't find an agreement among devs, I'll add a pref to kill this game forever. At least choice will be given to the users.

I agree with TurboGit and johans3. When I first got this game, I struggled to manage to get out of it, it was a terrible experience.

Yup, there is no way to shut down that goddam game except by changing the system date, not even a hint in the screen with a shortcut to close it. This is a poor joke, and an annoying one. dt is a photo editor, not a toy.

Just restarting DT works. Also pressing shortcut for view change is a way out - e.g. lower-case L switches to lighttable.

Also pressing shortcut for view change is a way out - e.g. lower-case L switches to lighttable.

Except when the view switches shortcuts have been reassigned to modules because that's where you need shortcuts.

I was so shocked to kill Dt. After that, Dt worked again as expected :D

Anyway I hope this game will be removed in in some way either via preferences or completely

I have just pushed a commit which add a pref to disable this game once for all.

techsupport
All the usual ways to exit darktable work.

We should not have to exit darktable in the first place. A聽tool is not a toy.

I agree with johans3, Turbogit, Rawfiner and aurelienpierre. I like jokes but this one is not even funny. It's just annoying and awful. I was glad to see the PR removing it. I don't know which developer put this easter egg back but it's just a stupid idea. Ok, close it and relaunch darktable or type a shortcut on the keyboard remove it but have you just think of the moment when you're with an important customer this day and you forgot that (or even don't know that) and you launch darktable ?

That's not the place to have such annoying easter egg. Think of pros that use darktable or users that even don't know what this thing is and think that darktable have a quite big bug...

The best recent idea was to remove that easter egg, not put it back...

Most of 'pro' tools have easter eggs, e.g. look at Photoshop or Lightroom. Same as Android, apt, google search or google calendar (today, you can play hidden game in calendar too) and so on.

It's 1st april guys, it's once a year, you should be a bit more positive :)

@theres : that's plain wrong, they have Easter Eggs that you have to find or to trigger. I have never seen an Easter Egg that fire on you and don't let you do your work!

I'm not against easter eggs. I like seeing them when they are really funny and not disturbing. And if they are beautiful, it's better. It's my first 1st april with darktable and this easter egg is just the most awful and annoying I've ever seen.

And sorry but this easter egg is nothing positive. With my day and the days coming I have lot of things that make me smile and laugh, but not this awful easter egg.

And yes, most of easter eggs have to be found, not being forced to the user. Be positive and liking fun things is not the same thing that having an awful thing forced to users...

Even after placing the lua directory (with script inside of course) back in home/.config/darktable/ the date of exported pics don't change

The simplest way of testing the actual code would be to put it directly in the "luarc" file. You can run darktable from a terminal with Lua debugging enabled like this:
darktable -d lua
That might give information about what's failing. There are more sophisticated cross-platform methods for running system commands, but they require installing additional Lua libraries... there are some examples here. Maybe somebody who uses dt on a Mac can give better help. :)

@junkyardsparkle
Finally I put everything in the right order.
Home/.config/darktable/

Here is where I created a file "luarc" to register my *.lua scripts.
The scripts itself were stored in a directory "lua" inside the path above.
Didn't work.
I put your script in the file "luarc" and tested it out. Again nothing.

Edit
After reading information on a German website I installed some necessary dependencies and succeeded!
Scripts run without problem. (Mac )
No need to install lua.

If this feature isn't going to be installed directly I can rely on this lua script.

The script works yes (and thanks for it!) But dates aren't correct as they refer all to 2019. I don't know why but this are topics to discuss in the user forums.

We can close this issue.

I sent the PR to femove the easter egg and was surprised that it was reverted without any discussion nor comment ):

@johans3 The following Lua script will copy the filesystem dates from the original file to the exported one

The previously mentioned script doesn't work when spaces are in the path. This is a corrected version of it:

local dt = require "darktable"

dt.register_event("intermediate-export-image",
  function (event, image, filename, format, storage)
      os.execute("touch -r '"..image.path.."/"..image.filename.."' '"..filename.."'")
  end
)

We can close this issue.

You said that we can close this issue. As it's yours, you could closed it yourself, so please close it. That will help to have only issue to work on. Or @TurboGit

Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GrahamByrnes picture GrahamByrnes  路  3Comments

sboukortt picture sboukortt  路  3Comments

schwerdf picture schwerdf  路  4Comments

bapBardas picture bapBardas  路  6Comments

Egocentrix picture Egocentrix  路  5Comments