[sane-devel] Where should a backend save config data ?

mh crapsite@gmx.net
Thu, 25 Jul 2002 12:12:05 +0200


Oliver Rauch, Mittwoch, 24. Juli 2002 22:07:
> You will not be able to save the data to a system directory
> because all users need write access to the file.
> Be carefull with security with such files!

I was thinking about saving the values on a per-user basis, not some sort of 
global config file. As long as the user isn't scanning over a network 
(saned/net), is there a problem with using the users $HOME/.sane directory 
for saving?  

> I suggest not to save any calibration data to a file.
> The calibration data does not keep valid for a long time
> because the illumination of the lamp does change, especally
> for several minutes after the scanner lamp has turned on.

I should mention, that this is a CIS device, I can't see any difference
in the calibration values between scans(maybe over a long term of usage due 
to aging of the sensor/LED rows?). The windoze driver saves all the values to 
disk and avoids repeating the calibration sequence, which takes about 20 
seconds (or more).

> I suggest to keep the calibration data in the memory or
> save it to a temporary file that is erased when sane_close
> is called.

That's what I do at the moment. Another approach was to use default 
offset/gain/exposure values in the .conf file (optional) and only do shading 
correction after sane_start is called the first time. The scanner will still 
work without those values and there's also a "Calibrate before next scan" - 
option to enforce calibration. The problem is, that this is a global setting 
which affects all users.

> > small problem:
> > Is there a well-known location, where a backend should/could save some
> > data? I'd like to save some calibration data (shading,exposure ...), but
> > I'm not sure how to do this.
> > Should this go to $HOME/.sane ? Does this work with saned?

bb
Michael