Re: Mustek 600 IIN color patch

Henning Meier-Geinitz (henningmg@gmx.de)
Sun, 28 Nov 1999 17:26:43 +0100

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii

Hi,

> Mr. Meier-Geinitz, thank you very much for your fast reply on my
> question.
> Unfortunaley, the problem seams to continue to exist even thought I have
> applied the patch.
> There was however some problems when I patched it:
>
> "patching file 'backend/mustek.c'
> Hunk #1 succeeded at 1873 with fuzz 1 (offset 479 lines)
> Hunk #2 FAILED at 1883
> Hunk #3 FAILED at 1900
> 2 out of 3 hunks FAILED -- saving rejects to backend/mustek.c.rej"

The patch was against an older version of sane but works for me:

hmg1:/usr/src/sane-1.0.1 # patch -p1 <../dev-sane/sane7.dif
patching file backend/mustek.c
Hunk #1 succeeded at 1873 (offset 479 lines).
Hunk #2 succeeded at 1404 with fuzz 2.
Hunk #3 succeeded at 1906 (offset 485 lines).

I will try to make a new patch and attach it to this mail. Possibly
the old one didn't work because of some blank/tab problems with copy
and paste. Try to save the patch directly from the mail.

> I have tried to change the strip height but that don't seam to help
> (first I thought the I/O card was to slow but it don't seam to be the
> case, more likley some kind of strange behavior in the backend when it
> is supposed to put the colors togehter to one picture?)

The backend's line distance correction is wrong for this firmware
version. So the lines get all mixed up.

> Is there any hope that this ever will work? (Btw, can I be sure that a
> 'make install' will write over all previous installed version of the
> same sane (1.0.1-3) or do I have to remove them manually?)

If you use the standard tar.gz it will overwrite the libraries and
binaries. It won't overwrite the .conf files. Precompiled packages
(e.g. rpms) will possibly use other directories so they won't be
overwritten.

If I change something in the source code I will just do "make clean;
make; make install".

> Is it my scanner that is being evil or is it just not compatible with
> SANE?

Both :-) But it should work with the patch applied. If you read the
archives carefully some could manage to use this scanner.

Bye, Henning

--h31gzZEtNLTqOjlF
Content-Type: text/plain; charset=us-ascii
Content-Description: patch file for sane 1.0.1
Content-Disposition: attachment; filename="sane8.dif"

diff -ru sane-1.0.1/backend/mustek.c sane-1.0.1.patched/backend/mustek.c
--- sane-1.0.1/backend/mustek.c Sat Apr 3 07:02:21 1999
+++ sane-1.0.1.patched/backend/mustek.c Sun Nov 28 17:11:36 1999
@@ -1873,7 +1873,7 @@
}
}

- num_saved_lines = s->ld.index[0] - s->ld.index[2];
+ num_saved_lines = s->ld.index[0] - s->ld.index[1];
if (num_saved_lines > 0)
/* restore the previously saved lines: */
memcpy (out, s->ld.buf[0], num_saved_lines * bpl);
@@ -1883,10 +1883,10 @@
if (++s->ld.lmod3 >= 3)
s->ld.lmod3 = 0;

- c = color_seq[s->ld.lmod3];
+ c = s->ld.lmod3;
if (s->ld.index[c] < 0)
++s->ld.index[c];
- else if (s->ld.index[c] < s->params.lines)
+ else /*if (s->ld.index[c] < s->params.lines)*/
{
s->ld.quant[c] += s->ld.peak_res;
if (s->ld.quant[c] > s->ld.max_value)
@@ -1906,17 +1906,17 @@
DBG (1, "fix_line_distance_pp: lmod3=%d, index=(%d,%d,%d)\n",
s->ld.lmod3,
s->ld.index[0], s->ld.index[1], s->ld.index[2]);
- num_lines = s->ld.index[2] - s->ld.ld_line;
+ num_lines = s->ld.index[1] - s->ld.ld_line;

/* copy away the lines with at least one missing
color component, so that we can interleave them
with new scan data on the next call */
- num_saved_lines = s->ld.index[0] - s->ld.index[2];
+ num_saved_lines = s->ld.index[0] - s->ld.index[1];
memcpy (s->ld.buf[0], out + num_lines * bpl,
num_saved_lines * bpl);

/* notice the number of lines we processed */
- s->ld.ld_line = s->ld.index[2];
+ s->ld.ld_line = s->ld.index[1];
/* return number of complete (r+g+b) lines */
return num_lines;
}
Only in sane-1.0.1.patched/backend: mustek.c.orig

--h31gzZEtNLTqOjlF--

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