Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Have problem locating plug-ins
#1
I run GIMP (and most all application software) from portable (USB) drives on various Windows computers.  If I go to "Edit>Preferences>Folders" and add a folder for Plug-Ins then GIMP is able to find the plug-in (at present I'm wanting to use the GMIC Plugin for GIMP).  However, it seems that the drive letter in included is as part of the path.  The problem seems to be that Windows might assign different drive letters to USB devices and when this happens GIMP does NOT find the plugin.

Interestingly, the predefined folder specifications that GIMP includes in Preferences also include a drive letter.  However, when Windows assigns a new drive letter GIMP is able to figure that out for those cases and the newly assigned drive letter is used.  I need to be able to do the same thing for folders I add which will always be on the same drive as GIMP.

For whatever it might be worth the scripts that I use to start GIMP do update the environment variable named "GIMP2_DIRECTORY".  In addition to plugins, I also use a script.  GIMP has NO problem finding my script in the sub-folder named "scripts" but when I add the GMIC plug-in to the similar folder named "plug-ins" GIMP does NOT find it.

Would appreciate some help figuring out how to overcome this problem.
Reply
#2
Maybe...

The directories that Gimp scans for plug-ins (the ones you normally define in Folders > Plugins) are saved in the gimprc file in your Gimp profile. For instance, mine looks like;

(plug-in-path "${gimp_dir}/plug-ins:${gimp_plug_in_dir}/plug-ins:/home/me/Code/Gimp/PathTools/Activated:/home/me/Code/Gimp/Tools/Activated")

where :
  • ${gimp_dir} is replaced by the user profile
  • ${gimp_plug_in_dir} is the parent of the factory plugins directories (*/lib/gimp/2.0/), which on my self-build Gimp is currently Gimp-dev/2.10.34/run/lib/gimp/2.0/)
  • the /home/me/Code/Gimp/* directories are my own plugins
  • and a ${gimp_installation_dir} variable that doesn'st appear here and is to Gimp installation directory (Gimp-dev/2.10.34/run on my Gimp instance)
Now this is where the miracle begins. I can create a directory /Gimp-dev/2.10.34/extra/ which is outside of any directory that Gimp uses, but still in the same vicinity, and add it as a folder in Folders > Plugin using a **relative** path (obviously entered directlyy, without using the file selection dialog):

   

And lo and behold, Gimp obviously recognizes the beginning of the path, and in the plugin-path variable this is converted to a directory **relative** to the gimp installation directory: {gimp_installation_dir}/../extra.

And if I restart Gimp, a plugin I put there is recognized:

(plug-in-def "/Gimp-dev/2.10.34/extra/stringReg.py" 1692820811

In this form that very plugin is at a fixed position in the file system (fixed drive for you), but what it costs you is a re-scan of these plugins if they appear at another location/drive. And during my tests I have also seen that same plugin registered with something like 

(plug-in-def "${gimp_installation_dir}/../extra/stringReg.py" 1692820811

So you could be even luckier, or possibly edit the pluginrc file to add these variables.
Reply
#3
Looks to me like you are describing GIMP running on a Linux where there are NO drive letters rather than a Windows system.  However, your reference to miracle made me look for some magic of my own.  Therefore, I simply entered the path without the drive letter and LOW & BEHOLD it works.  To be clear in my case the the plugin is located in the same file system (i.e., partition and drive) as the GIMP software. In fact the first couple of directories in the path are the same as the GIMP software.

While this does leave me a little confused about how it works the idea that it does work is welcome.

Many thanks for the assistance.
Reply
#4
(08-25-2023, 02:36 AM)ajax Wrote: Looks to me like you are describing GIMP running on a Linux where there are NO drive letters rather than a Windows system.  However, your reference to miracle made me look for some magic of my own.  Therefore, I simply entered the path without the drive letter and LOW & BEHOLD it works.  To be clear in my case the the plugin is located in the same file system (i.e., partition and drive) as the GIMP software. In fact the first couple of directories in the path are the same as the GIMP software.

While this does leave me a little confused about how it works the idea that it does work is welcome.

Many thanks for the assistance.

In windows you have a "current drive" and a "current directory" per drive.

If you do:

Code:
# Switch to D: drive
D:
# cd /Directory/onD
# Switch to D: drive
E:
# cd /Directory/onE
# back to D: which puts you in D:/Directory/onD
D:
# copy files
cp somefile c:
This copies the file D:/Directory/onD/somefile to E:/Directory/onE/somefile. What is called the "current directory" is really the current directory on the current drive.

So, for you when there is no drive in the spec, Gimp uses the current drive. But this may or may not work depending on how Gimp is launched because its current drive may not be the drive where it is installed.

And everything I said applies to Windows. I would just expect the ${gimp_installation_dir} to be something like F:\Apps\Gimp\ or G:\Apps\Gimp\.
Reply
#5
Yes I do know about the current directory.  In fact, the scripts I use for starting the applications that I've setup on a portable drive always set it to something useful.  Since I don't know how GIMP might rely on the current directory I set it to the same folder as the file used to invoke GIMP.

It looks like GIMP does do something special (i.e., not done by other Windows software) when it comes to identifying the drive where the application was loaded from.  This is possible and something that I rely on very heavily to make my executable software function properly.

Thanks again for all your help.
Reply


Forum Jump: