Posts: 3
Threads: 1
Joined: Apr 2025
Reputation:
0
Gimp version:
Operating system(s): Linux
Unclear if this question should be posted on a gimp forum or an xnviewmp forum. Because there may be an obscure gimp setting, I am trying this gimp forum first.
I just installed Linux Mint 22, and then xmviewmp 1.8.7 64-big (Linux) - Libformat 7.220 and then gimp 2.10.36. Then, I used xnviewmp's open with : configure : gimp facility to start gimp from inside xnviewmp by right-clicking on an image. Doing this, gimp opens the image okay, but has an annoying popup message "Opening /home/steve failed : Not a regular file." I have unsuccessfully tried variations of the [ xnviewmp : open with : gimp ] facility. For example, if I instead specify gimp.sh, which contains the command gimp-2.10 %U, xnviewmp does nothing. Alternatively, if I xnviewmp-configure gimp to start with the %U option, then I get two popup error messages.
I would like to find a gimp setting (or alternatively a xnviewmp setting) that will prevent any such popup message. Before posting, I attempted to research the problem. I found similar postings that were not exactly on point. I did notice that responders were interested in gimp's interaction with bash, so I experimented:
- When I start gimp, by itself, with the icon-command = gimp-2.10 %U, there is no problem opening/manipulating images.
- When I open a bash termimal and execute gimp-2.10, again there is no problem.
- However, if (instead) I open a bash terminal and execute gimp-2.10 %U, then I get the error message: "Opening /home/steve/%U failed: Error opening file /home/steve/%U: No such file or directory",
I don't really care about opening gimp from a bash terminal. That was simply an experiment.
Is there a gimp setting that will allow gimp to open the image as xnviewmp is directing, without also trying to open /home/steve/'? Alternatively, is there a gimp setting that will re-direct the message to a log file, so that I don't have the annoying popup, each time I xnviewmp-open-with-gimp an image?
Posts: 6,655
Threads: 289
Joined: Oct 2016
Reputation:
586
Gimp version:
Operating system(s): Linux
%U is a place holder for a variable substitution that is performed before Gimp is called. It is standardized in .desktop files. So it all boils down to what argument is passed to the probably) xdg-open command by the calling app (xnviewmp). So you problem is that Gimp is passed a directory and not a file (unless the problem is a space in the file name...)
Calling gimp %U in a bash terminal in pointless, in bash the %U is a plain string and is passed as is to Gimp.
Posts: 3
Threads: 1
Joined: Apr 2025
Reputation:
0
Gimp version:
Operating system(s): Linux
Ofnuts
Thanks for the reply. xnviewmp must be passing gimp the name of the image file, because the image file is being opened. Assuming that xnviewmp is calling xdg-open, why is it, that after gimp successfully opens the image file, gimp immediately tries to open /home/steve/ ? It is as if gimp does not play well with xdg-open. I still wonder if there is a relevant setting in gimp, to handle this.
When I configure xnviewmp to open with a *.sh file instead, nothing happens. This seems consistent with your idea that xnviewmp is calling xdg-open. So, it there is no joy fixing the problem on the gimp side, it seems as if I am going to have to write some sort of app (perhaps in java, if bash can't do it) that can catch the "app-open" event, and can also catch the name of the file being opened. Hypothetically, the intermediate app would then call gimp, passing gimp the file name.
I suspect, without knowing for sure, that a java app (for example) can catch the app-startup event. Further, I have just verified that in a bash terminal, the gimp-2.10 /my-path/myfile command works ok. So, the missing piece, which may be impossible to remedy, would be for the java app (et al) to catch the file-name parameter being sent by the xdg-open command.
If catching the file name is not directly feasible, the problem may still be solvable. That is, the java app, could be written to open the file, and then the app could interrogate the name of the file it has just opened.
I am a retired programmer with an amateurish knowledge of batch java. I have no idea if any of this is feasible, or what the cleanest solution would be, if there is no joy to be found on the gimp side.
I welcome anyone's ideas about either a gimp setting, a separate opinion on whether xdg-open is involved, or how to write the java app (or app in any other language) that would catch the app-startup-event, and also (somehow) determine the name of the file being sent by xdg-open.
Posts: 6,655
Threads: 289
Joined: Oct 2016
Reputation:
586
Gimp version:
Operating system(s): Linux
(Yesterday, 09:34 PM)zugzwang134 Wrote: Ofnuts
Thanks for the reply. xnviewmp must be passing gimp the name of the image file, because the image file is being opened. Assuming that xnviewmp is calling xdg-open, why is it, that after gimp successfully opens the image file, gimp immediately tries to open /home/steve/ ? It is as if gimp does not play well with xdg-open. I still wonder if there is a relevant setting in gimp, to handle this.
When I configure xnviewmp to open with a *.sh file instead, nothing happens. This seems consistent with your idea that xnviewmp is calling xdg-open. So, it there is no joy fixing the problem on the gimp side, it seems as if I am going to have to write some sort of app (perhaps in java, if bash can't do it) that can catch the "app-open" event, and can also catch the name of the file being opened. Hypothetically, the intermediate app would then call gimp, passing gimp the file name.
I suspect, without knowing for sure, that a java app (for example) can catch the app-startup event. Further, I have just verified that in a bash terminal, the gimp-2.10 /my-path/myfile command works ok. So, the missing piece, which may be impossible to remedy, would be for the java app (et al) to catch the file-name parameter being sent by the xdg-open command.
If catching the file name is not directly feasible, the problem may still be solvable. That is, the java app, could be written to open the file, and then the app could interrogate the name of the file it has just opened.
I am a retired programmer with an amateurish knowledge of batch java. I have no idea if any of this is feasible, or what the cleanest solution would be, if there is no joy to be found on the gimp side.
I welcome anyone's ideas about either a gimp setting, a separate opinion on whether xdg-open is involved, or how to write the java app (or app in any other language) that would catch the app-startup-event, and also (somehow) determine the name of the file being sent by xdg-open.
You can have xnviewmp use about anything to open the file (including just a bash script) so can log somewhere what is received by the application asked to open the file. But IMHO this is likely just a configuration problem, because is it likely working for thousands of people (otherwise you wouldn't be the first to ask here).
Posts: 3
Threads: 1
Joined: Apr 2025
Reputation:
0
Gimp version:
Operating system(s): Linux
Yesterday, 11:05 PM
(This post was last modified: Yesterday, 11:42 PM by zugzwang134.)
Ofnuts
On the one hand, I (unfortunately) agree with your inference that it is probably some unusual setting (somewhere). On the other hand, my mint 22 install is only 3 weeks old, and the only change that I can think of was to install the en (i.e. english?) gimp language packs (whatever those are).
(Semi)SOLVED- Experimenting, I made gimp the DEFAULT *.png image browser. Then, in xnviewmp : open with, instead of choosing gimp-2.10, I chose associated browser. The one downside to this is that this approach will not open multiple files at once. However, in the infrequent times that I have to do that, I can live with having to close the gimp error message popup.
|