[sane-devel] Possible bug in canon backend or > scanimage

Myroslav Kavatsyuk m.kavatsyuk at yahoo.com
Mon Nov 8 11:54:11 UTC 2010


Dear colleagues,

Thank you for your replies. I find that addition of the --all-options
is a nice idea to improve the user interface. Unfortunately it
does not solve my problem. This weekend I tried to debug sane
to find the source of the error. Just to remind you the problem:

scanner canoscan 2700F is supposed to have extra options (reported
when using --all-options flag, works with xsane) but this options
are not accessible with a scanimage (reported error 
scanimage: unrecognized option '--af=yes')

As was pointed earlier, the message is coming from the getopt_long
function (frontend/scanimage.c:2094). With my compilation, the glibc
implementation of the getopt_long is used, therefore I could not
debug it. However, I have modified the scanimage.c in a way, to
printout all command-line parameters and the content of 
full_optstring and all_options -- parameters of getopt_long
function (frontend/scanimage.c:2094). The output you can see in the
attachment (scanimage.out.highlight and scanimage.out.af). What I do
not like in the output is some (null) option-names in the printed
all_options (see line 29 of scanimage.out.af). This (null) string
is following after the "ae" option, which is still working.
All options below that (null) line do not work.

Here, just in case, few lines which I added to scanimage.c just before
while loop at the line 2094 to print parameters:

      fprintf(stderr,"Full_options: %s\n",full_optstring);
      for(i=0;i<all_options_len;i++)
	  fprintf(stderr,"ap: %s\n",all_options[i].name);

Please let me know your opinion on this "investigation".

I just noticed that there is active development of the genesys
backend. I have a canoscan 8400F scanner which is build with
the GL843 chip. I would like to help to make backend for this
scanner. Please let me know how can I help you.
I also have a canoscan 3200F scanner, which I would like to
rebuild to a "film" scanner. But before taking it completely
apart I can try to see if we can make it ruining with sane.

Please find attached the output of the sane-find-scanner
utility.

Best regards,
Myroslav


--- On Fri, 11/5/10, sane-devel-request at lists.alioth.debian.org <sane-devel-request at lists.alioth.debian.org> wrote:

> From: sane-devel-request at lists.alioth.debian.org <sane-devel-request at lists.alioth.debian.org>
> Subject: sane-devel Digest, Vol 65, Issue 8
> To: sane-devel at lists.alioth.debian.org
> Date: Friday, November 5, 2010, 12:02 PM
> Send sane-devel mailing list
> submissions to
>     sane-devel at lists.alioth.debian.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> or, via email, send a message with subject or body 'help'
> to
>     sane-devel-request at lists.alioth.debian.org
> 
> You can reach the person managing the list at
>     sane-devel-owner at lists.alioth.debian.org
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of sane-devel digest..."
> 
> 
> Today's Topics:
> 
>    1. Possible bug in canon backend or
> scanimage (Myroslav Kavatsyuk)
>    2. Re: [sane-commit] [SCM] SANE backends
> - scanner drivers
>       branch, master, updated.
> RELEASE_1_0_21-248-gaaa34de (m. allan noah)
>    3. Possible bug in canon backend or
> scanimage (Ulrich Deiters)
>    4. Re: [sane-commit] [SCM] SANE backends
> - scanner    drivers
>       branch, master, updated.
> RELEASE_1_0_21-248-gaaa34de (stef)
>    5. Re: Possible bug in canon backend or
> scanimage (stef)
>    6. Re: Possible bug in canon backend or
> scanimage (m. allan noah)
>    7. Re: Possible bug in canon backend or
> scanimage (stef)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 4 Nov 2010 06:57:05 -0700 (PDT)
> From: Myroslav Kavatsyuk <m.kavatsyuk at yahoo.com>
> Subject: [sane-devel] Possible bug in canon backend or
> scanimage
> To: sane-devel at lists.alioth.debian.org
> Message-ID: <785678.59028.qm at web59613.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> Hello,
> 
> Just recently I bought CanoScan 2700F film scanner (SCSI,
> canon ackend).
> It works fine with the xsane/xscanimage frontends. However,
> I have troubles to make it working with the scanimage
> frontend. Namely, I can not path some scanner-specific
> options (--af, --afonce, --highlight).
> 
> According to the manual this options are there:
> 
> >scanimage -d canon:/dev/sg2 -h
> ....
> ?? --highlight 0..255 [255]
> ??????? Selects what radiance level should be considered
> "white".
> ? Focus:
> ??? --af[=(yes|no)] [yes]
> ??????? Enable/disable auto focus
> ??? --afonce[=(yes|no)] [yes]
> ??????? Do auto focus only once between ejects
> 
> When I execute
> >scanimage -d canon:/dev/sg2 --resolution 2720
> --film-type Slides --highlight 150 > out.pnm
> 
> I get the error message:
> > scanimage: unrecognised option --highlight
> 
> I have checked the source code of the canon backend and I
> can not see gross mistakes. Moreover I can control these
> options with the xsane GUI.
> 
> Please give me a hint where should I look to find a
> solution of the problem.
> 
> Thank you in advance,
> Best regards,
> Myroslav
> 
> 
>       
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Thu, 4 Nov 2010 10:06:15 -0400
> From: "m. allan noah" <kitno455 at gmail.com>
> Subject: Re: [sane-devel] [sane-commit] [SCM] SANE backends
> - scanner
>     drivers branch, master, updated.
> RELEASE_1_0_21-248-gaaa34de
> To: stef <stef.dev at free.fr>
> Cc: sane-devel at lists.alioth.debian.org
> Message-ID:
>     <AANLkTimooEWzfmjiNyx4WpoMviqRJQLxi71QRDuqcLo4 at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> This patch looks fine to me- Though I would say 'All
> options' instead
> of 'All SANE options'.
> 
> allan
> 
> On Mon, Nov 1, 2010 at 4:31 PM, stef <stef.dev at free.fr>
> wrote:
> > Le Monday 01 November 2010 15:48:28 m. allan noah,
> vous avez ?crit :
> > ...
> >> >> allan
> >> >
> >> > ? ? ? ?Hello,
> >> >
> >> > ? ? ? ?I think there are different points to
> answer. First there is a bug
> >> > to fix: the --help argument (which is geared
> to scanimage command line
> >> > usage) shouldn't print command line options
> that cannot be used.
> >> > ? ? ? ?Second listing all the options a
> backend provides including
> >> > buttons is useful. It will better served with
> a specific argument
> >> > (--list-options / -- list-buttons /
> --show-options ?). I'll submit a
> >> > patch that brings such an argument for
> everyone to review.
> >>
> >> how about --all-options?
> >>
> >> allan
> >
> > ? ? ? ?Hello,
> >
> > ? ? ? ?here is a try at adding --all-options to
> scanimage . I'm looking forward
> > to comment or suggestion.
> >
> > Regards,
> > ? ? ? ?Stef
> >
> 
> 
> 
> -- 
> "The truth is an offense, but not a sin"
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Thu, 04 Nov 2010 16:09:11 +0100
> From: Ulrich Deiters <ulrich.deiters at uni-koeln.de>
> Subject: [sane-devel] Possible bug in canon backend or
> scanimage
> To: sane-devel at lists.alioth.debian.org
> Message-ID: <4CD2CC97.8080107 at uni-koeln.de>
> Content-Type: text/plain; charset=UTF-8
> 
> If xsane works correctly with the scanner, the problem
> should not be
> in the Canon backend.
> 
> Kind regards,
> 
> Ulrich Deiters
> 
> -- 
> Prof. Dr. Ulrich K. Deiters     
> ______________________________________
> Institut f. Physikalische Chemie \ Luxemburger Str. 116,
> D-50939 Koeln
> Universitaet zu Koeln  /\/\...    \ Tel. +49
> (0)221 470-4543, Fax -4900
> _______________________L|L|__|_____\ http://www.uni-koeln.de/deiters/
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Thu, 4 Nov 2010 20:05:00 +0100
> From: stef <stef.dev at free.fr>
> Subject: Re: [sane-devel] [sane-commit] [SCM] SANE backends
> - scanner
>     drivers branch, master, updated.
> RELEASE_1_0_21-248-gaaa34de
> To: "m. allan noah" <kitno455 at gmail.com>
> Cc: sane-devel at lists.alioth.debian.org
> Message-ID: <201011042005.01056.stef.dev at free.fr>
> Content-Type: Text/Plain;  charset="iso-8859-1"
> 
> Le Thursday 04 November 2010 15:06:15 m. allan noah, vous
> avez ?crit :
> > This patch looks fine to me- Though I would say 'All
> options' instead
> > of 'All SANE options'.
> > 
> > allan
> > 
>     Hello,
> 
>     ok, I'll change that. I think I'll
> commit this by next monday with the 
> according man page change.
> 
> Regards,
>     Stef
> 
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 4 Nov 2010 21:53:50 +0100
> From: stef <stef.dev at free.fr>
> Subject: Re: [sane-devel] Possible bug in canon backend or
> scanimage
> To: sane-devel at lists.alioth.debian.org
> Cc: Myroslav Kavatsyuk <m.kavatsyuk at yahoo.com>
> Message-ID: <201011042153.50657.stef.dev at free.fr>
> Content-Type: Text/Plain;  charset="iso-8859-1"
> 
> Le Thursday 04 November 2010 14:57:05 Myroslav Kavatsyuk,
> vous avez ?crit :
> > Hello,
> > 
> > Just recently I bought CanoScan 2700F film scanner
> (SCSI, canon ackend).
> > It works fine with the xsane/xscanimage frontends.
> However, I have troubles
> > to make it working with the scanimage frontend.
> Namely, I can not path
> > some scanner-specific options (--af, --afonce,
> --highlight).
> > 
> > According to the manual this options are there:
> > >scanimage -d canon:/dev/sg2 -h
> > 
> > ....
> >    --highlight 0..255 [255]
> >         Selects what
> radiance level should be considered "white".
> >   Focus:
> >     --af[=(yes|no)] [yes]
> >         Enable/disable
> auto focus
> >     --afonce[=(yes|no)] [yes]
> >         Do auto focus
> only once between ejects
> > 
> > When I execute
> > 
> > >scanimage -d canon:/dev/sg2 --resolution 2720
> --film-type Slides
> > >--highlight 150 > out.pnm
> > 
> > I get the error message:
> > > scanimage: unrecognised option --highlight
> > 
> > I have checked the source code of the canon backend
> and I can not see gross
> > mistakes. Moreover I can control these options with
> the xsane GUI.
> > 
> > Please give me a hint where should I look to find a
> solution of the
> > problem.
> > 
> > Thank you in advance,
> > Best regards,
> > Myroslav
> 
>     Hello,
> 
>     I am quite puzzled since I can't see
> this error message in scanimage 
> source code. Doing a " grep -r recognised * " on all SANE
> sources show no such 
> message. What am I missing ? 
> 
> Regards,
>     Stef 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 4 Nov 2010 17:01:48 -0400
> From: "m. allan noah" <kitno455 at gmail.com>
> Subject: Re: [sane-devel] Possible bug in canon backend or
> scanimage
> To: stef <stef.dev at free.fr>
> Cc: Myroslav Kavatsyuk <m.kavatsyuk at yahoo.com>,
>     sane-devel at lists.alioth.debian.org
> Message-ID:
>     <AANLkTinUMmyq5USNVsMHAb-cX0Qn3w6-cgU8nEL5XYNH at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> try American English- unrecognized
> 
> allan
> 
> On Thu, Nov 4, 2010 at 4:53 PM, stef <stef.dev at free.fr>
> wrote:
> > Le Thursday 04 November 2010 14:57:05 Myroslav
> Kavatsyuk, vous avez ?crit :
> >> Hello,
> >>
> >> Just recently I bought CanoScan 2700F film scanner
> (SCSI, canon ackend).
> >> It works fine with the xsane/xscanimage frontends.
> However, I have troubles
> >> to make it working with the scanimage frontend.
> Namely, I can not path
> >> some scanner-specific options (--af, --afonce,
> --highlight).
> >>
> >> According to the manual this options are there:
> >> >scanimage -d canon:/dev/sg2 -h
> >>
> >> ....
> >> ? ?--highlight 0..255 [255]
> >> ? ? ? ? Selects what radiance level should be
> considered "white".
> >> ? Focus:
> >> ? ? --af[=(yes|no)] [yes]
> >> ? ? ? ? Enable/disable auto focus
> >> ? ? --afonce[=(yes|no)] [yes]
> >> ? ? ? ? Do auto focus only once between ejects
> >>
> >> When I execute
> >>
> >> >scanimage -d canon:/dev/sg2 --resolution 2720
> --film-type Slides
> >> >--highlight 150 > out.pnm
> >>
> >> I get the error message:
> >> > scanimage: unrecognised option --highlight
> >>
> >> I have checked the source code of the canon
> backend and I can not see gross
> >> mistakes. Moreover I can control these options
> with the xsane GUI.
> >>
> >> Please give me a hint where should I look to find
> a solution of the
> >> problem.
> >>
> >> Thank you in advance,
> >> Best regards,
> >> Myroslav
> >
> > ? ? ? ?Hello,
> >
> > ? ? ? ?I am quite puzzled since I can't see this error
> message in scanimage
> > source code. Doing a " grep -r recognised * " on all
> SANE sources show no such
> > message. What am I missing ?
> >
> > Regards,
> > ? ? ? ?Stef
> >
> > --
> > sane-devel mailing list: sane-devel at lists.alioth.debian.org
> > http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> > Unsubscribe: Send mail with subject "unsubscribe
> your_password"
> > ? ? ? ? ? ? to sane-devel-request at lists.alioth.debian.org
> >
> 
> 
> 
> -- 
> "The truth is an offense, but not a sin"
> 
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Thu, 4 Nov 2010 22:20:36 +0100
> From: stef <stef.dev at free.fr>
> Subject: Re: [sane-devel] Possible bug in canon backend or
> scanimage
> To: "m. allan noah" <kitno455 at gmail.com>
> Cc: Myroslav Kavatsyuk <m.kavatsyuk at yahoo.com>,
>     sane-devel at lists.alioth.debian.org
> Message-ID: <201011042220.36745.stef.dev at free.fr>
> Content-Type: Text/Plain;  charset="iso-8859-1"
> 
> Le Thursday 04 November 2010 22:01:48 m. allan noah, vous
> avez ?crit :
> > try American English- unrecognized
> > 
> > allan
> > 
> > On Thu, Nov 4, 2010 at 4:53 PM, stef <stef.dev at free.fr>
> wrote:
> > > Le Thursday 04 November 2010 14:57:05 Myroslav
> Kavatsyuk, vous avez ?crit 
> :
>     Indeed, it is much better that way. This
> message is printed by 
> getopt_long in scanimage. I see no other option than
> debugging scanimage. 
> Especially look at the fetch_options() () which builds the
> list of usable 
> options in the all_options global var. The
> SANE_OPTION_IS_SETTABLE test is a 
> good place for a breakpoint. This global var is used later
> by getopt_long() to 
> check command lines arguments.
> 
> Regards,    
>     Stef
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> sane-devel mailing list
> sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/sane-devel
> 
> End of sane-devel Digest, Vol 65, Issue 8
> *****************************************
>


      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanimage.out.af
Type: application/octet-stream
Size: 1452 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101108/bfe8a8d9/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanimage.out.highlight
Type: application/octet-stream
Size: 1474 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101108/bfe8a8d9/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3200F
Type: application/octet-stream
Size: 4762 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101108/bfe8a8d9/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 8400F
Type: application/octet-stream
Size: 4039 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20101108/bfe8a8d9/attachment-0007.obj>


More information about the sane-devel mailing list