I think I solved it, and it has to do with the maxlen param on the read(). If I use (0) it fails but if I use 32768 it works. On other scanners the 0 is equivalent to the maxlength but in the PNM it seems to need to be explicit.
-- Alejandro Imass On Fri, Nov 2, 2012 at 3:01 PM, Alejandro Imass <aimass at p2ee.org> wrote: > On Fri, Nov 2, 2012 at 1:04 PM, m. allan noah <kitno455 at gmail.com> wrote: >> Can you try to get some debug logs of the backend, to compare the two >> programs? >> >> SANE_DEBUG_PNM=255 scanimage ... 2> scanimage.log >> SANE_DEBUG_PNM=255 perlprog ... 2> perlprog.log >> >> Maybe the perl code needs an additional call somewhere, or maybe there >> is a bug in the backend. >> > > Here are the logs. > > It seems there is an additional call to sane_get_parameters after the > sane_start in the scanimage case, and a couple of control options at > the beginning, but appart from that there is not much difference. I am > also attaching the Perl code to see if we are missing something here. > > Thanks! > > -- > Alejandro Imass