Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[export]: Batch export with multiple presets #18047

Merged
merged 8 commits into from
Jan 22, 2025

Conversation

zisoft
Copy link
Collaborator

@zisoft zisoft commented Dec 23, 2024

In a previous life I have used Capture One as my photography workflow software :)

Capture One has a very good concept for exporting images in multiple formats, called export recipes. An export recipe specifies all parameters for the target file: Format, quality, size, filename, ...
To export you simply check all recipes you need, start the export and all files are created in one run.

In darktable, an export preset is exactly the same as an export recipe in Capture One. The only thing missing is a way to tell the export to use multiple presets in one export run.

I made some thoughts on this and implemented this solution:

The export module gets a new collapsible section batch presets:

Bildschirmfoto 2024-12-23 um 11 07 30

In this section all available export presets are listed:

Bildschirmfoto 2024-12-23 um 11 08 12

Select the ones you need:

Bildschirmfoto 2024-12-23 um 11 08 27

Once at least one of the presets is selected the export button gets renamed to batch export. This is to clearly indicate that the selected presets will be used for export even if the collapsible section is closed.

Hit the export button and all jobs will be processed.

The settings are saved in the preferences.

@ralfbrown ralfbrown added feature: enhancement current features to improve scope: UI user interface and interactions scope: image processing correcting pixels labels Dec 23, 2024
@TurboGit TurboGit added this to the 5.2 milestone Dec 23, 2024
@TurboGit
Copy link
Member

Sounds like a nice addition to darktable. A question, will the export to Piwigo (so with authentication) works in the batch presets?

@TurboGit TurboGit added documentation-pending a documentation work is required release notes: pending labels Dec 23, 2024
@zisoft
Copy link
Collaborator Author

zisoft commented Dec 23, 2024

will the export to Piwigo (so with authentication) works in the batch presets?

Yes, I have tested Piwigo and it works. You must be logged in first.

@TurboGit
Copy link
Member

You must be logged in first.

You mean before each time you export? Would be nice to do the automatic login when such a preset is selected?

@zisoft
Copy link
Collaborator Author

zisoft commented Dec 23, 2024

Sensitive data (server, user credentials) are not saved in the Piwigo presets. That information is saved in the password storage modules.

@TurboGit
Copy link
Member

Sensitive data (server, user credentials) are not saved in the Piwigo presets. That information is saved in the password storage modules.

Sure, but I'm wondering if we could somehow do that login automatically as the user do when he just click on [login] button in Piwigo. Probably hard, we would need some kind of proxy and a data in the preset saying this preset needs login with the id of the credential...

@zisoft
Copy link
Collaborator Author

zisoft commented Dec 23, 2024

Would be really nice, fully agreed. I will try some things and see.

@rgr59
Copy link

rgr59 commented Dec 23, 2024

I also had a previous life where I used Capture One, and the multi-export is maybe the only functionality I missed sometimes after switching to darktable. So this sounds very nice!

Some thoughts with respect to the UI: maybe it can be considered to separate the batch export a little more from the current export, making it kind of a "submodule" of the export module in the following way:

  • move the collapsible section to the end of the export module, after the current Export button
  • rename it to "batch export" (or similar)
  • in the collapsible section, after the list with the presets, add an additional Export button exclusively for the batch export

The current Export button then would, as now, always export the image using the settings of the module for export, regardless whether they originated from a preset or by manual input.

Aside from the better separation, an advantage would be that you can keep the presets selected when, in between batch exports, you want to "normally" export an image.

But the proposed UI is not bad either ;-)

@zisoft
Copy link
Collaborator Author

zisoft commented Dec 24, 2024

@TurboGit: I found a way to automatically login to piwigo, which is indeed extremely comfortable.
This is done by exposing an optional function login() to the storage API. This can then be called by the export module for all storages which require authentication (Piwigo is the only one at the moment).

The last commit modifies the GUI according to the proposal of @rgr59. The functionality is indeed better because the batch export settings can now be left as set and used when required. The normal export button keeps its original functionality.

batch export section collapsed:

Bildschirmfoto 2024-12-24 um 09 28 34

expanded:

Bildschirmfoto 2024-12-24 um 09 28 50

@TurboGit
Copy link
Member

I think we'll have to find some other name as two [export] button feels confusing to me.

Of course the second one could be called [batch export] but then we need some other name for the section title.

I don't have a good proposal for now.

@zisoft
Copy link
Collaborator Author

zisoft commented Dec 24, 2024

The section is called batch export
How about a simple [run] for the button?

@rgr59
Copy link

rgr59 commented Dec 24, 2024

[run] is good, or maybe [start] ...

@TurboGit
Copy link
Member

TurboGit commented Dec 29, 2024

Yep, the button could be [start] or [launch], I'm not fond of [run] (but I'm not an English speaker).

@victoryforce
Copy link
Collaborator

We call something a batch when we perform a sequence of actions in one run. So in a sense, exporting many selected images instead of the one we are currently editing is also a batch export.

In my opinion, exporting, say, one image but with different presets is no more of a batch export than exporting many images with the same set of settings.

So I suggest not using the word batch for this new functionality. Let's call it a multi-preset export.

I think we'll have to find some other name as two [export] button feels confusing to me.

If there is anything confusing here, it is the same name of the module and the label of the button that starts the export process. Everyone is used to this by now, but the label could be changed to start export for easier perception.

As for the two export start buttons being named the same, I don't find it confusing. While the multi-preset section is collapsed, the second button is not visible at all. The user who expanded the section works with it and understands that it is necessary to press the start button from this section.

@zisoft
Copy link
Collaborator Author

zisoft commented Dec 30, 2024

Rebased and force-pushed.
Next screenshot according to @victoryforce proposal:

Bildschirmfoto 2024-12-30 um 14 13 08

@rgr59
Copy link

rgr59 commented Jan 12, 2025

I played a little with this PR (commit 56e6adb from zisoft repository) and think I found a little glitch.

For each preset of the export module, a line is written into darktablerc to indicate it's selection state:
plugins/lighttable/export/=/FALSE/TRUE

But these lines don't get removed if a preset is deleted:

  • have some presets for export module, they are shown in the multe-preset export selection box
  • delete one preset via the hamburger menu
  • the preset immediately vanishes from the selection box (OK)
  • stop darktable
  • the line referencing this preset in darktablerc is still there
    After the next darktable start, the deleted preset is not shown in the selection box, so gets filtered out somewhere (OK)

On the other hand, if you stop darktable, delete a line for an existing preset in darktablerc and start darktable again, the preset is presented in the selection box nevertheless. Which makes me wonder why non selected presets are written into darktablerc at all.

All this does not harm the functionality, people not looking into darktablerc will not notice it.

@zisoft
Copy link
Collaborator Author

zisoft commented Jan 12, 2025

@rgr59: Good catch!

I now take care on renamed or deleted presets. The corresponding config entry is now deleted so we don't have zombie entries in darktablerc.

@zisoft zisoft force-pushed the batch-export branch 2 times, most recently from e8337a9 to 1e00af0 Compare January 12, 2025 15:15
@TurboGit
Copy link
Member

@zisoft : Need a conflict resolution.

Wondering if we cannot now auto log when using a Piwigo preset? Maybe not part of this PR but another one. Do you think it would be possible and desirable?

@zisoft
Copy link
Collaborator Author

zisoft commented Jan 22, 2025

rebased and resolved.

Wondering if we cannot now auto log when using a Piwigo preset? Maybe not part of this PR but another one. Do you think it would be possible and desirable?

Sounds convenient, I will think about this!

@TurboGit
Copy link
Member

@zisoft :
There is one issue, I have created two presets one exporting on disk-jpg and the other on-disk webp, pressing [start export] I get:

image

Looks like the login proxy added for Piwigo is called even when not needed.

@zisoft
Copy link
Collaborator Author

zisoft commented Jan 22, 2025

Did you set the password storage in the preferences? This is required to retrieve the credentials.

EDIT: Oh, you didn't choose a Piwigo export here? I will take a look.

@TurboGit
Copy link
Member

EDIT: Oh, you didn't choose a Piwigo export here? I will take a look.

Indeed :) I cannot log to my disk :)

Add an optional function `login()` to the storage api. This allows
the export module to automatically login for storages which require
authentication (Piwigo).
Keep the multi-preset export section completely separate from the other
export settings. This has the advantage that the multi-preset export
settings can always remain set, which is saved in the darktable
preferences.
If a preset is renamed or deleted, the corresponding config entry is
deleted, so we don't have zombie entries in dt config.
@zisoft
Copy link
Collaborator Author

zisoft commented Jan 22, 2025

Should be fixed now.

Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me now, thanks!

@TurboGit TurboGit merged commit dea4ed4 into darktable-org:master Jan 22, 2025
6 checks passed
@zisoft zisoft deleted the batch-export branch January 22, 2025 20:55
@zisoft
Copy link
Collaborator Author

zisoft commented Jan 22, 2025

Release notes:

The export module has got a new section multi-preset export which allows to export the selected images with multiple presets in one single export run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-pending a documentation work is required feature: enhancement current features to improve release notes: pending scope: image processing correcting pixels scope: UI user interface and interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants