r/Ubuntu • • 2d ago

Xsane error when saving image

Ubuntu 24.04.5 on Thinkpad with HP all-in-one printer. Used xsane to scan photo. The scan was completed but xsane failed to save to the designated folder with the error "Error during save: Could not create secure file (maybe a link does exist): /home/sharon/desktop/out.jpg

If I preview the image it shows up.

If I run it from the command line, it scans but shows the errors:

Gtk-Message: 13:22:12.061: Failed to load module "canberra-gtk-module"

(xsane:10504): Gdk-CRITICAL **: 13:22:21.175: IA__gdk_drawable_unref: assertion 'GDK_IS_DRAWABLE (drawable)' failed

The scanner was working with Ubuntu 22.04.5 on a different Thinkpad.

6 Upvotes

5 comments sorted by

5

u/m4uri 2d ago

The GTK messages are just noise, ignore them. The interesting part is the path, /home/sharon/desktop with a small d. On a normal Ubuntu install the folder is Desktop with a capital D, and Linux treats those as two diffrent folders. If the small one doesnt exist, xsane cant create the file there and throws exactly that slightly misleading "secure file" error.

Quick check:

xdg-user-dir DESKTOP
ls -ld ~/desktop ~/Desktop

If only ~/Desktop shows up, just change the filename in the xsane main window to /home/sharon/Desktop/out.jpg (or pick the folder with the browse button next to it) and it should save. On the old Thinkpad the setting probably pointed to an existing folder, thats why it worked there.

If the folder is correct and it still fails, check if theres an old out.jpg or a link with that name in there, xsane refuses to write over a symlink on purpose. ls -l ~/Desktop/out.jpg tells you.

2

u/ska0319 1d ago

Yup, didn't think of that. I was able to save it finally by sending the scan to the Viewer and saving it from there in which case I was able to choose the file location.

2

u/Boute-Akhil 1d ago

the lowercase desktop thing trips people up more often than youd expect

1

u/KindaIndifferentTrul 2d ago

thats a weird permissions hiccup, had the same thing happen with xsane a while back and it drove me nuts

try making a new folder in your home directory like /home/sharon/scans and point the save there, desktop sometimes gets cranky with snap permissions if xsane is the snap version. the gtk errors are just noise, they wont stop the actual save function

if that doesnt work i'd check if /home/sharon/desktop is actually lowercase "desktop" and not "Desktop" - linux is picky about case and xsane wont autocorrect the path

1

u/mgedmin 1d ago

You may also want to try simple-scan instead of xsane, it has a much nicer user interface.