[sane-devel] Some protocol questions

Ralph Little skelband at gmail.com
Mon Jun 12 00:37:47 BST 2023


Hi,
I am looking to get some advice about unusual scanning situations so 
that I can deal with them properly with my new backend and with some 
other work that I have planned:

1) sane_get_parameters() can return "lines" with a value of -1 to 
indicate that the length is not known in advance.
However, are there any well-known ways for a frontend to indicate that 
the backend should scan the "full length" of whatever media is currently 
loaded?

I am mainly thinking here of scanning a set of documents in an ADF that 
are all of different lengths. Perhaps the backend could supply a special 
option of "detected length" to indicate that a length will not be 
specified and whatever length of the loaded media will be accepted?

2) Related a little to 1), I have been looking at a problem in the 
epsonds backend in which it doesn't work properly with saned because it 
does the scan in a call to sane_get_parameters() so that it can provide 
an accurate length of the scan (having already performed the scan). 
However saned calls sane_start() *before* sane_get_parameters() which is 
perfectly legal. Indeed, no frontend *has* to call sane_get_parameters() 
at all. This breaks things somewhat. I feel that what epsonds is doing 
is a bit broken. So I would like to rework it to return -1 for the 
number of lines, preparing the frontend for an unknown length and 
perform the scan properly after sane_start() has been called. Comments?

Cheers,
Ralph




More information about the sane-devel mailing list