Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plugins stopped working after upgrading to 2.10.34 in Windows
#1
I wrote some plugins which get executed via the Popen() function. They were working just fine, but after upgrading to version 2.10.34, all they do is generate error messages about not being able to find certain msys dll's. All 3 dll's exist in both the "GIMP 2/bin" and the appropriate msys folder. The plugins still work when I execute them manually from the Windows Command Prompt, so what do I have to do to get them to work again with GIMP?
Reply
#2
Check differences in the  the PATH & DLLPATH variables between running on the command prompt and running in Gimp. You may have missing directories, or directories that are in a different order and get "masked" by another directory that makes a different version of a EXE/DLL to be picked up.

There could also be another environment variable that is missing (but I have no idea what that could be). In Gimp you can list the environment variables (and their contents) using the Python-fu console:
Code:
➤> import os
➤> os.environ # dumps everything
➤>[k for k in os.environ] # just the key names
➤>os.environ['PATH'] # Value of PATH variable if present
Reply
#3
(08-30-2023, 06:11 AM)Ofnuts Wrote: Check differences in the  the PATH & DLLPATH variables between running on the command prompt and running in Gimp. You may have missing directories, or directories that are in a different order and get "masked" by another directory that makes a different version of a EXE/DLL to be picked up.

There could also be another environment variable that is missing (but I have no idea what that could be). In Gimp you can list the environment variables (and their contents) using the Python-fu console:
Code:
➤> import os
➤> os.environ # dumps everything
➤>[k for k in os.environ] # just the key names
➤>os.environ['PATH'] # Value of PATH variable if present

So, what am I looking for in the output, and how do I fix it?
Reply
#4
(08-30-2023, 06:11 AM)Ofnuts Wrote: Check differences in the  the PATH & DLLPATH variables between running on the command prompt and running in Gimp. You may have missing directories, or directories that are in a different order and get "masked" by another directory that makes a different version of a EXE/DLL to be picked up.

Bumping the GIMP path up a few notches in the Windows environment variable thingy seems to have worked.
Reply
#5
(08-30-2023, 03:56 PM)HueyIroquois Wrote: Bumping the GIMP path up a few notches in the Windows environment variable thingy seems to have worked.

Good. Thx for the feedback.
Reply
#6
(08-31-2023, 11:50 AM)Ofnuts Wrote:
(08-30-2023, 03:56 PM)HueyIroquois Wrote: Bumping the GIMP path up a few notches in the Windows environment variable thingy seems to have worked.

Good. Thx for the feedback.

It turns out I was wrong. If I launch GIMP from its own shortcut, it works; but if I launch it from an XCF file, it does not work, unless I copy the DLLs to the PlugIns folder.
Reply
#7
What says
Code:
import os
os.getcwd()

in the Python-fu console in both cases?

Note that if Gimp is started, when you try to start a second instance that second instance passes the bucket to the existing one and exits. So starting Gimp from the shortcut, and then launching XCF files form the explorer will open the XCF in the launched-from-shortcut instance.
Reply
#8
When I use the GIMP shortcut it says 'C:\\Program Files\\GIMP 2\\bin'. When I use an XCF file, it shows whatever folder the image is stored in, Usually on the D: drive.
Reply
#9
(08-31-2023, 06:32 PM)HueyIroquois Wrote: When I use the GIMP shortcut it says 'C:\\Program Files\\GIMP 2\\bin'. When I use an XCF file, it shows whatever folder the image is stored in, Usually on the D: drive.

So yes, it's a matter of whatever the CWD is.

So your PATH or DLL_PATH must contain a directory noted as "." (or even worse, a directory relative to that) to  use whatever is in the current directory (this is a capital sin on Linux since it is a security hazard, but on Windows it is unfortunately quite frequent). So make sure that PATH and DLL_PATH contain fully designated references to the Gimp directories (C:\\Program Files\\GIMP 2\\bin or else), so that these directories are always searched, even if the CWD isn't the one with the GIMP installation.
Reply


Forum Jump: