[sane-devel] PIXMA: 1 Bit B/W Lineart for pixma_mp150 and pixma_mp810 Subdrivers
ibu ☉ radempa ䷰
ibu at radempa.de
Sat Feb 4 20:48:52 UTC 2012
Rolf Bensch wrote:
> I just commited 1 bit B/W lineart for all scanners in the pixma_mp150
> and pixma_mp810 subdrivers to the git tree.
>
> Due to the fact that these ccd scanners doesn't support generic lineart,
> I implemented software-lineart. The graphic frontend (Xsane) provides a
> slider to set the threshold.
>
> pixma_mp810 subdriver has been tested well with these scanners:
>
> Canoscan 8800F
> Canoscan 9000F
> Canon Pixma MP810
> Canon Pixma MP960
>
> pixma_mp150 subdriver isn't tested yet. This code should run, because it
> is similar to the pixma_mp810 code and I compared the diff files.
>
> Please report other working scanners to the ML.
Hello Rolf,
thanks for the patch. I've tried it with a scanner in the pixma_mp150
series, Canon MX360, which is however not yet added to pixma_mp150.c,
and I'm therefore using this patch:
$ diff sane-backends/backend/pixma_mp150.c
sane-backends_changed/backend/pixma_mp150.c
142a143
> #define MX360_PID 0x174d
1197a1199
> s->cfg->pid == MX360_PID ||
1589a1592
> DEVICE ("Canon PIXMA MX360", "MX360", MX360_PID, 1200, 0, 0, 638,
1050, PIXMA_CAP_CIS | PIXMA_CAP_ADF),
With this patch my device is working in Gray an Color mode, although I
didn't manage to catch the ADF out of paper error (which leaves the
device in an unresponsive state and requires cumbersome restarting;
maybe somebody could give me a hint?).
Trying your patch in addition to mine, from
SANE_DEBUG_PIXMA=4 /usr/local/bin/scanimage -v -d pixma:04A9174D_XXXXXX
--resolution 75 --mode Lineart --threshold auto > /tmp/x.pnm
I get the following output, and scanning stops after part of the page:
...
[pixma] pixma_scan(): start
[pixma] line_size=640 image_size=70160 channels=1 depth=1
[pixma] dpi=75x75 offset=(0,0) dimension=640x877
[pixma] gamma_table=0xd7df30 source=0
[pixma] threshold=50
[pixma] ASSERT failed:pixma_common.c:798: s->cur_image_size <=
s->param->image_size
[pixma] BUG:ss->image_bytes_read > ss->sp.image_size
[pixma] ASSERT failed:pixma_common.c:798: s->cur_image_size <=
s->param->image_size
[pixma] pixma_read_image(): cancelled by software
[pixma] Reader task terminated: ECANCELED
scanimage: WARNING: read more data than announced by backend (71296/70160)
[pixma] pixma_close(): Canon PIXMA MX360
If in pixma_common.c instead of
sp->image_size /= 8;
I try
sp->image_size /= 1;
then the full area is scanned
...
[pixma] pixma_scan(): start
[pixma] line_size=640 image_size=561280 channels=1 depth=1
[pixma] dpi=75x75 offset=(0,0) dimension=640x877
[pixma] gamma_table=0x7daf30 source=0
[pixma] threshold=50
[pixma] pixma_read_image():completed
[pixma] Reader task terminated
scanimage: WARNING: read more data than announced by backend (561280/70160)
[pixma] pixma_close(): Canon PIXMA MX360
and the resulting file does obviously contain image data, but the bits
seem garbled, it is no usable image, while the pbm header seems ok.
(
When I scan in mode Gray it works fine:
[pixma] pixma_scan(): start
[pixma] line_size=638 image_size=559526 channels=1 depth=8
[pixma] dpi=75x75 offset=(0,0) dimension=638x877
[pixma] gamma_table=0x1fbcf30 source=0
[pixma] threshold=50
[pixma] pixma_read_image():completed
[pixma] Reader task terminated
scanimage: min/max graylevel value = 38/221
scanimage: read 559526 bytes in total
[pixma] pixma_close(): Canon PIXMA MX360
)
(I also tried with an old version of xsane, with similar results.)
Regards,
ibu
More information about the sane-devel
mailing list