sane-project-website/old-archive/2000-03/0327.html

175 wiersze
6.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: xscanimage, xsane and 3-pass scanners</TITLE>
<META NAME="Author" CONTENT="Henning Meier-Geinitz (hmg-ml@gmx.de)">
<META NAME="Subject" CONTENT="xscanimage, xsane and 3-pass scanners">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>xscanimage, xsane and 3-pass scanners</H1>
<!-- received="Fri Mar 31 12:58:38 2000" -->
<!-- isoreceived="20000331205838" -->
<!-- sent="Fri, 31 Mar 2000 22:56:33 +0200" -->
<!-- isosent="20000331205633" -->
<!-- name="Henning Meier-Geinitz" -->
<!-- email="hmg-ml@gmx.de" -->
<!-- subject="xscanimage, xsane and 3-pass scanners" -->
<!-- id="20000331225633.A25457@hmg1.vortex.swb.de" -->
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:hmg-ml@gmx.de?Subject=Re:%20xscanimage,%20xsane%20and%203-pass%20scanners&In-Reply-To=&lt;20000331225633.A25457@hmg1.vortex.swb.de&gt;"><EM>hmg-ml@gmx.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Fri Mar 31 2000 - 12:56:33 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0328.html">Peter Kirchgessner: "Re: SYM22801 &amp; HP Scanjet 5P Sane problems..."</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0326.html">Rogier Stam: "Re: SYM22801 &amp; HP Scanjet 5P Sane problems..."</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#327">[ date ]</A>
<A HREF="index.html#327">[ thread ]</A>
<A HREF="subject.html#327">[ subject ]</A>
<A HREF="author.html#327">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hi,
<BR>
<P>at the moment I am trying to look at the problems reported for Mustek 3-pass
<BR>
scanners in color mode. I am using a MFS-12000CX scanner and lineart/gray
<BR>
works fine.
<BR>
<P>Color mode, however, results in endless error messages after the 3rd (blue)
<BR>
frame is scanned (both in xscanimage and xsane). The message is something
<BR>
like &quot;Error during read: scan was cancelled&quot;. This doesn't occur if
<BR>
non_blocking mode is disabled in the backend.
<BR>
<P>I think the problem is in the frontends (correct me if I am wrong). The next
<BR>
paragraphs are about xscanimage but I think it's the same with xsane.
<BR>
<P>At the start of the scan &quot;scan_start&quot; is called. &quot;input_available&quot; does the
<BR>
reading of data and calls &quot;scan_start&quot; recursively until all 3 frames are
<BR>
finished. At the end of &quot;scan_start&quot; &quot;input_available&quot; is called directly,
<BR>
if the backend doesn't support non-blocking mode. That does work. However,
<BR>
in the case of non-blocking mode, gdk_input_add is used to let gdk look at
<BR>
the sane filedescriptor. However, gdk_input_add is called once for each
<BR>
frame (3 times in total) and at the end of the scan only one instance is
<BR>
killed (in &quot;scan_done&quot;).
<BR>
<P>&nbsp;&nbsp;scan_win.input_tag = -1;
<BR>
&nbsp;&nbsp;if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp; sane_get_select_fd (dev, &amp;fd) == SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;scan_win.input_tag = gdk_input_add (fd, GDK_INPUT_READ |
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GDK_INPUT_EXCEPTION, input_available, 0);
<BR>
&nbsp;&nbsp;else
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;input_available (0, -1, GDK_INPUT_READ);
<BR>
<P>As a quick hack I did the following:
<BR>
<P>&nbsp;&nbsp;if (sane_set_io_mode (dev, SANE_TRUE) == SANE_STATUS_GOOD
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp; sane_get_select_fd (dev, &amp;fd) == SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (scan_win.param.format != SANE_FRAME_GREEN
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp; scan_win.param.format != SANE_FRAME_BLUE)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scan_win.input_tag = gdk_input_add (fd, GDK_INPUT_READ |
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GDK_INPUT_EXCEPTION, input_available, 0);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
&nbsp;&nbsp;else
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scan_win.input_tag = -1;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input_available (0, -1, GDK_INPUT_READ);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
<P>This works for me. However, it is quite ugly and I don't know if the red
<BR>
frame is the first in every case. So I think, it would be better to have a
<BR>
flag for the first frame and don't use gdk_input_add for the others.
<BR>
<P>Another point: Don't try to scan an image with a 3-pass scanner into a pnm
<BR>
file on a NFS disc. It is extremely slow (about 2k per second!), probably
<BR>
because of the method used to put the three frames in the pnm file (write
<BR>
one byte, fseek two bytes, write one byte ...).
<BR>
<P>One more point: The TODO file is right about the progress bar not reaching
<BR>
100% at the end of each frame.
<BR>
<P>I tried to use the 3-pass scanner with scanimage but hadn't any luck because
<BR>
the scan stops before the first frame gets read (sane_cancel is called). I
<BR>
will look into this tomorrow.
<BR>
<P>Bye, Henning
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20xscanimage,%20xsane%20and%203-pass%20scanners&In-Reply-To=&lt;20000331225633.A25457@hmg1.vortex.swb.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0328.html">Peter Kirchgessner: "Re: SYM22801 &amp; HP Scanjet 5P Sane problems..."</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0326.html">Rogier Stam: "Re: SYM22801 &amp; HP Scanjet 5P Sane problems..."</A>
<!-- nextthread="start" -->
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#327">[ date ]</A>
<A HREF="index.html#327">[ thread ]</A>
<A HREF="subject.html#327">[ subject ]</A>
<A HREF="author.html#327">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Fri Mar 31 2000 - 12:59:52 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>