Open batonac opened 10 months ago
Does using the command-line scanimage
work for scanning?
Great question! scanimage -d 'epsonds:libusb:002:009' --format=jpeg -o scan.jpg
scans and saves a file successfully, but does output the error Corrupt JPEG data: found marker 0xd9 instead of RST1
to the terminal. I guess you zeroed in on the source of that error.
What should I test next?
If you have another Linux distro (or VM etc) available, it might be worth trying to see if it's actually specific to NixOS or just the specific scanner.
This is likely a upstream issue with SANE: https://gitlab.com/sane-project/backends/-/issues/99 I'm also having this issue with other distros. Should be fixed with the next release.
@mkfrey that's good to know. I haven't spun up a Ubuntu machine yet, to confirm this myself. I'm too hooked on NixOS 😀
@mkfrey Are you having the same TypeInitializerException on other distros?
@batonac One other thing to try on nixOS, is does importing an image work? If not it might be having trouble loading one of these libraries. Maybe there's a missing runtime dependency.
Describe the bug I'm working on packaging NAPS2 for NixOS, and running into an issue that I suspect is a bug. The interface works, my scanners are detected, but when I try to scan I get a series of errors which seem to indicate that there's a mishap somewhere between SANE and NAPS2 in handling image data.
The actual error from the interface is as follows:
The error printed on the console is simply:
I suspect that this error is coming from an underlying library, presumably libjpeg. Though it seems from a perusal of the source code that GTK is being utilized for image manipulation, and not libjpeg directly.
My further suspicion is of a version incompatibility somewhere between an upstream library shipped in NixOS unstable and the current NAPS2 code. I can reproduce this exact issue whether building from source or building from the latest Debian package. FWIW, the SANE backend on Ubuntu 22.04 is libsane 1.1.1, on NixOS its 1.2.1.
To Reproduce Steps to reproduce the behavior:
nix-build
, and run with./result/bin/naps2
Expected behavior The image(s) are loaded from the scanner into NAPS2.
Screenshots Here you can see the error in the interface as well as the console:![image](https://github.com/cyanfish/naps2/assets/4996285/20efab56-d45d-4ea9-bf62-94c8a5385192)
Desktop (please complete the following information):
Additional context I'm new at building packages for Nix, and haven't even used NAPS2 on Linux up to this point. Initially, I assumed that it was my own fault in the packaging that this isn't working, but the further I went along the more I suspected that there's a library incompatibility somewhere. Here's the package spec for running the Debian package on Nix (I spent much less time perfecting that one).
I'm glad to try to pitch in to further diagnose and/or resolve this issue, but I'm at a loss as to how to proceed, so any further suggestions are much appreciated!