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
Stable gimp-darktable calling interface #16193
Conversation
Does current dt (before this PR) return non-zero exit code when called with --gimp test option? |
Yes. |
When I run this command and exit from darkroom all is ok. If I return to lighttable and then quit darktable I get a crash.
There is not check that file's argument is really an existing file. The above command should be rejected. |
This works:
But I had to look at the code to find the syntax :) Just noting here for the documentation.
|
Alternatively we may want to disable completely switching views when in gimp mode. This would avoid the crash mentioned above and potentially other issues (using map, print view...). If this looks a good option, we need to make |
Thanks for all the input. |
a589378
to
63bebed
Compare
Currently thumb export does not work, not fully sure what gimp folks really want here. |
63bebed
to
c788d73
Compare
Fixed problems related to making view-switch disabled while in gimping mode. @Jehan would you have a look at current API proposal. |
c788d73
to
a5e659e
Compare
@TurboGit would appreciate another round of review :-) Seems good to me except we would want to completely disable logs after merging if in gimp mode. |
Sure! I'm only looking at the MR description, not the code itself. Hope it's fine. :-)
For this first implementation, it will be 0? 1? Something else? Also I'm wondering if On our side, how I see we'll use the algorithm is:
This way, we'll be able to support as many versions of darktable as possible.
It's good and could be enough. Now if possible, there could be some more information returned:
/* the size reported by raw files isn't precise,
* but it should be close enough to get an idea.
*/
Anyway these are the 3 additional (optional) data which our thumbnail procedures can make use of and expose to people in file dialogs. So if you want to stop with current API, it's ok. But if
Or something like this. :-) You may also choose to only return some of the info (like width/height). Anyway globally it looks very good to me! |
Not for RAW files, but darktable can write .xcf with layers for the module's masks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested yet.
Fully agreed and done.
Also done.
We can deliver that, not sure what 'exactly' we should check for. |
9f96c60
to
39b8c9d
Compare
Can a connection be initiated from the darktable side? We currently use a lua script to export then launch gimp with the image and then import the result. Will this work on windows? |
Yes, should work as not modifying this part. The support here is for Gimp to be able to use darktable to demosaic the RAW and create a .xcf (which is then imported into Gimp). |
As we want to support darktable as a gimp plugin in the best possible way we put the burden of "how to do so" on the dt dev team instead of having that on the gimp side as we likely know better to achieve this. Summary of currently implemented darktable features - always use default resources - don't print any logs - while being in darkroom ignore any requests to change view ************************************************************************************** The GIMP support cli API Added --gimp <mode> option to the cli interface. <mode> is always a string, can be "version" "file" "thumb" Whenever we call 'darktable --gimp' the result is a string <res> written to stdout. Also the returncode is 0. In case of errors <res> is "error" and returncode will be 1 As darktable makes use of external libraries <ret> might be preceeded by other text, the <res> is always the last written line string (eol before and after) version Returns the current API version (for initial commit will be 1) file <path> Starts darktable in darkroom mode using image defined by <path>. When closing the darkroom window the file is exported as an xcf file to a temporary location. The full path of the exported file is returned as <res> thumb <path> <dim> Write a thumbnail jpg file to a temporary location. <path> is the image file <dim> (in pixels) is used for the greater of width/height and ratio is kept. The returned <res> has the following format: * The full path of the exported file on the first line * The width and height as space-separated integers on the second line. These dimensions are informational and may not be accurate. For raw files this is sensor size containing valid data.
39b8c9d
to
0d3a77e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
As we want to support darktable as a gimp plugin in the best possible way we put the burden of "how to do so" on the dt dev team instead of having that on the gimp side as we likely know better to achieve this. Please note, this pr does not require a working lua system so not depending on what a distribution offers. See https://gitlab.gnome.org/GNOME/gimp/-/issues/10572
EDIT for latest status
Summary of currently implemented darktable features