# Two *other* problems with xscanimage

Matto Marjanovic (maddog@mir.com)
Sun, 26 Apr 1998 11:59:42 -0400 (EDT)

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Oliver.Rauch@Wolfsburg.DE: "Re: gtk_tooltips"
- Previous message: hopp@darkstar.fact.rhein-ruhr.de: "Re[2]: gtk_tooltips"
- Next in thread: Oliver.Rauch@Wolfsburg.DE: "Re: Two *other* problems with xscanimage"
- Reply: Oliver.Rauch@Wolfsburg.DE: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"

Here are two bugs that have cropped up with xscanimage, something new to
chew on. Someone else with more (i.e. any) experience with GTK+ may see
the solutions quicker than me, otherwise I'll keep plugging away.

(Environment: SANE-0.72, GTK 1.0.0 from Debian(2.0) package, glibc, and
last-but-not-least, GNU make)

a) ___Closing the Preview Window (by any means) causes a segfault.___
The segfault is correlated with the call to "gtk_widget_destroy (p->top)"
in preview_destroy() in frontend/preview.c.

b) ___Gamma Curve data is corrupted.___
When turning on table-based gamma correction (and thus instantiating the
gamma curve widget), the following happen:
o correct values are read from the (microtek) backend, so far so good.
o immediately after the call to gtk_curve_set_gamma in curve_new(),
a call to gtk_curve_get_gamma reveals the correct values were
written to the widget.
o sometime later (when the event loop updates/displays the widget, I
imagine), xscanimage declares

** WARNING **: file gdkdraw.c: line 375 (gdk_draw_points): "(points != NULL) && (npoints > 0)"

and the curve is drawn (very) incorrectly.
o the values read out from the widget when it is time to send to the
backend are very *wrong* -- always a couple of continuous sequences
of the same number (i.e. many 8501's, followed by many 85's, etc --
note that some are simply out of range).

o AND, this problem only appears for the grayscale or red plane gamma
curves, not the green or blue (when unbound gamma is selected).

It looks like some kind of memory allocation problem to me; perhaps a bug
crept into the 1.0.0 release of the gamma curve widget?

c) Bonus Bug: The preview selection box doesn't move around any more in
reponse to moving the geometry sliders. I believe it used to, and there
is also a ChangeLog entry (1998-04-02) saying this behavior was fixed.

d) Bonus Bug Fix: The error message for the "-g" option when there is no
GIMP support does not get printed. Here is a small patch to fix this:

--- xscanimage.c-dist Sun Apr 26 11:46:31 1998
+++ xscanimage.c Sun Apr 26 11:50:29 1998
@@ -1623,12 +1623,12 @@
static const SANE_Device *device_list[] = { &dev, 0 };
int ch;
- while ((ch = getopt_long (argc, argv, "hV", long_options, 0)) != EOF)
+ while ((ch = getopt_long (argc, argv, "ghV", long_options, 0)) != EOF)
{
switch (ch)
{
case 'g':
- printf ("%s: GIMP support missing.", argv[0]);
+ printf ("%s: GIMP support missing.\n", argv[0]);
exit (0);
case 'V':

That's it for now; time to get some sun!
-matt m.

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com

- Next message: Oliver.Rauch@Wolfsburg.DE: "Re: gtk_tooltips"
- Previous message: hopp@darkstar.fact.rhein-ruhr.de: "Re[2]: gtk_tooltips"
- Next in thread: Oliver.Rauch@Wolfsburg.DE: "Re: Two *other* problems with xscanimage"
- Reply: Oliver.Rauch@Wolfsburg.DE: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"
- Reply: Matto Marjanovic: "Re: Two *other* problems with xscanimage"