[sane-devel] xsane hpaio with ADF bug report and PATCH

m. allan noah anoah at pfeiffer.edu
Sat Sep 16 17:46:40 UTC 2006

quoting David Mosberger-Tang:

> In other words, the idea is to have sane_start() be called, and
> collect as many images as the frontend wants (which could in turn
> consist of multiple frames each as indicated by frame-type) and
> when the frontend is done, it should call sane_cancel().

this has subsequently been interpretted as:

* the following call sequence: sane_start; sane_read (repeat until
* EOF); sane_start; sane_read...  and then call sane_cancel if the
* batch is at an end. I.e. do not call sane_cancel during the run but
* as soon as you get a SANE_STATUS_NO_DOCS.

sane_cancel should only be called at the end of the batch, not between 
pages. XSANE is correct. i bet you are using scanimage from sane 
1.0.17 or before, as the version that is part of sane 1.0.18 no longer has 
this problem.

bug in hpaio, imho.


On Sat, 16 Sep 2006, Alex Eskin wrote:

> The attached one-line patch against xsane-0.991 is needed
> to get the automatic document feeder on my OfficeJet 5610
> to work with xsane. The problem is that xsane does not
> call "sane_cancel" after scanning a page from the ADF, and
> the page is then not properly ejected.
> scanimage already does the right thing and  works with my
> scanner. So I think the problem is with xsane. From looking
> at various mailing lists, it seems that it affects at least
> some of the other hpaio devices.
> Is this the right place to report this?
> --- src/xsane-scan.c.orig       2006-09-15 20:50:56.000000000 -0500
> +++ src/xsane-scan.c    2006-09-15 20:53:00.000000000 -0500
> @@ -1560,6 +1560,7 @@
>     DBG(DBG_info, "ADF mode end of scan: increment page counter and restart
> scan\n");
>     xsane.adf_page_counter += 1;
> +    sane_cancel(xsane.dev);
>     gtk_timeout_add(100, (GtkFunction)xsane_scan_dialog, NULL); /* wait 100ms
> then call xsane_scan_dialog(); */
>   }
>   else if ( ( (status == SANE_STATUS_GOOD) || (status == SANE_STATUS_EOF) ) &&
> (xsane.batch_loop  == BATCH_MODE_LOOP) )
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera

More information about the sane-devel mailing list