XSane plugin not available in GIMP File menu

Bug #1948881 reported by Lastique
100
This bug affects 19 people
Affects Status Importance Assigned to Milestone
The Gimp
New
Unknown
gimp (Ubuntu)
Confirmed
Undecided
Unassigned
xsane (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Description of the bug

On the initial startup, GIMP initializes plugins, including xsane. Initializing xsane takes a long time on my system (perhaps, around 20 seconds), and after that the startup completes. However, there is no option in File->Create menu to create an image from scanner. On subsequent GIMP restarts, it no longer initializes plugins, including xsane, but the option is still missing.

Starting xsane on its own works, it hangs for some time (perceptively, also around 20 seconds) while "scanning for devices", then starts, and the scanner is working as expected there.

Reproduction

Is the bug reproducible? Yes, always.

Reproduction steps:

0. If you've already started GIMP before, touch /usr/lib/gimp/2.0/plug-ins/xsane/xsane.
1. Start GIMP. See that xsane plugin gets initialized.
2. Go to File->Create menu to see if xsane option is there.

Expected result:

There should be an option to obtain an image from scanner via xsane.

Actual result:

There is no option.

Additional information

My scanner is Canon LiDE 210, connected over USB. xsane 0.999-11ubuntu1

This started happening after upgrading from Kubuntu 21.04 to 21.10. In 21.04, with GIMP 2.10.22 and xsane 0.999-10ubuntu1, the xsane option was present.

I've also created an upstream bug here: https://gitlab.gnome.org/GNOME/gimp/-/issues/7422

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: gimp 2.10.24-2
ProcVersionSignature: Ubuntu 5.13.0-20.20-lowlatency 5.13.14
Uname: Linux 5.13.0-20-lowlatency x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu71
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: KDE
Date: Wed Oct 27 02:26:26 2021
InstallationDate: Installed on 2015-05-01 (2370 days ago)
InstallationMedia: Kubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: gimp
UpgradeStatus: Upgraded to impish on 2021-10-22 (4 days ago)

Revision history for this message
Lastique (andysem) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gimp (Ubuntu):
status: New → Confirmed
Changed in xsane (Ubuntu):
status: New → Confirmed
Lastique (andysem)
summary: - XSane plugin not available in File menu
+ XSane plugin not available in GIMP File menu
Revision history for this message
Scott Pakin (pakin) wrote :

In case it helps, I noticed that in Ubuntu 21.04, my ~/.config/GIMP/2.10/pluginrc contained

(menu-path "<Image>/File/Create/Acquire/XSane/Device dialog...")

within the (proc-def "xsane" ...) s-expression. No menu-path appears in my Ubuntu 21.10 ~/.config/GIMP/2.10/pluginrc.

Changed in gimp:
status: Unknown → New
Revision history for this message
Thomas Wolf (wolfithomas) wrote :

I'm affected by this bug, too.
I'm on Ubuntu 22.04. Is there anything new?
What can I do as a workaround?

Revision history for this message
Thomas Stieler (launchp0d) wrote :

Stupid enough that this issue ist still not fixed.

I booted an old Ubuntu version in virtualbox and installed Gimp and xsane. Then I just compared the working plugin configuration and manually aligned the autogenerated configuration.

So I got a working xsane plugin.

Revision history for this message
Lastique (andysem) wrote :

Could you post the difference between the configs? What fixed it (or introduced the problem)?

Revision history for this message
Thomas Stieler (launchp0d) wrote :

I will attach the xsane-relevant part from the automatically generated pluginrc file, first version from focal fossa and second from jammy jellyfish.

Here are the diffs:

stieler@mercury:~/Desktop$ diff pluginrc_jammy pluginrc_focal
1c1
< (plug-in-def "${gimp_plug_in_dir}/plug-ins/xsane/xsane" 1651153157
---
> (plug-in-def "${gimp_plug_in_dir}/plug-ins/xsane" 1614568029
8,9c8,10
< "/File/Acquire/XSane/Device dialog..."
< 0
---
> ""
> 1
> (menu-path "<Image>/File/Create/Acquire/XSane/Device dialog...")
13a15
>

Revision history for this message
Thomas Stieler (launchp0d) wrote :
Revision history for this message
Thomas Stieler (launchp0d) wrote :
Revision history for this message
sles (slesru) wrote :

I tried to patch pluginrc , even got xsane menu once
But most of times gimp just rewrites pluginrc :-(

Revision history for this message
Thomas Stieler (launchp0d) wrote (last edit ):

I think that there's a mechanism to update the pluginrc, when a plugin was updated.

The number at the end of the first line of the diff looks like a timestamp: Can you delete the pluginrc and let Gimp rebuild it.

Then keep the generated line with the "plug-in-def" and replace the other lines according to the diff.

This works for me...

If it doesn't work for you, make a backup of the generated pluginrc and post the difference between the backup and your modified version, maybe there is another issue...

Revision history for this message
Michael Schumacher (schumaml) wrote :

To clarify: the pluginrc file is to be rewritten by GIMP whenever necessary, and you must not rely on any manual changes done to it.

Revision history for this message
Thomas Stieler (launchp0d) wrote :

Of course it would be much better, if the root cause of this issue would be fixed.

An update of Gimp or xsane will most probably overwrite the manual changes.

You can trigger a pluginrc rewrite by touching the xsane plugin binary.

But for me the hack works good enough to use xsane again...

Revision history for this message
cascagrossa (cascagrossa-cascao) wrote (last edit ):

You are 100% right Thomas!

This ridiculous bug is actually active since 2021-10 and assigned to nobody.

Mr. Michael seems to don't understand that you proposed a good workaround, not a solution. And I thank you for that.

Revision history for this message
Nils Rennebarth (nils-rennebarth) wrote :

The problem is, that xsane only just recently (2 months ago, at 2022-05-13) fixed its build to support gimp-2.10 (Commit fd895d45 of https://gitlab.com/sane-project/frontend/xsane.git) Checking out the git repository and rebuild of xsane made the XSane entry reappear in the File->Create menu (and the plugin works and scans flawlessly).

There is one caveat however: xsane now insists on showing its EULA on first start. If the first start of xsane happens to be indirectly, i.e. from gimp, using the plugin, the EULA can not be accepted and the plugin appears to fail. I have no idea why accepting the EULA of a FOSS product is deemed so important, and did not try to find out how to fix the check at startup time, I just wanted to make gimp and its xscan plugin work again for me.

Please update to the latest xsane frontend release so that this bug can be closed. This restores major functionality so that should warrant an update, even though 22.04 has been released.

Revision history for this message
cascagrossa (cascagrossa-cascao) wrote :

Nils, thank you for the information!
I can confirm that updating to last xsane fronted, by rebuilding it from source, solved the issue in Kubuntu 22.04. In my opinion the bug can be closed.

Revision history for this message
Lastique (andysem) wrote :

I don't think the bug can be closed until a fixed package is released.

Revision history for this message
Thomas Stieler (launchp0d) wrote :

I would also like to wait until fixed packages reach the users.

Is is feasible to update the packages for 22.04 or do we have to wait for 22.10?

Revision history for this message
Steve Grace (sgrace) wrote (last edit ):

I have this problem after upgrading to Ubuntu MATE 22.04.1 (from 20.04.x) and would like to get an updated xsane package ASAP.

Revision history for this message
Michael Rutter (mjr19) wrote :

I can confirm / repeat that this issue affects 22.04(.1)LTS, and I don't think that LTS people will want to wait for 24.04LTS before they can use their scanners directly from GIMP!

There seem to have been a lot of GIMP-related commits to xsane since 0.999, so it is unclear to me how easy it would be to create a single patch to fix the issue in U22.04's current sources. It might be better to start again from a more recent copy of the xsane sources, whilst addressing comment #16 about the EULA.

Revision history for this message
renbag (renbag) wrote :

I tried to compile xsane from the latest GitLab master sources: the gimp plugin works, but then xsane crashes with a memory allocation error, at least with my scanner (maybe it's this issue: https://gitlab.com/sane-project/frontend/xsane/-/issues/44).
I think that at the moment the latest xsane is not enough stable to be packaged.
If someone wants similar functionalities then he can install the package "sane" which has also a gimp plugin.

Revision history for this message
Steve Grace (sgrace) wrote :

Per renbag's suggestion I installed package "sane" which contains a GIMP plugin for xscanimage. It's more simplistic than xsane but the GIMP integration works fine and it seems to be a good workaround for now.

Chris Guiver (guiverc)
tags: added: jammy
removed: impish
Revision history for this message
gruberm (gruberm) wrote (last edit ):

Just ran into this problem as well. This bug is now existing since almost two years and there's apparently an upstream commit that could be backported to solve this. Why isn't this being done and still unassigned?

I read at least 10 threads from various forums and StackExchange where people are puzzled why the xsane menu entry disappeared after updating to Jammy until I came across this bug report.

Revision history for this message
Carlos Diaz (charly-australia) wrote :

Xsane was working fine in my Linux Mint 20, BUT

Revision history for this message
Carlos Diaz (charly-australia) wrote :

Debian12 Bookworm - Since I installed it Xsane is not recognized/not showing. It was perfectly OK in my previous Mint 20.
I run the same as suggested above: touch /usr/lib/gimp/2.0/plug-ins/xsane/xsane
Yes, it is there (as a plugin), but not showing-up in File > Create
So, is it Gimp or Debian12 OS that needs upgrading?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.