Managing and organizing bracketed shots in darktable

If exiftool was somehow linked into darktable, then we could possibly access it to query exif information in an image. But, exiftool is a perl script, so we’d either have to embed perl in darktable or port the script to Lua.

The EXIF information darktable extracts is just common image info such as

  • datetime taken
  • camera maker
  • camera model
  • lens
  • f/stop
  • focus distance
  • ISO
  • shutter speed
1 Like

We could write a function to do that, but it would still have to call exiftool to get the information.

isnt darktable already linking exiv? why exec out into exiftool then?

exiftool is updated more often (last release 11 days ago) and easier to get data out of (at least for a script). It also seems to track camera firmware releases better and offers fields that exiv2 doesn’t.

The roll and pitch data I referred to above is not available in exiv2 0.27.5 which is current on my system (Ubuntu 22.04). For Ubuntu 24.04 exiv is at 0.27.6. Current exiv2 is at 0.28.7. darktable doesn’t have a requirement for a specific version, it just has to be greater than or equal to 0.27.x.

Having said all of that, there are times that I use exiv2 and spawn it. I’ll look into adding an internal interface to the API.

2 Likes

This is a great idea! I just leaned my camera has Pitch / Roll info in the exif data too.

> exiftool P7110136.ORF | grep Angle
Roll Angle                      : 0.2
Pitch Angle                     : -3.5

You wouldn’t happen to have the script around would you? If not, no problem, I can take a stab at writing my second plugin :joy:

2 Likes

I would be also interested. :wink:

Let me clean it up a little bit and I’ll post it later today

2 Likes

Here’s the script. In the determine_correction() I’ve documented the roll angles and what they correspond to. If your camera works the same way then you’re in business. If it doesn’t, then you’ll have to adjust the sign of the correction returned. If your camera has different axis values, please let me know and I’ll incorporate it into the script.

I’ve added another script that will dump the roll and pitch angles when you hover over an image or select it.

dump_roll_angle.zip (2.2 KB)
auto_straighten.zip (3.1 KB)

2 Likes

Thanks Bill! For some reason I don’t understand why it doesn’t have any effect on my side … :frowning:
Script is starting, exiftool is available, I see the new option in settings, shortcut event is registered, but when the image is loaded in darkroom nothing happens …
What is the variable clean in the event darkroom-image-loaded?

Sometimes the darkroom-image-loaded event fires but the image hasn’t finished loading in darkroom. When clean is set to true the image has finished loading and is safe to use.

Do your raw images have Roll and Pitch angle data?

If you have the dump_roll_angle.lua script running then each time you hover over an image you should see a message with the roll and pitch angle information.

1 Like

I tried it out here and it works like a charm. Thank you so much!

My images were taken with an OM System OM-1 Mk ii camera.

1 Like

Thanks for info. Yes, my raw images have Roll and Pitch angle data (I checked myself with exiftool …)
I’ll give it another try. :slight_smile:

Ok, found the issue: file name and/or path contains spaces and exiftool exits with error (file not found). The fix would be to mark it with double quotes:
local pipe = io.popen(as.exiftool .. " -RollAngle -PitchAngle " .. '"' .. image.path .. PS .. image.filename .. '"')

Now it’s working. Thanks!