Skipping an image from 'store' function of darktable.register_storage

Hi.

I’d like to skip some images (e.g. if already stored) from “store” function in darktable.register_storage.
I use darktable.register_storage in a lua script to export my customized album and the most of time is to save from .raw to new format (e.g. tiff, jpg) through that store function which is automatically called for each image of images table.

How to skip some image in images table?
Regards.

You need to use the initialize part of the storage, darktable lua documentation - darktable.register_storage

Yes, of course.
But what’s the best way to manipulate images table?

In my case, I’d like to preserve the original index of all images in the table.
e.g table.remove changes it, once I remove someone.

Create another table and pass it in extra_data. You can populate the table with the original position…

local image_index = {}
for index, filename in ipairs(image_table) do
  image_index[filename] = index
end

# delete what you want from image_table

Then you can retrieve the original index from image_index[filename]