On Wed, Aug 27, 2025 at 03:16:32PM -0400, Sparr Risher wrote: > I am using sane 1.4.0 with my Epson ES-50 (aka J421B). I am experiencing a > few problems, potentially some or all of which have the same root cause. > I'm moderately proficient with troubleshooting and coding in C, but I know > nothing about scanner protocols or how the sane codebase is organized. I am > hoping someone here might be able to give me some pointers on where I > should look first in digging into one or more causes for these issues: > > In some frontends, including Gnome simple-scan, when I attempt to scan an > additional page into a batch, I am told there is no document in the feeder > on alternating attempts. First page scans fine (almost?) every time. First > attempt to add a page fails. In scanimage, as soon as that attempt fails, > the batch ends. In Gnome simple-scan, I can click the button to add a page > to the batch again and the second attempt will succeed, then I click again > and the third attempt fails, and again and the fourth attempt succeeds, etc. > > Every frontend I've tried produces 8.5x14" images when I scan 8.5x11" > pages. The unscanned area is solid white. > > Every page I scan with scanimage produces additional output to stderr > "Corrupt JPEG data: found marker 0xd9 instead of RST3" > > When I run scanimage in -T -v mode it also ends its output with "FAIL > Error: End of file reached" > > Here is one session showing all of the problems except the last one, where > I attempt to scan two 8.5x11 pages and get one 8.5x14 output image then a > failure: > > % scanimage -L > device `epsonds:libusb:003:004' is a Epson ES-50 ESC/I-2 > > % scanimage -v -b --batch-prompt --format=pngScanning infinity pages, > incrementing by 1, numbering from 1 > Place document no. 1 on the scanner. > Press <RETURN> to continue. > Press Ctrl + D (EOF) to terminate. > > Scanning page 1 > Corrupt JPEG data: found marker 0xd9 instead of RST4 > scanimage: scanning image of size 1696x2795 pixels at 24 bits/pixel > scanimage: acquiring RGB frame > scanimage: min/max graylevel value = 0/255 > scanimage: read 14220960 bytes in total > Scanned page 1. (scanner status = 5) > Place document no. 2 on the scanner. > Press <RETURN> to continue. > Press Ctrl + D (EOF) to terminate. > > Scanning page 2 > scanimage: sane_start: Document feeder out of documents > Batch terminated, 1 page scanned
Hi, Sparr. I happen to own the same Epson scanner. I've encountered most of the quirks you mentioned here, though I've just worked around them with my particular workflow. The "found marker 0xd9" I believe is fairly harmless. I think this happens because the stream of JPEG data from the scanner gets truncated as soon as the end of the paper is detected. I never dug any deeper into this issue as it didn't appear to hurt the output of the scans at all. I get the same 8.5 x 14 inch output with white area as the excess. In fact, with my ADF area fixes in place, I get a much larger (8.5 x 72 inch) file. I only use this scanner as a receipt scanner, and I have a little python script that trims the scans down to size automatically, so this issue never bothered me enough to fix within SANE. I seem to recall that the SANE APIs might make retroactively resizing the scan area a little awkward to do, but I'm sure it's possible. The "out of documents" error I believe is related to the sane_cancel bug I fixed in my merge request here: https://gitlab.com/sane-project/backends/-/merge_requests/753 I rebased it recently(ish), so hopefully it still builds. Give that a try and see if it at least fixes the "out of documents" error. --Sean
