Re: 0.50: xscan parameters label problems

Gordon Matzigkeit (gord@m-tech.ab.ca)
03 Apr 1997 00:01:57 -0700

Hi!

>>>>> David Mosberger-Tang writes:

>>>>> On 02 Apr 1997 12:03:59 -0700, Gordon Matzigkeit <gord@m-tech.ab.ca> said:
Gord> Hi! When I set my PINT scanner to scan really big, high
Gord> resolution pictures, xscan doesn't like me.

DM> I guess that means the PINT backend is working, more or
DM> less---great! ;-)

Yeah, as I said... I just need to get a good way to dynamically
determine valid parameter ranges, then things will be usable by the
public at large. I'm also running into problems with how to cancel a
PINT scan, but that's PINT's fault, not yours...

DM> I don't see why this should overflow even on a 32 bit machine.
DM> Can you look into this?

I don't really know what weirdness was happening with sign-extension,
or whatever, but the following patch fixes my problems.

--- xscan.c~ Tue Apr 1 13:44:43 1997
+++ xscan.c Wed Apr 2 21:13:34 1997
@@ -230,7 +230,7 @@
if (sane_get_parameters (gsg_dialog_get_device (dialog), &params)
== SANE_STATUS_GOOD)
{
- long size = 10 * params.bytes_per_line * params.lines;
+ unsigned long size = 10 * params.bytes_per_line * params.lines;
const char *unit = "B";

if (size >= 10 * 1024 * 1024)

DM> Aside from the overflow: note that the depth parameter is the
DM> depth _per channel_, so it probably ought to be 8 instead (none
DM> of the frontends currently support more than that).

Okay, thanks.

DM> Did you return an info value with SANE_INFO_RELOAD_PARAMS on when
DM> xscan set the color->grayscale option? If you don't set that
DM> bit, xscan won't now that it should update the parameters.

This works now. Thanks for your help,

-- 
  Gord Matzigkeit   | Proudly running pieces of the GNU operating system.
 gord@m-tech.ab.ca  |  Jacques Cousteau loved programming in assembler.

--
Source code, list archive, and docs: http://www.azstarnet.com/~axplinux/sane/
To unsubscribe: mail -s unsubscribe sane-devel-request@listserv.azstarnet.com