[sane-devel] genesys_gl847 scanners produce a black band in scanned images (github issue #7)

Robert A. Schmied uwppp at flash.net
Tue Dec 25 21:31:35 GMT 2018


sane genesys code experts and maintainers:

the fix noted in this thread that restores the use of
the slow_back_home function instead of the rewind function
for genesys_gl847 chipsets when combined with Povilas Kanapickas
mergereq 10 for lide80 fix which changes the 'target_code'
to 0xe000 and applied to the lide 200 have corrected all the problems
i've noted with that scanner.  specifically the 'black bar' problem,
the issue i encountered with resolution of 300 dpi and greater where
the image was 'stretched' in the y axis plus the generally
poor contrast between the paper itself and the printed text.

i have made 8 scanimage runs with varying values of mode,
resolution and depth and believe these changes have corrected
all issues note here and by me previously for the lide200 flatbed.

thank you all for the diagnoses and corrections.  i provide diffs
of the changes as i've implemented them for reference.

happy new year to all.


aloha

ras


the change to ./backend/genesys_gl847.c simply removes the
gl847_rewind function.

for reference the following diff for backend/genesys.c include
the slow_back_home and the target_code changes and is based on
the sane-backends-1.0.27 baseline:
===================================================================
RCS file: backend/genesys.c,v
retrieving revision 1.2
diff -uBitwb -r1.2 backend/genesys.c
--- backend/genesys.c   2018/10/24 18:29:01     1.2
+++ backend/genesys.c   2018/12/25 01:38:00
@@ -2070,11 +2070,17 @@
   dev->model->cmd_set->set_lamp_power (dev, dev->calib_reg, SANE_TRUE);
   dev->model->cmd_set->set_motor_power (dev->calib_reg, motor);
 
-  /* if needed, go back before doin next scan, by using rewind, registers and
-   * slopes table are kept intact from previous scan */
-  if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK && dev->model->cmd_set->rewind)
+  /* if needed, go back before doing next scan */
+  if (dev->model->flags & GENESYS_FLAG_SHADING_REPARK)
     {
-      status = dev->model->cmd_set->rewind (dev);
+      /* rewind keeps registers and slopes table intact from previous
+         scan but is not available on all supported chipsets
+         (or may cause scan artifacts, see #7)
+         slow_back_home is used if rewind is not supported
+      */
+      status = (dev->model->cmd_set->rewind
+                ? dev->model->cmd_set->rewind (dev)
+                : dev->model->cmd_set->slow_back_home (dev, SANE_TRUE));
     }
 
   status =
@@ -3066,6 +3072,9 @@
         && dev->model->ccd_type!=CIS_CANONLIDE120
         && dev->model->ccd_type!=CIS_CANONLIDE220)
           target_code=0xdc00;
+        /* ras hack based on Povilas Kanapickas mergereq 10 for lide80 */
+        else if ( dev->model->ccd_type == CIS_CANONLIDE200 )
+          target_code = 0xe000;    /* for canon lide 200 */
         else
           target_code=0xf000;
         words_per_color=pixels_per_line*2;



i contribute the following trivial rcsdiff -ubitwB for the
scanimage man page documenting scan-area unit specifications
===================================================================
RCS file: doc/scanimage.man,v
retrieving revision 1.1
diff -uBitwb -r1.1 doc/scanimage.man
--- doc/scanimage.man   2018/12/25 19:07:04     1.1
+++ doc/scanimage.man   2018/12/25 20:45:24
@@ -316,9 +316,19 @@
 value in square brackets indicates that the current option value is 0
 mm. Most backends provide similar geometry options for top-left y position (\-t),
 width (\-x) and height of scan-area (\-y).
+.sp
+The default units are millimeters, other units can be used
+when the unit is explicitly specified as follows:
+.nf
+.na
+    mm  --  optional, the default
+    cm  --  centimeters
+    in  --  inches
+    "   --  inches [on command line escape the " char]
+.fi
+.ad
 .RE
 
-
  \-\-brightness \-100..100% [0]
 .br
     Controls the brightness of the acquired image.



Olaf Meeuwissen wrote:
> Hi Fermulator,
> 
> Fermulator writes:
> 
> 
>>Good day experts
>>
>>Looking to address sane-backend dev with expertise in the genesys code
>>area.
>>
>>As per:
>> * https://bugs.launchpad.net/ubuntu/+source/sane-backends/+bug/1731459
>> * https://gitlab.com/sane-project/backends/issues/7
>>
>>I'd like to raise attention to this bug - it has hit countless users
>>of the Canon IDE scanner beds;
>>
>>What we know:
>> * downgrading to 1.0.25 fixes the issue
>> * I believe I isolated the delivery/change to : https://gitlab.com/sane-project/backends/commit/bd0b0cd218504868f32962a5558449956c8ce242
>>
>>However, there is insufficient context/comments in that commit for me
>>to understand if we can just revert that change or not. (i.e. was it
>>delivered as an optimization? or to fix some other suite of hardware?
>>...)
>>
>>Looking for guidance.
> 
> 
> No expertise with the genesys backend, but push a branch with a
> potential fix, followed up on the issue (#7) and submitted a merge
> request (!34).  Waiting for test results as you have probably already
> noticed from the GitLab notification(s).
> 
> BTW, the merge request is at
> 
>   https://gitlab.com/sane-project/backends/merge_requests/34
> 
> Hope this helps
> --
> Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
>  GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
>  Support Free Software                        https://my.fsf.org/donate
>  Join the Free Software Foundation              https://my.fsf.org/join
> 




More information about the sane-devel mailing list