[sane-devel] [PATCH] Fix epson2 driver problem with color shuffling using an Epson Perfection 610
Martin Krüger
martin.krueger at gmx.com
Wed Jun 20 21:26:15 UTC 2012
# HG changeset patch
# User Martin Krüger <martin.krueger at gmx.com>
# Date 1340227497 -7200
# Node ID d0e710afdc035dfb05f2b9e8a6898ca44ce6a42a
# Parent 99d490b6ca089eb4240793af8f19460748b94f3e
Fix epson2 driver problem with color shuffling using an Epson Perfection 610
Using xsane to aquire an preview-scan over the full plane in color mode
fails. If you aquire an preview in bw/grayscale-Mode or over a part of
the plain works well. The extra lines added dont fit in the scan-plane.
The scanner fails to start with an invalid argument.
This is a port of the corresponding check in the epson driver:
No color shuffling if not enough space on the plane.
diff -r 99d490b6ca08 -r d0e710afdc03 backend/epson2-ops.c
--- a/backend/epson2-ops.c Tue Jun 19 23:58:44 2012 +0000
+++ b/backend/epson2-ops.c Wed Jun 20 23:24:57 2012 +0200
@@ -1212,6 +1212,15 @@
unsigned int lines = s->params.lines + (2 * s->line_distance);
int top = s->top - (1 * s->line_distance);
+ /*
+ * If (top + s->params.lines) is larger than the max scan area, reset
+ * the number of scan lines:
+ */
+ if (SANE_UNFIX (s->val[OPT_BR_Y].w) / 25.4 *s-> val[OPT_RESOLUTION].w < ( lines + top)){
+ top=s->top;
+ lines=s->params.lines;
+ }
+
if (top < 0)
top = 0;
More information about the sane-devel
mailing list