William Ferguson (2019-May-16, excerpt):
> Lets try removing the image from the database, then importing it to
> see if that forces a sidecar load.

Okay, trying this.  How do I delete an image from the database?
Searching for `delete` yields [1] then [2].  I really find darktable's
Lua documentation frustratingly sparse.

I've ended with this:

    for _, i in pairs(dt.gui.action_images) do
        [...]
            if (os.execute(cmd)) then
                local path = tostring(i) -- why not a field in `i`?
                i:delete()
                dt.database.import(path)
            end
        [...]
    end        

Works.  But there are downsides:

  * It works more often than not, but sometimes the images disappear
    completely, or are replaced by a skull (although still present the
    file system, DT insists on "not available").  Cannot reliably
    reproduce.  Why?

  * All images get a new image ID, and probably as a consequence,

  * the selection of images is lost (meaning: deselected).
  
Is there any smart way to reload an XMP file?

Cheers
Stefan

____________________
[1] https://www.darktable.org/lua-api/index.html#d0e4845
[2] 
https://www.darktable.org/lua-api/types_dt_lua_image_t.html#types_dt_lua_image_t_delete


-- 
http://stefan-klinger.de                                        o/X
I prefer receiving plain text messages, not exceeding 32kB.     /\/
                                                                  \
____________________________________________________________________________
darktable user mailing list
to unsubscribe send a mail to [email protected]

Reply via email to