Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp 3.x scanner xsane plugin is now available!
#11
(07-26-2025, 11:52 AM)rich2005 Wrote: I said I would try a Mint 22.1 VM, new installation & updated. No Gimp installed

xsane 0.999 from the repo works and using my ancient Canon LiDE 30 (usb) scanner looks like this:



Note that Gimp 2 is a dependency (Gimp 2.10.36 is the default for 'buntu 24.04 / Mint 22 )

....the question is where did the Gimp 3.0.4 come from ?

GIMP 3.0.4 was pushed as an update by Linux Mint, overwriting the default GIMP 2.10.36 that I installed when I set the system up from scratch in November 2024.
Reply
#12
(07-26-2025, 02:31 PM)Andrew_P Wrote: GIMP 3.0.4 was pushed as an update by Linux Mint, overwriting the default GIMP 2.10.36 that I installed when I set the system up from scratch in November 2024.

The only problem there is, Gimp 3.0.4 is not standard in Mint 22.1 Gimp either came from a PPA or flatpak (or maybe an appimage). Even with Mint 22.1 Gimp comes fron ubuntu 24.04 and is 2.10.36

Packing in for a break but much trying out to see what works / does not work and not much works.

The default xsane 0.999 works stand-alone
For Gimp 2.10.36 the plugin that xsane 0.999 installs does not work - not a surprise , been broken a long time.

Using a PPA for Gimp 3.0.4 there are two that I know of
https://launchpad.net/~ubuntuhandbook1/+...ntu/gimp-3
https://launchpad.net/~mati75/+archive/ubuntu/gimp30

I had problems with GEGL - version too old, but I will go back sometime and try again. Using a Gimp 3.0.4 appimage There is a problem with the plugin - looks like a python incompatibility.

As a non- Mint check using kubuntu 25.04 , comes with Gimp 3.0.2 as default, xsane 0.999 and the xsanecli plugin works.

A real can of worms. At least with Mint 22.1 you can still scan & save to an image for editing with (whichever) Gimp installed.
Reply
#13
@Andrew_P

This mix works: Mint 22.1 / Gimp 3.0.4 from https://launchpad.net/~mati75/+archive/ubuntu/gimp30 / xsane 0.999 from repo.

proof Wink about a minute: https://i.imgur.com/j4tPUbw.mp4
Reply
#14
(01-12-2025, 06:14 AM)snovotill Wrote: I am now able to use my scanner in Gimp 3 thanks to the developer who published it at https://yingtongli.me/git/gimp-xsanecli
It works in Wayland as well as X.

Thanks for the tip. Unfortunately it does not work for me :
ModuleNotFoundError: No module named 'gi'
what should I do to install this lib ?

and an aside (and acid) remark : why is it so difficult to add a scan menu to GIMP on Ubuntu ???
Reply
#15
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)?
Reply
#16
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)
Reply


Forum Jump: