[sane-devel] OT: scanimage output format

Wolfgang Pichler wpichler@dialog-telekom.at
Mon, 27 Oct 2003 13:11:31 +0000

hi all,

for a webapplication i am calling scanimage the scan a contract in the
client scanner - i am calling it with
$fd = popen('SANE_DEFAULT_DEVICE="net:'.$client_ip.':plustek" scanimage
-l 0 -t 0 -x 210 -y 288 --mode Gray | pnmtopng','r');
$output = "";
while(!feof($fd)) {
	$output .= fread($fd, 1024);
pclose ($fd);
echo $output;

(the correct headers also get set before)

this already works.

But with that call the hole image gets scanned and that converted into
png format (so that the browser can read it). What I'd like is to get
scanimage to output the scan directly in png format (or a program which
can directly process the the data and convert it to png on the fly -
while the scan still runs) - so that while the scan runs the scan get
directly outputed on the client (so that the user can see the progress).
Is this possible ? And if its possible, how ?