sane-project-website/old-archive/1999-08/0220.html

93 wiersze
4.0 KiB
HTML

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- received="Tue Aug 17 16:58:45 1999 PDT" -->
<!-- sent="Wed, 18 Aug 1999 01:52:57 +0200" -->
<!-- name="Andreas Beck" -->
<!-- email="becka@rz.uni-duesseldorf.de" -->
<!-- subject="Re: SANE V2" -->
<!-- id="" -->
<!-- inreplyto="37B74E99.2FF4C31F@martoneconsulting.com" -->
<title>sane-devel: Re: SANE V2</title>
<h1>Re: SANE V2</h1>
<b>Andreas Beck</b> (<a href="mailto:becka@rz.uni-duesseldorf.de"><i>becka@rz.uni-duesseldorf.de</i></a>)<br>
<i>Wed, 18 Aug 1999 01:52:57 +0200</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#220">[ date ]</a><a href="index.html#220">[ thread ]</a><a href="subject.html#220">[ subject ]</a><a href="author.html#220">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0221.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Previous message:</b> <a href="0219.html">Andreas Beck: "Re: 2 scanners under Linux"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt; Here's an example of the stuff the bh backend writes:</i><br>
<p>
<i>&gt; &lt;xml-stream&gt;</i><br>
snip.<br>
<p>
Yes. I see merit in this. I would actually suggest to always use textual<br>
stuff for things like orientation (orientation 0x01 isn't very <br>
enlightening), and always use units as appropriate (i.e.<br>
&lt;tr&gt;&lt;x&gt;1120mm&lt;/x&gt;... and similar), but I think xml could well be used<br>
for more complex transmissions.<br>
<p>
<i>&gt; Sure, the formatting and parsing remain problems, </i><br>
<p>
Yes and no :<br>
<p>
1. In 99% of the cases, you don't want to make sense of the data right<br>
inside the frontend. You store the stuff away and let a specialized app deal<br>
with it. That keeps parsing out of the frontend.<br>
<p>
2. For those cases wher you do want, you are making use of special features<br>
of a scanner anyway. Adding the proper parsing for the (hopefully few)<br>
features of that scanner shouldn't be so hard.<br>
<p>
<i>&gt; but at least we don't have to get those details into the SANE standard. </i><br>
<p>
Exactly what I am after. And your proposal in deed goes very well together<br>
with mine. It builds three layers of parsing complexity, that can be<br>
implemented optionally on top of each other:<br>
<p>
1. Only RAW data allowed. No parsing, no problem. We have to blind-save or<br>
discard unknown data.<br>
2. RAW + mime-typed data allowed. We have to parse a string to see if it is<br>
something we (or an external helper) understands. If we can't find a match,<br>
we again have to blind-save or discard, or we can let the user choose<br>
what to do, given the type.<br>
3. RAW + mime-typed data + internal data parsing. We have to parse the<br>
mime string, and if we see that it is a format we can handle, we can parse<br>
it further to gather more metadata as required. Fall back to 2., if<br>
we fail to parse.<br>
<p>
90% of apps will be happy with 1.<br>
9 more percent will probably want 2. And those will probably only care for a<br>
few types, or only with those that metamail handles as exernal helper.<br>
And the rest will have to bite the bullet and do 3, which isn't terribly<br>
hard either.<br>
<p>
<i>&gt; I would think that other backends written for scanners with similar </i><br>
<i>&gt; support could follow practice and use the xml encoding approach.</i><br>
<p>
Yes. It is good to set such de-facto standards (if they are flexible enough).<br>
<p>
CU, Andy<br>
<p>
<pre>
--
= Andreas Beck | Email : &lt;<a href="mailto:andreas.beck@ggi-project.org">andreas.beck@ggi-project.org</a>&gt; =
<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">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0221.html">Stephen Williams: "Re: SANE V2"</a>
<li> <b>Previous message:</b> <a href="0219.html">Andreas Beck: "Re: 2 scanners under Linux"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>