[sane-devel] annoying bug in sp15c backend ?

jazz_johnson at verizon.net jazz_johnson at verizon.net
Wed Jan 9 16:06:47 UTC 2008


When I use xsane with the sp15c backend, there is a weird annoying bug related 
to the drop-down lists for the xres and yres in Save and View modes:

In sp15c.c the x/y res are set to the following:

static const SANE_Int resolution_list[] =
{11, 0, 60, 75, 80, 100, 120, 150, 200, 240, 300, 600};

static const SANE_Int x_res_list[] =
{11, 0, 60, 75, 80, 100, 120, 150, 200, 240, 300, 600};

static const SANE_Int y_res_list[] =
{11, 0, 60, 75, 80, 100, 120, 150, 200, 240, 300, 600};



When I start up xsane in "Save" mode and then do a scan, xsane crashes 
probably because of a divide-by-zero error. After troubleshooting, I found 
out that if I switch from "Save" mode to "Viewer" mode, the xres and yres are 
initialized to 0dpi. If I then set both these resolutions to non-zero and 
then switch back to save mode, I can scan without crashing. I only need to 
reset the xres and yres once per xsane session. But every time I start xsane 
and forget to switch to "Viewer" mode and change the xres/yres to non-zero, 
xsane crashes when scanning. 

A slight wrinkle: if when I start xsane I'm in "Viewer" mode with a non-zero  
x/y res, I also have the same crash problem, unless I first switch to "Save" 
mode and change the xres/yres from their initial zero values.

So somehow when xsane saves its last session state when it's closed out, it 
saves the xres/yres of either one or both "Viewer" and "Save" modes to 0 dpi, 
which then causes the next session of xsane to crash unless one remembers to 
switch to the mode with 0dpi x/y res and change the xres/yres values to 
non-zero.

I'm not sure if this is an xsane issue, but I only seem to have the bug with 
the sp15c backend (The avision backend doesn't use separate xres/yres).



More information about the sane-devel mailing list