Hi, all. I recently picked up an Epson ES-50 sheet-feed scanner. My intent is to use it for receipt scanning, so I tried it out with a ~700 mm long receipt and found that it would error out at around 450 mm into the scan. The manual claims the scanner is capable of a max of 72 inch document length, so I started poking around in the epsonds backend code. Something that jumped out at me was the eds_set_adf_area function. It seems that for this particular scanner, three ADF size values are reported: AREA, AMIN, and AMAX (in epsonds-cmd.c around line 445 on current git master). The eds_set_adf_area function is called with the values from AREA, which limits the document length to 14 inches. I'm assuming AREA is just meant to be a default value, but if anyone has any deeper insight into the meaning, I'd be interested to know.
The AMAX values reported seemed to match the manual's reported 72-inch maximum, so on a whim, I just moved the eds_set_adf_area call to the AMAX section. After recompiling, I was able to scan my long receipt no problem. Now I'm wondering if there is any downside to using the max ADF size? If not, would you consider the attached patch? Thanks, --Sean
diff --git a/backend/epsonds-cmd.c b/backend/epsonds-cmd.c index d1cba0915..6685b3699 100644 --- a/backend/epsonds-cmd.c +++ b/backend/epsonds-cmd.c @@ -448,7 +448,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len) int max = decode_value(value + 4 + 8, 8); DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max); - eds_set_adf_area(s->hw, min, max, 100); } if (strncmp("AMIN", value, 4) == 0) { @@ -465,6 +464,7 @@ static SANE_Status info_cb(void *userdata, char *token, int len) int max = decode_value(value + 4 + 8, 8); DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max); + eds_set_adf_area(s->hw, min, max, 100); } } @@ -481,8 +481,6 @@ static SANE_Status info_cb(void *userdata, char *token, int len) int max = decode_value(value + 4 + 4, 8); DBG(1, " ADF: area %dx%d @ 100dpi\n", min, max); - - eds_set_adf_area(s->hw, min, max, 100); } if (strncmp("AMAX", value, 4) == 0) { @@ -493,6 +491,7 @@ static SANE_Status info_cb(void *userdata, char *token, int len) int max = decode_value(value + 4 + 4, 8); DBG(1, " ADF: max %dx%d @ 100dpi\n", min, max); + eds_set_adf_area(s->hw, min, max, 100); } }