[Image-SIG] Debian Bug#156158: cannot set color mode with scanner_instance.mode=

Simon Richter sjr@debian.org
Thu, 22 Aug 2002 13:30:11 +0200


I received the bug report below. Since I have exams coming up I don't
have the necessary time to investigate this further, so I'm just
forwarding it. Does anyone have an idea what may be wrong here?

Please CC me on replies.


----- Forwarded message from Thomas Renard <Thomas.Renard@koeln.de> -----

Subject: Bug#156158: cannot set color mode with scanner_instance.mode=
Resent-From: Thomas Renard <Thomas.Renard@koeln.de>
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Date: Sat, 10 Aug 2002 12:48:04 GMT
Date: Sat, 10 Aug 2002 14:39:38 +0200
From: Thomas Renard <Thomas.Renard@koeln.de>
To: submit@bugs.debian.org

Package: python-imaging-sane
Version: 1.1.3-1

It is not possible to set a scanner's color mode with this version. The 
example worked with former versions of python-imaging-sane
(here: python2.1-imaging-sane, Scanner Epson Perfection1240 USB, debian 

Python 2.1.3 (#1, Apr 20 2002, 10:14:34)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> import sane
>>> sane.init()
(16777223, 1, 0, 7)
>>> sane.get_devices()
[('epson:/dev/usb/scanner0', 'Epson', 'Perfection1240', 'flatbed scanner')]
>>> scanner=sane.open('epson:/dev/usb/scanner0')
>>> scanner.mode
>>> scanner.mode="Color"
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/usr/lib/python2.1/site-packages/sane.py", line 46, in __setattr__
   self.last_opt = dev.set_option(opt.index, value)
_sane.error: Invalid argument

The expected behavior would be: no error, the scanner scans in color 
mode with a following
scan instruction (scanner.start())

The error occurs with python2.2-imaging-sane version 1.1.3-1 and woody 
too. Because I cannot
find any changes for the api for 1.1.3-1 in the net I guess there is 
some incompatibility
with the binding to the used libsane version 1.0.7-3.2

This info may be usefull:

>>> scanner.dev.get_options()
[(1, None, 'Scan Mode', '', 5, 0, 4, 0, None), (2, 'mode', 'Scan mode', 
'Selects the scan mode (e.g., lineart,monochrome, or color).', 3, 0, 7, 
5, ['Binary', 'Gray', 'Color']), (3, 'depth', 'Bit depth', 'Number of 
bits per sample, typical values are 1 for "line-art" and 8 for multibit 
scans.', 1, 0, 4, 37, [8, 14]), (4, 'halftoning', 'Halftoning', 'Selects 
the halftone.', 3, 0, 26, 5, ['None', 'Halftone A (Hard Tone)', 
'Halftone B (Soft Tone)', 'Halftone C (Net Screen)', 'Dit...

Tested versions:

woody, python2.1, python2.2
sarge, python2.1, python2.2

both kernel 2.4.18, libc6  2.2.5-6

----- End forwarded message -----