[sane-devel] Epson Perfection 610 Issue with 150 dpi scan

Rainer Dorsch rdorsch at web.de
Sun Jan 3 14:14:38 UTC 2010


Hi Alessandro,

thank you for the quick reply.

Am Sonntag, 3. Januar 2010 schrieb Alessandro Zummo:
> On Sun, 3 Jan 2010 14:01:15 +0100
>
> Rainer Dorsch <rdorsch at web.de> wrote:
> > I was not aware that there is an epson2 backend, thanks for pointing that
> > out. You are right, twelve pixels rows are missing in the final result
> > compared to the epson2 backend prediction. I try to play with the y
> > parameter this afternoon. I would be surprised though if that would be
> > the problem since the 300 dpi scan does work.
>
>  Maybe there's an unspotted error somewhere, the perfection
> 610 is a tricky scanner and there are some sections of the driver
> dedicated to its handling.
>
>  However, I was unable to test it personally since I do not
> own such a scanner.

If remote access is sufficient, I could give you (at least for a limited time 
access to a machine with such a scanner). I can also try to look through the 
code myself, but if you think you would spend more time in explaining than 
you would need to test yourself, I am happy to give you access.

>  If you search for "color shuffle" in the code you'll see
> that the scan area gets modified for the 610 because the color
> shuffling algorithm will eat some data.

Are these the areas in epson2.c you are refering to:

        /*
         * Make sure that the number of lines is correct for color shuffling:
         * The shuffling alghorithm produces 2xline_distance lines at the
         * beginning and the same amount at the end of the scan that are not
         * useable. If s->params.lines gets negative, 0 lines are reported
         * back to the frontend.
         */
        if (s->hw->color_shuffle) {
                s->params.lines -= 4 * s->line_distance;
                if (s->params.lines < 0)
                        s->params.lines = 0;

                DBG(1, "adjusted params.lines for color_shuffle by %d 
to %d\n",
                    4 * s->line_distance, s->params.lines);
        }

        DBG(5, "resolution = %d, preview = %d\n",
            s->val[OPT_RESOLUTION].w, s->val[OPT_PREVIEW].w);

        DBG(5, "get para %p %p tlx %f tly %f brx %f bry %f [mm]\n",
            (void *) s, (void *) s->val, SANE_UNFIX(s->val[OPT_TL_X].w),
            SANE_UNFIX(s->val[OPT_TL_Y].w), SANE_UNFIX(s->val[OPT_BR_X].w),
            SANE_UNFIX(s->val[OPT_BR_Y].w));

and

        /* allocate buffers for color shuffling */
        if (dev->color_shuffle == SANE_TRUE) {
                int i;
                /* initialize the line buffers */
                for (i = 0; i < s->line_distance * 2 + 1; i++) {

                        if (s->line_buffer[i] != NULL)
                                free(s->line_buffer[i]);

                        s->line_buffer[i] = malloc(s->params.bytes_per_line);
                        if (s->line_buffer[i] == NULL) {
                                DBG(1, "out of memory (line %d)\n", __LINE__);
                                return SANE_STATUS_NO_MEM;
                        }
                }
        }

I think a first good step would be to enable debug output.

How can I enable the output in DBG() from scanimage ?

>  For such a scanner, I'd suggest to scan a bigger area
> and then refine by software.

I to now worry a lot about the 2-3 mm missing in the scan (12 lines at 
150dpi), the problem is that the pnm file is broken and most programs reject 
to work with it. E.g. gscan2pdf uses convert from imagemagick to generate 
pdfs. But that all only works it the pnm files are correct and not corrupted. 
For me a fix which at least generates correct pnm files would be fine.

Thanks,
Rainer


-- 
Rainer Dorsch
Lärchenstr. 6
D-72135 Dettenhausen
07157-734133
email: rdorsch at web.de
jabber: rdorsch at jabber.org
GPG Fingerprint: 5966 C54C 2B3C 42CC 1F4F  8F59 E3A8 C538 7519 141E
Full GPG key: http://pgp.mit.edu/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20100103/0d75eae0/attachment-0001.pgp>


More information about the sane-devel mailing list