[sane-devel] scanadf not generating PNM images
Sean Darcy
seandarcy2 at gmail.com
Thu May 3 15:30:02 UTC 2012
On Mon, Apr 30, 2012 at 1:48 PM, m. allan noah <kitno455 at gmail.com> wrote:
> scanadf is basically deprecated. does scanimage work?
>
> allan
>
> On Mon, Apr 30, 2012 at 1:26 PM, sean darcy <seandarcy2 at gmail.com> wrote:
>> On 04/30/2012 02:12 AM, Jeffrey Ratcliffe wrote:
>>>
>>> On 29 April 2012 21:27, sean darcy<seandarcy2 at gmail.com> wrote:
>>>>
>>>> scanadf is generating images that aren't PNM. Maybe the it's generating
>>>> raw?
>>>> Shouldn't it be generating a PNM file? Is there an option to have it
>>>> generate a PNM file?
>>>
>>>
>>> I think this is problem with the backend not sending enough data -
>>> i.e. the backend reports via params that a scan of n x m should
>>> appear, and therefore the frontend writes the appropriate PNM header,
>>> plus all the data it gets until it gets EOF, but that the x bytes that
>>> appear don't make up n x m.
>>>
>>> Any post processing tools than complain that the PNM is not valid.
>>>
>>> I've had to put a workaround in the development version of gscan2pdf
>>> to pad the end of the file with whitespace in order to get a valid
>>> PNM.
>>>
>>> Regards
>>>
>>> Jeff
>>>
>>
>> I don't think that's the problem here. I looked at the scan file with a hex
>> editor. All zeros. No magic number, no x or y.
>>
>> sean
>>
>>
Thanks for offering to help. I've attached the output [not sent to
mailing list] from this command line:
scanadf -vvv -x 215.9 -y 100 --mode gray -d "brother2:net1;dev0" -r
100 -o "/opt/scan/tmp/test-scan"
scanadf: value for --br-x is: 215.9
scanadf: value for --br-y is: 100
scanadf: rounded value of br-x from 215.9 to 215.88
scanadf: rounded value of br-y from 100 to 99.9908
scanadf: scanning image of size 1664x786 pixels at 1 bits/pixel
scanadf: acquiring gray frame
Scanned document /opt/scan/tmp/test-scan
Scanned 1 pages
As you suggested, I tried scanimage:
scanimage -vvv --format pnm -x 215.9 -y 279.4 --mode gray -d "$device"
--resolution 400 --batch="$BASE/tmp/$FileName"_%04d.pnm -p --source
"Automatic Document Feeder"
And that worked.
So I'll just use scanimage. I hadn't realized scanadf was deprecated.
sean
More information about the sane-devel
mailing list