[sane-devel] Behavior when sane_read() returns SANE_STATUS_EOF?

Matto Marjanovic maddog at mir.com
Tue Feb 25 16:36:51 GMT 2003


Hiya, all,

I've got a question which isn't directly addressed by the API docs:

Suppose a scan is set-up and initiated, and sane_parameters() returns
 a definite value for 'lines' (i.e., not -1).  What should a backend
 do if, before that number of lines is delivered, sand_read() returns
 with SANE_STATUS_EOF?  Will/should the frontend abort the scan, or
 gracefully truncate the output?  (Or fill the remaining output with
 black/white?)

I understand that in the 'lines <= -1' case, it is explicit that the
 frontend should call sane_read() until an EOF occurs.

I guess another version of my question is:  If the backend cannot be
 *certain* that it will deliver 'lines' lines of data, is it required
 to set 'lines' to -1?  (Or, can/should it provide the optimistic
 intended image size, which assumes that the paper is long enough?)

-matt m.



More information about the sane-devel mailing list