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

Darktable 5.0 <-> GIMP 3.0 interface for windows #17853

Open
jenshannoschwalm opened this issue Nov 19, 2024 · 24 comments · Fixed by #17931
Open

Darktable 5.0 <-> GIMP 3.0 interface for windows #17853

jenshannoschwalm opened this issue Nov 19, 2024 · 24 comments · Fixed by #17931
Labels
priority: high core features are broken and not usable at all, software crashes scope: windows support windows related issues and PR
Milestone

Comments

@jenshannoschwalm
Copy link
Collaborator

Describe the bug

It seems that on windows darktable master is still not recognized in GIMP 3.0 as a plugin so developing a raw via darktable is broken.

Steps to reproduce

Can't test as not a windows user and not having access to a windows system at all.

Expected behavior

Interface should work

Logfile | Screenshot | Screencast

No response

Commit

No response

Where did you obtain darktable from?

self compiled

darktable version

current master

What OS are you using?

Windows

What is the version of your OS?

???

Describe your system?

No response

Are you using OpenCL GPU in darktable?

None

If yes, what is the GPU card and driver?

No response

Please provide additional context if applicable. You can attach files too, but might need to rename to .txt or .zip

See as reference

https://gitlab.gnome.org/GNOME/gimp/-/issues/12260
https://discuss.pixls.us/t/gimp-darktable-not-working-with-gimp-3-0-0-rc1-and-current-dt-from-master/46609/12

Opening this to keep track

@jenshannoschwalm jenshannoschwalm added priority: high core features are broken and not usable at all, software crashes bug: pending someone needs to start working on that labels Nov 19, 2024
@jenshannoschwalm jenshannoschwalm added this to the 5.0 milestone Nov 19, 2024
@jenshannoschwalm jenshannoschwalm changed the title Datrktable 5.0 GIMP 3.0 interface for windows Darktable 5.0 <-> GIMP 3.0 interface for windows Nov 25, 2024
@jenshannoschwalm
Copy link
Collaborator Author

@zisoft would you be able to check dt master vs gimp 3.0rc on windows so we might get it fixed or confirmed it works with dt 5.0?

@zisoft
Copy link
Collaborator

zisoft commented Nov 26, 2024

I'll try my very best :-)

This is my PC at work and I have no admin privileges here, so neither darktable nor gimp are installed in standard windows paths.

Can you tell me what steps are needed to test this?

@jenshannoschwalm
Copy link
Collaborator Author

GIMP with latest 3.0RC and dt master should be installed.

  1. Starting gimp should show dt as a plugin
  2. loading a raw via dt should work :-)

@zisoft
Copy link
Collaborator

zisoft commented Nov 29, 2024

I am afraid I cannot help here much.
Without admin privileges I cannot install in Windows default paths so gimp cannot find my self-compiled darktable.
Is there any way to tell gimp where to look?

@jenshannoschwalm
Copy link
Collaborator Author

Is there any way to tell gimp where to look?

I don't think so.

@dtrtuser
Copy link

dtrtuser commented Dec 1, 2024

Just FYI: tried on 2 different computers (windows 10 and windows 11). Gimp 3.0.0-RC1 installed in default location (C:\Program Files\GIMP 3) and darktable from current master also installed in default location (C:\Program Files\darktable) and Gimp can't find darktable.

@jenshannoschwalm jenshannoschwalm added the scope: windows support windows related issues and PR label Dec 1, 2024
@jenshannoschwalm
Copy link
Collaborator Author

jenshannoschwalm commented Dec 1, 2024

@dtrtuser i have absolutely no idea about windows and what this means "can't find darktable". I think there might be some "registry" involved.

@Jehan maybe you could step in here as we definitely want to get this working? I checked again the protocol part on dt side and that seems to be good. Any idea? I looked into gimp plug-ins/file-raw/file-darktable.c and couldn't get what might be wrong on our or GIMP's side.

Would we have to set an environment variable?

@dtrtuser
Copy link

dtrtuser commented Dec 1, 2024

@jenshannoschwalm "can't find darktable" means that if in Gimp I go to "Edit" -> "Preferences" -> "Image Import & Export" darktable is not listed in the plug-in list and therefore not selectable.

After looking at the code in Gimp plug-ins/file-raw/file-darktable.c, I ran Gimp from Windows Powershell after setting DARKTABLE_DEBUG to true and got this message:

PS C:\Users\dtrtuser> $env:DARKTABLE_DEBUG = [bool] 1
PS C:\Users\dtrtuser> & 'C:\Program Files\GIMP 3\bin\gimp-3.0.exe'
gimp_font_factory_load_names: 615 unsupported fonts were ignored. Set the GIMP_DEBUG_FONTS environment variable for a listing.
set device 'System Aggregated Pointer' to mode: disabled
[../plug-ins/file-raw/file-darktable.c] trying to call 'C:\Program Files\darktable\bin\darktable.exe'
[../plug-ins/file-raw/file-darktable.c] g_spawn_sync failed
[../plug-ins/file-raw/file-darktable.c] g_spawn_sync failed
[../plug-ins/file-raw/file-darktable.c] error: Failed to execute helper program (No such file or directory)
[../plug-ins/file-raw/file-darktable.c] have_darktable: 0

Hope this helps.

@jenshannoschwalm
Copy link
Collaborator Author

Could you check if the dark table.exe file exists at the tested location?

@Jehan
Copy link

Jehan commented Dec 1, 2024

@jenshannoschwalm

@Jehan maybe you could step in here as we definitely want to get this working?

So looking in the code, what we do on Windows to find the raw developer executable is that we look for the value of a given registry key, checking it first on HKEY_CURRENT_USER, then on HKEY_LOCAL_MACHINE (which I understand as being either user-installed or system-installed).

For darktable in particular, this key is SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\darktable (maybe adding a .exe if I understand correctly the code in file_raw_get_executable_path() doing a concat().

Maybe this key which you used to set in the Windows registry has been changed?

@jenshannoschwalm
Copy link
Collaborator Author

We will find out :-)

@dtrtuser
Copy link

dtrtuser commented Dec 1, 2024

Could you check if the dark table.exe file exists at the tested location?

Yes, it’s there.

@dtrtuser
Copy link

dtrtuser commented Dec 1, 2024

**** Please read my update at bottom of this post: issue seems to be both in Gimp (missing files in install package) and darktable (malformed output path for image.exr file) ****

I made some progress (but still not working) ...

It seems that Gimp 3RC1 package for Windows is missing 2 files in order to be able to spawn darktable (g_spawn_sync):

  • gspawn-win64-helper-console.exe
  • gspawn-win64-helper.exe

If I copy these 2 files in \Program Files\Gimp 3\bin, then Gimp lists darktable in the preferences and uses darktable to open raw files. I can do my edits in darktable but when I close it (and expect to get the image in Gimp), Gimp pops up an error message:

Calling error for procedure 'gimp-file-load':
Error opening file 'C:\Users\dtrtuser\AppData\Local\Temp\darktable_YLL3X2\image.exr' for reading
Opening 'D:\Backup Pictures\2024\Imported on Wednesday, November 27, 2024\20241127-_7RV1846.ARW' failed:
(NULL) plug-in could not open image

If I look in the C:\Users\dtrtuser\AppData\Local\Temp\darktable_YLL3X2\ folder, it's empty.

Also below is the output of Gimp when running from command line:

## stdout ##
     0.0001 [dt starting]
 C:\Program Files\darktable\bin\darktable.exe --gimp file D:\Backup Pictures\2024\Imported on Wednesday, November 27, 2024\20241127-_7RV1850.ARW
    11.6218 [export_job] exported to `C:UsersdtrtuserAppDataLocalTempdarktable_YLL3X2/image.exr'
<<<gimp
C:\Users\dtrtuser\AppData\Local\Temp\darktable_YLL3X2/image.exr
gimp>>>

Please note that the path is missing the \ (backslash). Not sure if it is a log formatting issue or if darktable is really trying to output to this location (in which case it would explain why no file is truly created).

Hope this helps.

**** UPDATE ****

I think the second issue (darktable not returning the image to Gimp) is because dt doesn't properly format the path to the output directory (missing backslash, as the log above suggest). I found the image.exr files in a completely different place.

For instance, rather than writing the image.exr file in C:\Users\dtrtuser\AppData\Local\Temp\darktable_YLL3X2\ the file is written instead in C:\Users\dtrtuser\UsersdtrtuserAppDataLocalTempdarktable_YLL3X2

(Just to be clear: the output directory is properly created, but the image file (image.exr) is place in another one).

@Jehan
Copy link

Jehan commented Dec 2, 2024

It seems that Gimp 3RC1 package for Windows is missing 2 files in order to be able to spawn darktable (g_spawn_sync):

Ah right. We tried to have our package do a small diet and over-deleted some files. This got fixed here for RC2: https://gitlab.gnome.org/GNOME/gimp/-/issues/12288

Though it looks like we only include gspawn-win64-helper-console.exe and not gspawn-win64-helper.exe.

@dtrtuser Could you verify if gspawn-win64-helper.exe is really useful or if only gspawn-win64-helper-console.exe is enough please? If the former, I guess we need an additional fix. If the latter, we should already good to go in GIMP side.

(also pinging @brunvonlope)

For instance, rather than writing the image.exr file in C:\Users\dtrtuser\AppData\Local\Temp\darktable_YLL3X2\ the file is written instead in C:\Users\dtrtuser\UsersdtrtuserAppDataLocalTempdarktable_YLL3X2

For this part of the issue, it indeed feels like it's on darktable side.

Thanks for all the investigating/testing @dtrtuser !

@dtrtuser
Copy link

dtrtuser commented Dec 2, 2024

@dtrtuser Could you verify if gspawn-win64-helper.exe is really useful or if only gspawn-win64-helper-console.exe is enough please? If the former, I guess we need an additional fix. If the latter, we should already good to go in GIMP side.

I removed gspawn-win64-helper.exe from \Program Files\Gimp 3\bin and it behaves the same, so this one might not be needed :-)

Thanks for all the investigating/testing @dtrtuser !

My pleasure, thank you (Gimp and darktable developers) for doing all the hard work!

@jenshannoschwalm
Copy link
Collaborator Author

(Just to be clear: the output directory is properly created, but the image file (image.exr) is place in another one).

Ok, i'll do the homework here :-)

@brunvonlope
Copy link

I removed gspawn-win64-helper.exe from \Program Files\Gimp 3\bin and it behaves the same, so this one might not be needed

Since you're taking the gspawn executable from some msystem prefix /bin dir there is a risk of glib and its dependencies version mismatching.

I would like to trigger two GIMP master builds to test the gspawn theory: one not touched and another with the additional gspawn. But this can time time since GNOME GitLab is completely broken.

@brunvonlope
Copy link

Also, I h've seen some comments about admin rights. I think they are not (and should not) be needed. I remember of using darktable without problems in my user space (before the API breakages begun).

@jenshannoschwalm
Copy link
Collaborator Author

@dtrtuser would you be able to test #17931 ? Indeed the file seperator was plain wrong on windows, i think it should be fine now.

@jenshannoschwalm
Copy link
Collaborator Author

Let's keep this open to discuss until all issues are confirmed to be fixed.

@jenshannoschwalm jenshannoschwalm removed the bug: pending someone needs to start working on that label Dec 2, 2024
@dtrtuser
Copy link

dtrtuser commented Dec 2, 2024

@dtrtuser would you be able to test #17931 ? Indeed the file seperator was plain wrong on windows, i think it should be fine now.

I am await from my computer and I won’t be able to test until Wednesday evening (US Mountain Time).

@dtrtuser
Copy link

dtrtuser commented Dec 3, 2024

I was actually able to install GIMP and build dt from master (with changes from #17931, I checked the source) on my work laptop but unfortunately same issue: the path to image.exr is still missing all the backslashes.

@jenshannoschwalm
Copy link
Collaborator Author

Ok, can you confirm that the path printed in the protocol is correct but the written file is located elsewhere?

@dtrtuser
Copy link

dtrtuser commented Dec 3, 2024

Ok, can you confirm that the path printed in the protocol is correct but the written file is located elsewhere?

That's correct: both dt and Gimp are supposed to write/read the file in C:\Users\dtrtuser\AppData\Local\Temp\darktable_A3YQX2\ but dt writes it in C:\Users\dtrtuser\ and the file name is UsersdtrtuserAppDataLocalTempdarktable_A3YQX2image.exr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high core features are broken and not usable at all, software crashes scope: windows support windows related issues and PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants