Image objects are not the same though they are equal in export finalize callback
darktable version: 1.3+1459~ge8cd04c
0. Have the following code in luarc
@dt = require "darktable"
local function export_finalize_callback(storage, image_table)
for image, fn in pairs(image_table) do
for i, img in pairs(image:get_group_members()) do
if img == image then
dt.register_storage("proba", "proba callback", nil, export_finalize_callback)
1. Group several images in lighttable
2. Select them and export using 'proba callback' as the target storage
I have grouped 3 images together and got 4 nils as the output (3 numeric indexes + the 'leader' index returned by
image is the index in the table passed to the callback
img is taken from the table returned by
We refer here to the same images in different 'views':
1. view: the selection of the export
2. view: members of an image group
I expected that these are the same objects. Were these the same object, then the output would be the path of the exported images not nils.
#2 Updated by Jérémy Rosen over 5 years ago
I will have to check, but this one is a complicated one...
I'll fix it before release but it will take different time.
basically you have two lua_image object that represent the same image on the C side of thing
This is supposed to be invisible to you, and the reports the object as being the same...
however when looking into the table, indexing doesn't take into account, so it doesn't work.
I'll have to rework stuff so that it works properly. it's not trivial
#3 Updated by Attila Gróf over 5 years ago
- Assignee deleted (
Here is a simple workaround. It is dependent on the fact that the different lua image objects are still equal for '
local function lookup_the_right_image_object(img, exported_images) local image, fn for image, fn in pairs(exported_images) do if img == image then return image end end return nil end