sjamesr / jfreesane

Java API to talk to the SANE scanning daemon
Apache License 2.0
60 stars 24 forks source link

Fix a bug in acquireImage exception handling. #15

Closed sjamesr closed 9 years ago

sjamesr commented 9 years ago

Previously, a non-zero status to SANE_NET_START would cause JFreeSane to throw an exception as soon as the bad status was read from the input stream. The remaining bytes of SANE's response to the SANE_NET_START would remain on the stream, leaving JFreeSane in the wrong state to begin handling subsequent requests.

This was particularly evident in situations where you expect a non-zero scan result, e.g. in ADF scanning (where the last page will return a STATUS_NO_DOCS error).