<Solved>Bulk Import - Add to Library - only Raw files

My Storage hierarchy

A6300 - Root
---------Date wise Sub folders - Raw Files
-------------------darktable_exported - sub folder under date wise sub folders All Heic, tiff, png files

I want to import - add to library this tree adding only the raw files.

if I select the root A6300 folder and tick recursive directory and ignore jpegs it adds all Heic and tiffs and png files.

is there a way to only import first level directory or to ignore all files except raw files

no, recursive is recursive not just one level

Why not able to select multiple directories

Perhaps that would get too complicated when you also want to allow selection of individual files?

But, darktable has tags for the image format that are automatically set. With those, you can select all non-raw files after import, and that selection works over all directories/film rolls (in the “collections” module, select “tag” from the dropdown just below the module title, then look under the ‘darktable’ tag, ‘format’)

because nobody had that usecase in mind and invested the effort to implement that.
You might file a feature request for that: Sign in to GitHub ¡ GitHub

Not sure, but maybe the input_filters and input_filter_manager can do this with a bit of scripting, see GitHub - darktable-org/lua-scripts.

1 Like

Thanks a lot probably this will solve my problems.

The reason I want this is because the latest git builds after darktable 3.9.0+1362~ga1de270c4 will not update the library.db and I am getting this error “database `library.db’ couldn’t be upgraded from version 35 to 36. aborting” and I want to recreate the library.db.

If there is any other solution outside of darktable I am open to it.

Thanks

If you just want to rebuild the library then something like find Photos/ -iname *.cr2 -exec darktable {} \; might work.

I have modified the import_filters.lua script as follows

-- ignore jpeg
dt.register_import_filter("only raw", function(event, images)
  dt.print_error("ignoring all jpegs")
  for i, img in ipairs(images) do
    local extension = img:match("[^.]*$"):upper()
    if (extension == "HEIC") or (extension == "PNG") or (extension == "JPG") or (extension == "JPEG") or (extension == "TIFF") or (extension == "TIF") then
      images[i] = nil
    end
  end
end)

in import dialog I select this filter only tic recursive directory but it shows all the files including pngs and heic and tiff

I built darktable yesterday evening, and build pretty much daily. I never had an issue. I think you should file a bug report.

The above lua script works when you actually press the add to library button. So when you select the directory it will show you all the files including jpg,heic,png,tif etc but when you press the add to library button only the raw files are addedd.

Thanks to all specially @chris who pointed me to the lua script