sane-project-website/old-archive/2001-05/0294.html

150 wiersze
5.6 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: Re: Problems with Prisa 620S [snapscan] + BUG in xs</TITLE>
<META NAME="Author" CONTENT="Ben Stanley (bds02@uow.edu.au)">
<META NAME="Subject" CONTENT="Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76</H1>
<!-- received="Tue May 22 15:22:27 2001" -->
<!-- isoreceived="20010522222227" -->
<!-- sent="Wed, 23 May 2001 08:23:51 +1000" -->
<!-- isosent="20010522222351" -->
<!-- name="Ben Stanley" -->
<!-- email="bds02@uow.edu.au" -->
<!-- subject="Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76" -->
<!-- id="3B0AE6F7.8090301@uow.edu.au" -->
<!-- inreplyto="3B0A8DAA.3A68CF2B@rauch-domain.de" -->
<STRONG>From:</STRONG> Ben Stanley (<A HREF="mailto:bds02@uow.edu.au?Subject=Re:%20Problems%20with%20Prisa%20620S%20[snapscan]%20%2B%20BUG%20in%20xsane%200.76&In-Reply-To=&lt;3B0AE6F7.8090301@uow.edu.au&gt;"><EM>bds02@uow.edu.au</EM></A>)<BR>
<STRONG>Date:</STRONG> Tue May 22 2001 - 15:23:51 PDT
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0295.html">Ben Stanley: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0293.html">Ben Stanley: "Re: Maxi-scan A4 scanner (AGAIN!!!) under Mandrake 8.0 (2.4.3)"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0288.html">Oliver Rauch: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0290.html">Henning Meier-Geinitz: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#294">[ date ]</A>
<A HREF="index.html#294">[ thread ]</A>
<A HREF="subject.html#294">[ subject ]</A>
<A HREF="author.html#294">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Oliver Rauch wrote:
<BR>
<P><EM>&gt;Ben Stanley wrote:
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt;&gt;I read the sane.ps API documentation, and by running xsane under a
</EM><BR>
<EM>&gt;&gt;debugger it appears that the scanner is sending too much data. I added a
</EM><BR>
<EM>&gt;&gt;check into xsane-preview.c, preview_increment_image_y, which checks if
</EM><BR>
<EM>&gt;&gt;p-&gt;image_y &gt;= p-&gt;image_height. If this is true, the buffer will be
</EM><BR>
<EM>&gt;&gt;overrun. Perhaps this is legal on the last iteration in the read, but I
</EM><BR>
<EM>&gt;&gt;think that a check of this kind needs to be made. Perhaps there is
</EM><BR>
<EM>&gt;&gt;another place in the code where it would be more appropriate. At least
</EM><BR>
<EM>&gt;&gt;my xsane reports an error now instead of seg faulting :-).
</EM><BR>
<EM>&gt;&gt;
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt;Hi ben,
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt;I will think about that.
</EM><BR>
<EM>&gt;The first step is to make the backend return the correct values.
</EM><BR>
<EM>&gt;I think xsane should not read more data than given in sane_get_parameters
</EM><BR>
<EM>&gt;so may be it is better to cancel the scan than to read more image data.
</EM><BR>
<EM>&gt;
</EM><BR>
I think that is the right thing to do (in fact that's what I did). It
<BR>
would be wrong to just allocate more memory and keep going - this just
<BR>
hides bugs in the backend. I think that the front end should detect the
<BR>
error and *not crash*. But it's ok to abort.
<BR>
<P><EM>&gt;&gt;I'm a C++ programmer, and I find the C way of doing this stuff to be a
</EM><BR>
<EM>&gt;&gt;bit 'messy' by comparison, but them's the breaks when you use other
</EM><BR>
<EM>&gt;&gt;people's software.
</EM><BR>
<EM>&gt;&gt;
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt;A good written C code is not messy, but in fact some backends are messy
</EM><BR>
<EM>&gt;(but you also can write messy code in C++ ;-))
</EM><BR>
<EM>&gt;
</EM><BR>
Agreed. I've seen enough bad C++ (and bad code in general!) marking
<BR>
student assignments... Yuck!!!
<BR>
<P>I'm looking into your other email regarding checking the returned number
<BR>
of lines.
<BR>
<P>Thanks Oliver.
<BR>
Ben.
<BR>
<P><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:%20Problems%20with%20Prisa%20620S%20[snapscan]%20%2B%20BUG%20in%20xsane%200.76&In-Reply-To=&lt;3B0AE6F7.8090301@uow.edu.au&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0295.html">Ben Stanley: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0293.html">Ben Stanley: "Re: Maxi-scan A4 scanner (AGAIN!!!) under Mandrake 8.0 (2.4.3)"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0288.html">Oliver Rauch: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0290.html">Henning Meier-Geinitz: "Re: Problems with Prisa 620S [snapscan] + BUG in xsane 0.76"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#294">[ date ]</A>
<A HREF="index.html#294">[ thread ]</A>
<A HREF="subject.html#294">[ subject ]</A>
<A HREF="author.html#294">[ 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>Tue May 22 2001 - 15:22:56 PDT</EM>
</EM>
</SMALL>
</BODY>
</HTML>