New ScanMaker X6 EL patch for pre1.01-4

Scott Wells (swells@vignette.com)
Tue, 6 Apr 1999 14:57:02 -0500

I tried the patch from the mailing list and I was still getting green tones
on my previews. It turns out that my revision is 1.10 (I bought this
scanner almost exactly when it was released) and the patch only checked for
1.30. Here's a new patch, but a more general solution is probably needed:

========== Cut here - microtek2.patch ==========
*** microtek2.c Tue Apr 6 14:53:06 1999
--- microtek2.c.new Tue Apr 6 14:53:06 1999
***************
*** 1843,1853 ****
pad = (int) ceil( (double) (ms->ppl * bits_pp_in) / 8.0 ) % 2;
bpp = bits_pp_out / 8;

! /* The ScanMaker 636 has 3 * ppl + 6 bytes per line and the X6EL */
! /* 3 * ppl + 2 bytes per line (depth=8, even number of pixels), which
*/
! /* can not be explained by the documentation; bpl_ppl_diff corrects
this */
! if (mi->model_code == 0x91
! && (md->revision == 1.10 || md->revision == 1.20))
bpl_ppl_diff = ms->bpl - ( 3 * ms->ppl * bpp );
else
bpl_ppl_diff = ms->bpl - ( 3 * ms->ppl * bpp ) - pad;
--- 1843,1859 ----
pad = (int) ceil( (double) (ms->ppl * bits_pp_in) / 8.0 ) % 2;
bpp = bits_pp_out / 8;

! /* Some models have 3 * ppl + 6 bytes per line if the number of pixels
*/
! /* per line is even and 3 * ppl + 3 bytes per line if the number of */
! /* pixels per line is odd. According to the documentation it should be
*/
! /* bpl = 3*ppl (even number of pixels) or bpl=3*ppl+1 (odd number of
*/
! /* pixels. Even worse: On different models it different at which */
! /* position in a scanline the image data starts. bpl_ppl_diff tries */
! /* to fix this */
! if ( (mi->model_code == 0x91
! && (md->revision == 1.10 || md->revision == 1.20))
! || (mi->model_code == 0x98
! && (md->revision == 1.10 || md->revision == 1.30) ) )
bpl_ppl_diff = ms->bpl - ( 3 * ms->ppl * bpp );
else
bpl_ppl_diff = ms->bpl - ( 3 * ms->ppl * bpp ) - pad;
================================================

To apply it just cd into sane-pre1.01/backend and type:

$ patch < microtek2.patch

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com