[sane-devel] Perl Bindings

Jeffrey Ratcliffe jeffrey.ratcliffe at gmail.com
Tue Nov 11 20:11:47 UTC 2008


I've finished transliterating scanimage and scanadf into Perl.
Everything works as in the original apart from a funny discrepancy:

$ scanimage -d test -t 1 -l 2 -x 21 -y 32 --batch-count=2 -v -v -v

gives me in 1.0.19:

scanimage: value for --tl-y is: 1
scanimage: value for --tl-x is: 2
scanimage: value for --br-x is: 21
scanimage: value for --br-y is: 32
scanimage: rounded value of br-x from 23 to 23
scanimage: rounded value of br-y from 33 to 33
Scanning 2 pages, incrementing by 1, numbering from 1
Scanning page 1
scanimage: scanning image of size 41x62 pixels at 8 bits/pixel
scanimage: acquiring gray frame
scanimage: min/max graylevel value = 255/0
scanimage: read 2542 bytes in total
Scanned page 1. (scanner status = 5)
Scanning page 2
scanimage: scanning image of size 41x62 pixels at 8 bits/pixel
scanimage: acquiring gray frame
scanimage: min/max graylevel value = 255/0
scanimage: read 2542 bytes in total
Scanned page 2. (scanner status = 5)
Closing device
Calling sane_exit
scanimage: finished

Ignoring the fact that the verbose output for --br-x and --br-y should
be for x and y,

scanimage: rounded value of br-x from 23 to 23
scanimage: rounded value of br-y from 33 to 33

a. weren't 23 and 33 to start with
b. weren't rounded.

What's going on? I ask, because the Perl version, which I wrote to be
as near to identical as possible, doesn't show this behaviour, and
therefore ends up with a smaller image. In C, it is almost as if the
--tl-y and --tl-x values are getting added twice.

Regards

Jeff



More information about the sane-devel mailing list