[sane-devel] Why sane_read() always returns SANE_STATUS_GOOD?

abel deuring a.deuring@satzbau-gmbh.de
Sun, 27 Apr 2003 16:28:45 +0200


Peter Chen wrote:
> 
> Hi,
> 
> I will probably do more tests this afternoon. Since I am using kylix, it
> might be something wrong with kylix configuration.
> 
> I copied a lot of codes from scanimage, except I did not write the image to
> stdout like scanimage did. I could not make sane_start work properly if I
> called fopen() before sane_start(). Again, it might be something wrong with
> my kylix configuration.

Peter, it is a bit difficult to make guesses about possibles causes of
the problems you have with your frontend, when you don't give any
details. Most if not all Sane backends contain many debug statements.
While they are mainly intended to help finding bugs in the backend, they
can also be useful to find in bugs in frontends. And it would help if
you could provide at least excerpts from your sources, preferably
combined with the output of a few fprintf(stderr,...) statements placed
near the Sane API calls. With all this information, it will be easier to
get a clue, what goes wrong.

And I must emphazise Henning's hint to use the test backend. Some months
ago, I worked a bit on Andrew Kuchling's Python bindings for Sane. The
test backend was incredibly helpful. It is way faster than any real
scanner, it provides more types of options than any other Sane backend,
it allows to setup a number of uncommon cases, like choosing the number
of bytes received. Without all these test cases, my work on the the
Python Sane module would have been far less successful and would have
taken far more time.

Abel