[sane-devel] Patch to fix all autocalibration problems on CanoScan LiDE

Monty xiphmont@xiph.org
Fri, 15 Aug 2003 15:30:04 -0400

Hello folks,

[This message didn't appear on the list after a day first submission;
trying again]


The plustek backend's autocalibration code is broken, at least in the
case of the CanoScan LiDE scanners. Not a single one of the four
calibration steps actually works (found this the hard way by fixing
each in sequence and finding the next didn't work either ;-)

I've approached this patch by implementing a parallel calibration path
for CanoScan LiDE-like scanners.  The reason is that I only have
access to CanoScan LiDEs and the plustek driver supports many
subcategories of scanner implementation based on the three chipset
family.  I could only test one of the numerous permutations.  Although
the stock autocalibration in plustek-usbshading appears buggy, I
didn't want to accidentally make things work for people relying on
other scanners it supports.  First rule: do no harm.

The patch as submitted is used by default for the LiDE20 and 30. It
always performs all calibration steps as the LiDE scanners are pretty
darned crummy without (and function very well with).  For testing
purposes, I've also added a plustek.conf option 'altCalibrate' to
force the alternate calibration path for other scanner models for
testing purposes.  

The patch is tested on big and little endian and avoids endianness
bugs in the stock calibration code.

This patch applies cleanly against vanilla sane-backends 1.0.12, the
patched Debian version of 1.0.12 and 1.0.12 plus Gerhard's most recent
plustek backend updates.  It is minimally invasive to the rest of the
plustek driver.

The patch can be found at http://www.xiph.org/xiphmont/canoscan/
along with a 'before the patch' jpeg and an 'after the patch jpeg'.
Both jpegs were scanned at 100dpi with identical settings and no
plustek.conf settings beyond [usb] and device.

Given that the LiDEs are decent [if very vanilla], well behaved
scanners currently selling for $35 [!] new, I hope this will benefit
quite a few users.  The patch has already sold three new scanners in
the #sane channel in two days :-)