plug-ins: Try harder to export an image from darktable

Before there wouldn't be any intermediate file being written when
darktable sees more than one XMP file. Now the first image in its
temporary database gets exported.
This commit is contained in:
Tobias Ellinghaus 2016-04-25 15:34:36 +02:00
parent eca44cc87d
commit 9888824730
No known key found for this signature in database
GPG Key ID: 98D42E5ACB5448E8
1 changed files with 3 additions and 2 deletions

View File

@ -43,8 +43,8 @@ local export_filename = dt.preferences.read("export_on_exit", "export_filename",
dt.register_event("exit", function()
-- safegurad against someone using this with their library containing 50k images
if #dt.database > 1 then
dt.print_error("too many images, not exporting")
return
dt.print_error("too many images, only exporting the first")
-- return
end
-- change the view first to force writing of the history stack
@ -57,6 +57,7 @@ dt.register_event("exit", function()
for _, image in ipairs(dt.database) do
dt.print_error("exporting `"..tostring(image).."' to `"..export_filename.."'")
format:write_image(image, export_filename)
break -- only export one image. see above for the reason
end
end)