Rawtherapee: RT does not start as a GIMP plugin in Windows 10

Created on 9 Dec 2018  路  23Comments  路  Source: Beep6581/RawTherapee

New user here, found an issue on Win10/x64, and Gimp 2.10.8 where RT won't start when editing a RAW file in GIMP. This repros in RT 5.4, 5.5 RC1, and 5.5 RC2. I had done a clean install of GIMP, followed by clean install of RT (tried both versions, otherwise did nothing to mess with the installations or confi).

To repro issue:

  1. Try to edit a RAW .DNG file in GIMP.
  2. GIMP informs you that it only has 2 compatible RAW apps--Darktable and RT--and that neither one is found. I've noticed other users reporting this issue in GIMP forums as well.

Cross-ref to the same issue filed from a GIMP user.

https://gitlab.gnome.org/GNOME/gimp/issues/2083

bug

Most helpful comment

@heckflosse
Thank you

Ticket opened on gitlab/gimp

https://gitlab.gnome.org/GNOME/gimp/issues/2716

All 23 comments

Did you search and see this issue? #4534 seems very related.

I did, and still have "C:\Program Files\RawTherapee\releases-5.5-rc1;" in my system PATH.

There are 3 ways GIMP could locate rawtherapee
1- when installing 5.5RC1, the installer set registry variables that can be read by the GIMP (automatic)
2- manually append Rawtherapee.exe path to PATH variable
3- set the variable RAWTHERAPEE_EXECUTABLE (with what?); I supposed something like /rawtherapee installdir/rawtherapee.exe.

I tried with no avail the 3 possibilities with both versions from Partha and from gimp.org.

Some time ago, with previous versions, I was able to make it work setting PATH variable

A guess: the installers give you the choice of installing for a single user or all users. If you choose one for GIMP and the other for RT, there might be a registry, directory and / or temp mismatch.

A guess: the installers give you the choice of installing for a single user or all users. If you choose one for GIMP and the other for RT, there might be a registry, directory and / or temp mismatch.

Agree that could cause an issue. In this case, both apps were installed for all users, both the installations show up in the system Program Files folder.

@agriggio @heckflosse
Now that 5.5 is out, I hope you can take some time to solve this issue.

there were somme efforts already some efforts done by RT and GIMP people. For reference:

Add Single User/Multi User switch to Windows setup. #4790
Rawtherapee as a GIMP plugin #4534
GIMP RawTherapee plugin cannot find executable in Windows #4514
https://discuss.pixls.us/t/gimp-hip-hip-pas-rt-hurrah/10288

I don't know how to test, but this could help:

diff --git a/rtgui/main.cc b/rtgui/main.cc
index 8996ee01d..b75fc0ec8 100644
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -536,7 +536,7 @@ int main (int argc, char **argv)
                 bool Console = true;

                 for (int i = 1; i < argc; i++)
-                    if (!strcmp (argv[i], "-w") || !strcmp (argv[i], "-R")) {
+                    if (!strcmp (argv[i], "-w") || !strcmp (argv[i], "-R") || !strcmp (argv[i], "-gimp")) {
                         Console = false;
                         break;
                     }
diff --git a/tools/gimp-plugin/file-rawtherapee.c b/tools/gimp-plugin/file-rawtherapee.c
index d78c30a10..56c5e2978 100644
--- a/tools/gimp-plugin/file-rawtherapee.c
+++ b/tools/gimp-plugin/file-rawtherapee.c
@@ -92,7 +92,11 @@ init (void)
   /* check if rawtherapee is installed
    * TODO: allow setting the location of the executable in preferences
    */
+#ifdef WIN32
+  gchar    *argv[]           = { "rawtherapee", "-v -w", NULL };
+#else
   gchar    *argv[]           = { "rawtherapee", "-v", NULL };
+#endif
   gchar    *rawtherapee_stdout = NULL;
   gboolean  have_rawtherapee   = FALSE;
   gint      i;


I don't know how to test, but this could help:
Yes that is one of the problems.
One other is to compile file-rawtherapee.c. It seems I need Gimp environment

I updated the patch 2 posts above

I began to build GIMP on W10, following https://wiki.gimp.org/wiki/Hacking:Building/Windows.

I rebuilt BABL and GEGL.
Building GIMP 2.10.8, I got a huge lot of compilation warnings.

As usual on MSYS2, with the vintage build system used by GIMP (autogen,automake. auto* stuff) it messes with Unix/windows path format:

libtool:   error: Could not determine the host path corresponding to
libtool:   error:   'C:/msys64/mingw64/lib:C:/msys64/mingw64/bin:/d/gimp/gimp/libgimp/.libs:/d/gimp/gimp/libgimpwidgets/.libs:/d/gimp/gimp/libgimpmodule/.libs:/d/gimp/gimp/libgimpconfig/.libs:/d/gimp/gimp/libgimpmath/.libs:/d/gimp/gimp/libgimpcolor/.libs:/d/gimp/gimp/libgimpbase/.libs:/MINGW64/lib:/MINGW64/bin:/d/gimp/gimpinstall/lib:/d/gimp/gimpinstall/bin'
libtool:   error: Continuing, but uninstalled executables may not work.

I suppose as the target is a windows system, it wrongly tries to convert unix style path to windows style path.

edit: GIMP is build with RT plugin

@heckflosse
Surprise! with my build it works!
If you want to test, I can upload the install dir. it is not a package and you need to run inside a Mingw64 shell to get the dlls.
I am puzzled

@heckflosse
Surprise! with my build it works!
If you want to test, I can upload the install dir. it is not a package and you need to run inside a Mingw64 shell to get the dlls.
I am puzzled

Cross-check the related GIMP bug linked in the OP: this same issue of building and then launching from Mingw64 is being discussed there.

@heckflosse
I can get the plugin work with the two following modifications. Only tested with RT register keys.

In file-rawtherapee.c from GIMP:

diff --git a/plug-ins/file-raw/file-rawtherapee.c b/plug-ins/file-raw/file-rawtherapee.c
index 1199f82673..e044afc556 100644
--- a/plug-ins/file-raw/file-rawtherapee.c
+++ b/plug-ins/file-raw/file-rawtherapee.c
@@ -97,7 +97,11 @@ init (void)
                                                              "com.rawtherapee.rawtherapee",
                                                              REGISTRY_KEY_BASE,
                                                              &search_path);
-  gchar    *argv[]             = { exec_path, "-v", NULL };
+  #ifdef WIN32
+        gchar    *argv[]             = { exec_path, "-vw", NULL };
+  #else
+        gchar    *argv[]             = { exec_path, "-v", NULL };
+  #endif
   gchar    *rawtherapee_stdout = NULL;
   gboolean  have_rawtherapee   = FALSE;
   gint      i;

and in RT main.cc:

diff --git a/rtgui/main.cc b/rtgui/main.cc
index 8996ee01d..cd23d6b7c 100644
--- a/rtgui/main.cc
+++ b/rtgui/main.cc
@@ -137,6 +137,11 @@ int processLineParams ( int argc, char **argv )

                 case 'w': // This case is handled outside this function
                     break;
+                case 'vw' :
+                    printf("RawTherapee, version %s\n", RTVERSION);
+                    ret = 0;
+                    break;
+                
 #endif

                 case 'v':
@@ -181,6 +186,7 @@ int processLineParams ( int argc, char **argv )
                     printf("Options:\n");
 #ifdef WIN32
                     printf("  -w Do not open the Windows console\n");
+                    printf("  -vw Print RawTherapee version number and do not open the Windows console\n");
 #endif
                     printf("  -v Print RawTherapee version number and exit\n");
 #ifndef __APPLE__
@@ -536,7 +542,7 @@ int main (int argc, char **argv)
                 bool Console = true;

                 for (int i = 1; i < argc; i++)
-                    if (!strcmp (argv[i], "-w") || !strcmp (argv[i], "-R")) {
+                    if (!strcmp (argv[i], "-w") || !strcmp (argv[i], "-R") || !strcmp (argv[i], "-vw")|| !strcmp (argv[i], "-gimp")) {
                         Console = false;
                         break;
                     }

I added -vw option as using "-v -w" in file-rawtherapee.c doesn't prevent the opening of the DOS window.

My modification is surely clumsy as it is and need review.

The difficultie to test are:

  • you have to generate file-rawtherapee.exe. The only way I found is to build GIMP.
  • as i wanted to run from a DOS console, in order to get all the dependencies, I copy back the generated File-rawtherapy.exe back in the installed gimp.org 2.10.8.

Once it is ok here we will have to submit the modification to GIMP devs.

@gaaned92

I added -vw option as using "-v -w" in file-rawtherapee.c doesn't prevent the opening of the DOS window.

On dev, when I start rawtherpee.exe from cmd.exe like this

rawtherapee -v

an additional console opens

When I start rawtherpee.exe from cmd.exe like this

rawtherapee -v -w

no additional console opens.

Does this behave differently at your system?

Does this behave differently at your system?

It behaves exactly the same here.
But, when Rawtherapee is called by file-rawtherapee.exe with "-v -w", a console opens.
It is like main.cc sees only one argument and not the second -w.
So I created this option -vw to avoid opening console. Not very elegant I admit!

@gaaned92
please try

gchar    *argv[]           = { "rawtherapee", "-v", "-w", NULL };

@heckflosse it works :satisfied:

Now it will wait a few days.

Merry Christmas to all :christmas_tree:

@gaaned92 \o/ and merry christmas

@heckflosse
I tested with PATH, RAWTHERAPEE-EXECUTABLE and automatic waywith installation. It seems OK.

So could you commit your patch for main.cc
Regarding file-rawtherapee.c, as it belongs now to GIMP, I will submit the suggested patch 2 posts above.
I think, either file-rawtherapee.c should be deleted from RT rep or copied back from GIMP

For those who want to use the RT plugin, file-rawtherapee.exe is uploaded at https://keybase.pub/gaaned92/RTW64NightlyBuilds/
Just replace the original one in GIMP install dir.

@gaaned92 Done

@heckflosse
Thank you

Ticket opened on gitlab/gimp

https://gitlab.gnome.org/GNOME/gimp/issues/2716

Ticket on gitlab/GIMP commited and closed.

@heckflosse @timlt can you close this thread?

For me this is resolved. The latest builds of Gimp (2.10.10), RT (5.6), and even Darktable (2.6.2) are all working now on Win10 x64. With a clean install of Gimp and either of these apps and no extra configuration steps, I can open a RAW/DNG file in Gimp, and it pops open in RT (though I also confirmed it works with Darktable).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heckflosse picture heckflosse  路  3Comments

agriggio picture agriggio  路  4Comments

elecprog picture elecprog  路  5Comments

jade-nl picture jade-nl  路  4Comments

JIPG2 picture JIPG2  路  3Comments