On Tue, 18 Aug 2009 09:40:05 -0400
"m. allan noah" <kitno455 at gmail.com> wrote:

> > In libksane I try to figure out a suitable scanning resolution by starting 
> > with
> > 100 DPI, increasing the DPI with 100 until I reach 300 pixels height or 
> > width.
> > The problem with epson2 is that the "pixels_per_line" parameter returned by
> > sane_get_parameters() is always 0. This means that the hard-coded limit of 
> > 900
> > DPI is always reached (or the closest one).
> >
> > From the standard I understood that the value would be "best-effort 
> > estimates"
> > before scan_start().  
> 
> Yes- the backend should make an attempt to at least guess the width of
> the scan prior to sane_start(). Does the original epson backend do
> this?

 Hi,

 this is code from epson.c

  s->params.pixels_per_line =
  SANE_UNFIX (s->val[OPT_BR_X].w - s->val[OPT_TL_X].w) / 25.4 * ndpi + 0.5;

 and this is from epson2.c

  s->params.pixels_per_line =
  (SANE_UNFIX(s->val[OPT_BR_X].w - s->val[OPT_TL_X].w) / (MM_PER_INCH * dpi) ) 
+ 0.5;
                                                         ^                 ^  
 they're almost the same except for a parenthesis that changes the
 order in which the operators are applied.

 can you check if changing to 

  s->params.pixels_per_line =
  ((SANE_UNFIX(s->val[OPT_BR_X].w - s->val[OPT_TL_X].w) / MM_PER_INCH) * dpi ) 
+ 0.5;
  
  resolves your issue?

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


Reply via email to