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

stef stef.dev at free.fr
Fri Nov 12 21:01:58 UTC 2010

Le Wednesday 10 November 2010 09:55:10, vous avez écrit :
> Dear Stef,
> I did not manage to compile SANE with the internal getopt_long. At
> least with my distribution (Ubuntu 10.10) SANE was always built with
> the glibc getopt_long and disregarding the definitions in the config.h.
> However I modified the fetch_options function (scanimage.c:859) by
> adding a line
> if(opt->name == NULL) continue;
> at 895. After this modification scanimage works as expected, namely
> it recognizes all options! May be this is a bug in the glibc
> implementation of getopt_long (it stops once it reaches NULL option).
> But I would suggest to modify the scanimage.c.

	Nice debugging. It looks to me it may be a canon backend bug. From 
reading the code it appears that all options including groups options are set 
up to SANE_CAP_SOFT_SELECT and SANE_CAP_SOFT_DETECT. While some groups have 
their cap value correctly set to 0 later, this is not the case for 
OPT_CALIBRATION_GROUP. The cap should be set to 0 before testing if it is 
inactive (this is done for other group options). 

	Without that the group is 'settable' with a null name, which causes your 
problem. OPT_EJECT_GROUP has the same issue.

> Please find attached the usb log file of the canoscan 8400F.
> I am not sure if it is complete (the log was recorded while scanner
> reset and preview, but during the preview I notice that number
> of recorded packets was not changing). Please let me know if you
> need more information/tests.

	My scripts are tuned for this usb snoop program 
http://www.pcausa.com/Utilities/UsbSnoop/ , so I cannot parse the log you 

> The canoscan 3200F I will try during the Christmas holidays.
> Best regards,
> Myroslav


More information about the sane-devel mailing list