Posts: 6,949
Threads: 297
Joined: Oct 2016
Reputation:
605
Gimp version:
Operating system(s): Linux
That should have worked. gi is the general support for Glib introspection. Comes with python3-gi among other things. Pretty much part of a standard install AFAIK. What version of Ubuntu are you on? And what version of Gimp are you using with what packaging (snap/deb/flatpak/other)?
Posts: 1
Threads: 0
Joined: Jan 2026
Reputation:
0
Gimp version:
Operating system(s): Linux
Using Ubuntu 24.04 / Gimp 3.0.6 and xscane 0.999
I see "XSane via CLI..." in the GIMP menu.
When I click on it nothing happings.
I get the following message:
(gimp:23916): GLib-GIO-WARNING **: 22:25:57.756: Error creating IO channel for /proc/self/mountinfo: Permission denied (g-file-error-quark, 2)
Traceback (most recent call last):
File "/home/jan/snap/gimp/542/.config/GIMP/3.0/plug-ins/xsanecli/xsanecli.py", line 53, in xsanecli_run
proc = subprocess.Popen(args, stdout=subprocess.PIPE, encoding='utf-8', env=xsane_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/snap/gimp/542/gnome-platform/usr/lib/python3.12/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/snap/gimp/542/gnome-platform/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/xsane'
When I start xsane directly in Python, everything works fine.
Does anyone have any idea how I can set the mount permission correctly?
#!/usr/bin/env python3
import os, subprocess, tempfile
tempDir = tempfile.mkdtemp('gimp-plugin-xsanecli')
png_out = tempDir+os.sep+'out.png'
args = ['xsane', '--save', '--no-mode-selection', '--force-filename', png_out, '--print-filenames']
proc = subprocess.Popen(args, stdout=subprocess.PIPE, encoding='utf-8', env=dict(os.environb))
if os.path.isfile(png_out): os.remove(png_out)
if os.path.isdir(tempDir): os.rmdir(tempDir)