kopia lustrzana https://gitlab.com/sane-project/website
148 wiersze
5.5 KiB
HTML
148 wiersze
5.5 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: pnm backend crashes graphical frontends (patch?)</TITLE>
|
|
<META NAME="Author" CONTENT="Henning Meier-Geinitz (hmg-ml@gmx.de)">
|
|
<META NAME="Subject" CONTENT="Re: pnm backend crashes graphical frontends (patch?)">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: pnm backend crashes graphical frontends (patch?)</H1>
|
|
<!-- received="Wed Sep 27 11:50:32 2000" -->
|
|
<!-- isoreceived="20000927185032" -->
|
|
<!-- sent="Wed, 27 Sep 2000 20:59:59 +0200" -->
|
|
<!-- isosent="20000927185959" -->
|
|
<!-- name="Henning Meier-Geinitz" -->
|
|
<!-- email="hmg-ml@gmx.de" -->
|
|
<!-- subject="Re: pnm backend crashes graphical frontends (patch?)" -->
|
|
<!-- id="20000927205959.A2566@hmg1.vortex.swb.de" -->
|
|
<!-- inreplyto="00092523420200.02394@slowcrap" -->
|
|
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:hmg-ml@gmx.de?Subject=Re:%20pnm%20backend%20crashes%20graphical%20frontends%20(patch?)&In-Reply-To=<20000927205959.A2566@hmg1.vortex.swb.de>"><EM>hmg-ml@gmx.de</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Wed Sep 27 2000 - 11:59:59 PDT
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0282.html">Henning Meier-Geinitz: "Re: Problem with Mustek 6000CX"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0280.html">Roman Spitzbart: "Problem with Mustek 6000CX"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#281">[ date ]</A>
|
|
<A HREF="index.html#281">[ thread ]</A>
|
|
<A HREF="subject.html#281">[ subject ]</A>
|
|
<A HREF="author.html#281">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi,
|
|
<BR>
|
|
<P><EM>> It seemed, that the problem was a call to sane_read() in the
|
|
</EM><BR>
|
|
<EM>> pnm backend, which ignored the value in max_length.
|
|
</EM><BR>
|
|
<EM>> Therefore the buffer allocated by the frontend is just to
|
|
</EM><BR>
|
|
<EM>> small sometimes.
|
|
</EM><BR>
|
|
<P>Ok, I can see the problem now. If max_length gets smaller, rgblength is not
|
|
<BR>
|
|
adjusted. I think a solution would be to add a
|
|
<BR>
|
|
<P>"else rgblength = 3 * max_length;"
|
|
<BR>
|
|
<P>after the "if (rgbbuf == 0 ...)" statement.
|
|
<BR>
|
|
<P><EM>> I'm not sure, whether my patch was just good luck,
|
|
</EM><BR>
|
|
<P>It wasn't. By setting rgblength to 0 it's reinitialized with each sane_read.
|
|
<BR>
|
|
<P><EM>> Finally I couldn't find a single reason, why this variable (and also
|
|
</EM><BR>
|
|
<EM>> rgbbuf and rgbleftover) is static, so I moved it in sane_read().
|
|
</EM><BR>
|
|
<P>I haven't understood rgbleftover yet but it looks like it intentionally
|
|
<BR>
|
|
should keep its value between calls to sane_read.
|
|
<BR>
|
|
<P>I will fix this in CVS (and "my" problem) after I understand all of this
|
|
<BR>
|
|
code.
|
|
<BR>
|
|
<P><EM>> > This reveals another problem: xscanimage doesn't test if it gets too much
|
|
</EM><BR>
|
|
<EM>> > data from the backend (at least in preview mode).
|
|
</EM><BR>
|
|
<EM>>
|
|
</EM><BR>
|
|
<EM>> Are you sure?
|
|
</EM><BR>
|
|
<P>I am sure that this is a problem in case of a bad backend :-) It shouldn't
|
|
<BR>
|
|
hurt if the frontend checks if more data than the expected amount is
|
|
<BR>
|
|
provided by a backend (--> ignore the data, cancel the scan and print out
|
|
<BR>
|
|
some ugly messages). I would call this a nice feature for tracing problems
|
|
<BR>
|
|
with backends.
|
|
<BR>
|
|
<P><EM>> Is it really necessary that a frontend can handle scanning of a grayscale image
|
|
</EM><BR>
|
|
<EM>> in three pass mode with a line number that isn't known a priori?
|
|
</EM><BR>
|
|
<P>If you want to conform to the SANE standard it's necessary. I think
|
|
<BR>
|
|
xscanimage and xsane can't cope with a variable length but scanimage can. At
|
|
<BR>
|
|
least xsane and xscanimage segfault ot produce pnms with a length of -1. I
|
|
<BR>
|
|
think the frontends should at least catch the "-1" and cancel the scan if
|
|
<BR>
|
|
they can't support variable length. I will add both points to the TODO list.
|
|
<BR>
|
|
<P><EM>> I'm just
|
|
</EM><BR>
|
|
<EM>> wondering whether such a hardware exists ...
|
|
</EM><BR>
|
|
<P>I don't think there is something like a three pass handscanner but you
|
|
<BR>
|
|
never know :-)
|
|
<BR>
|
|
<P>Bye,
|
|
<BR>
|
|
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:%20pnm%20backend%20crashes%20graphical%20frontends%20(patch?)&In-Reply-To=<20000927205959.A2566@hmg1.vortex.swb.de>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0282.html">Henning Meier-Geinitz: "Re: Problem with Mustek 6000CX"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0280.html">Roman Spitzbart: "Problem with Mustek 6000CX"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#281">[ date ]</A>
|
|
<A HREF="index.html#281">[ thread ]</A>
|
|
<A HREF="subject.html#281">[ subject ]</A>
|
|
<A HREF="author.html#281">[ 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>Wed Sep 27 2000 - 11:51:16 PDT</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|