# sane-0.55:can't allocate image buffer

Matthias Lautner (lautner@hoggle.syscomp.de)
Thu, 24 Apr 1997 09:53:40 +0200 (MET DST)

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Mathias Weigt: "xscanimage performance"
- Previous message: Gordon Matzigkeit: "sane-0.55: PINT/NetBSD fixes"

Hi!

I cann't scan images with more than 255 lines with scanimage.

scanimage -v -d mustek --mode Color --resolution 100 -l 10 -x 80 -t 7 -y 80 \
>out.pnm

results in:

scanimage: scanning image of size 318x319 pixels at 8 bits/pixel
scanimage: can't allocate image buffer (318x63)

This occures due to a bug in advance() in scanimage.c
image.y = -1
image.height = 63 (= parm.lines - STRIP_HEIGHT) should by < -1 to allocate
memory

add the following to fix the bug:

if (++image->y >= image->height || !image->data)
^^^^^^^^^^^^^^^^
but one bug still remains:
after the first plane is completed a realloc is done with STRIP_HEIGHT further
lines.

Another problem I reported about a few days ago is that the kernel complains
about "Wrong buffer length supplied for request sense (4)". This is just a
warning cause scanning still works.

I tested it out on my 2.0.27 kernel with an aha1542.

changing the result array of request_sense() in mustek.c to length 16 will avoid
this warning.

Matthias
------------------------------------------------------------------
Matthias Lautner email: m_lautner@syscomp.de
Fa. SYSCOMP GmbH Augsburg, Germany phone: 0821 / 4201-139
Biochemische Dienstleistungen fax : 0821 / 4201-411

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

- Next message: Mathias Weigt: "xscanimage performance"
- Previous message: Gordon Matzigkeit: "sane-0.55: PINT/NetBSD fixes"