I'm trying to get NAPS2 working on Linux (Ubuntu 20.04) with my Epson L6190 AIO printer/scanner. After some trial and error, I've been able to compile NAPS2 on Linux itself with Mono.
After fixing #773, NAPS2 aborted the scanning because it interpreted the output of the scanimage invocation as reporting an error.
My scanner appears in 3 different ways as output from scanimage --list:
device `escl:https://192.168.70.10:443' is a ESCL EPSON L6190 Series SSL flatbed scanner
device `escl:http://192.168.70.10:443' is a ESCL EPSON L6190 Series flatbed scanner
device `imagescan:esci:networkscan://192.168.70.10:1865' is a Epson L6190
The first 2 lines are autodetected, the 3rd line (starting with "imagescan") appears because of my manual configuration of /etc/imagescan/imagescan.conf (configuration file of the Epson scan driver).
If I do a scan with scanimage using one of the first 2 lines:
/bin/scanimage --device-name=escl:https://192.168.70.10:443 --format=tiff --progress --mode Color -x 215.9 -y 279.4 -l 8.12799 -t 8.12799 --resolution 200 -o ../dummy.tiff
scanimage outputs (truncated):
Capability : [(null)]
Capability : [image/jpeg]
Capability : [image/jpeg]
Capability : [image/jpeg]
scanimage: rounded value of tl-x from 8.12799 to 8.12799
scanimage: rounded value of tl-y from 8.12799 to 8.12799
scanimage: rounded value of resolution from 200 to 200
scanimage: rounded value of br-x from 224.028 to 224.028
scanimage: rounded value of br-y from 287.528 to 287.528
Progress: 0.3%
...
Progress: 100.0%
NAPS2 (SaneWrapper.cs, ScanOne() is not expecting any other other than "Progress" lines, and considers all other output as meaning "there was an error". Because of that, scanning is aborted. If I modify SaneWrapper.cs to not consider these Capability and scanimage lines as errors, scanning completes successfully. I temporarily "fixed" this by commenting out the following line in SaneWrapper.cs, ScanOne():
//errorOutput.Add(args.Data);
However this would ignore valid errors as well, so it's not a proper fix. I'm not sure what format an actual scanimage error message has, so I cannot suggest a proper fix at the moment.
Same issue occurs for me when I try to use an Epson WF-2760 in Debian Linux. It also seems to be what is affecting this user: https://sourceforge.net/p/naps2/tickets/545/
I receive this line in my errorlog.txt: