sane-test(5)
π sane-test(5) β SANE Scanner Access Now Easy's frontend-testing bestie π
π NAME π
sane-test β SANE backend for testing frontends. This is the sane-test(5) manual page, and it's part of SANE (Scanner Access Now Easy). It's the virtual-scanner backend you use to test your SANE setup and your frontends. π«Ά
πΈ DESCRIPTION πΈ
Okay so the sane-test library implements a SANE backend that allows testing the SANE installation and SANE frontends. It gives you access to a (nearly) unlimited number of virtual devices.
No support for real scanners or cameras β this is virtual-only, bestie. π«
However, the backend simulates scanning and setting options. β¨
The idea is not only to find bugs in frontends but also to show all capabilities of SANE. Therefore sane-test implements functions and options that are not (or seldom) found in other backends. π
Heads up, bestie: the backend is commented out in /etc/sane.d/dll.conf, so either the comment character must be removed or the backend must be called explicitly. E.g. scanimage -d test or xscanimage test. π
β¨ SCAN MODE OPTIONS β¨
modeβ selects the scan mode:GrayorColor.depthβ determines the number of bits per sample (1. 8, or 16). Keep in mind, that this value refers to the sample, not the pixel. Sodepth=16results in48bits per pixel in color mode. The most usual combinations aremode=Gray,depth=1for lineart,mode=Gray,depth=8for gray andmode=Color,depth=8for color mode. The combination of color and 1-bit mode is quite obscure (8colors) but allowed in the SANE standard. However, the meaning of bits is not defined. Currently1= high intensity and0= low intensity is used.hand-scannerβ results in the test-backend behaving like a hand-scanner. Hand-scanners do not know the image height a priori. Instead, they return a height of-1. Setting this option allows one to test whether a frontend can handle this correctly. This option also enables a fixed width of11 cm.three-passβ simulates a three-pass scanner. Older color scanners needed to scan the image once per color (red/green/blue) to get the full image. Therefore, in this mode three single frames are transmitted in color mode.three-pass-orderβ provides support for changing the order of the three frames (see optionthree-passabove). A frontend should support all orders.resolutionβ sets the resolution of the image in dots per inch.sourceβ can be used to simulate an Automatic Document Feeder (ADF). After10scans, the ADF will be"empty".
π¦ SPECIAL OPTIONS π¦
test-pictureβ allows one to set the image that's returned to the frontend. While"Solid white"and"Solid black"are quite obvious, the other options need some more explanation. Color patterns are used to determine if all modes and their colors are represented correctly by the frontend. The grid should look the same in every mode and resolution. A table of all the test pictures can be found at:http://www.meier-geinitz.de/sane/test-backend/test-pictures.html.invert-endiannessβ if set, the upper and lower bytes of image data in16 bitmodes are exchanged. This option can be used to test the16 bitmodes of frontends, e.g. if the frontend uses the correct endianness.read-limitβ if set, the maximum amount of data transferred with each call tosane_read()is limited.read-limit-sizeβ sets the limit for optionread-limit. A low limit slows down scanning. It can be used to detect errors in frontend that occur because of wrong assumptions on the size of the buffer or timing problems.read-delayβ enables delaying data to the frontend.read-delay-durationβ selects the number of microseconds the backend waits after each transfer of a buffer. This option is useful to find timing-related bugs, especially if used over the network.read-return-valueβ if different from"Default", the selected status will be returned by every call tosane_read(). This is useful to test the frontend's handling of the SANE statuses.ppl-lossβ if different from0, it determines the number of pixels that are"lost"at the end of each line. That means, lines are padded with unused data.fuzzy-parametersβ selects that fuzzy (inexact) parameters are returned as long as the scan hasn't been started. This option can be used to test if the frontend uses the parameters it got before the start of the scan (which it shouldn't).non-blockingβ determines if non-blocking IO forsane_read()should be used if supported by the frontend.select-fdβ if set, the backend offers a select filedescriptor for detecting ifsane_read()will return data.enable-test-optionsβ if set, a fairly big list of options for testing the various SANE option types is enabled.print-optionsβ can be used to print a list of all options to standard error.
π GEOMETRY OPTIONS π
tl-xβ determines the top-left x position of the scan area.tl-yβ determines the top-left y position of the scan area.br-xβ determines the bottom-right x position of the scan area.br-yβ determines the bottom-right y position of the scan area.
π₯ BOOL TEST OPTIONS π₯
There are 6 bool test options in total. Each option is numbered. (3/6) means: this is option 3 of 6. The numbering scheme is intended for easier detection of options not displayed by the frontend (because of missing support or bugs). π΅οΈββοΈ
bool-soft-select-soft-detect(1/6) β a bool test option that has soft select and soft detect (and advanced) capabilities. That's just a normal bool option.bool-hard-select-soft-detect(2/6) β a bool test option that has hard select and soft detect (and advanced) capabilities. That means the option can't be set by the frontend but by the user (e.g. by pressing a button at the device).bool-hard-select(3/6) β a bool test option that has hard select (and advanced) capabilities. That means the option can't be set by the frontend but by the user (e.g. by pressing a button at the device) and can't be read by the frontend.bool-soft-detect(4/6) β a bool test option that has soft detect (and advanced) capabilities. That means the option is read-only.bool-soft-select-soft-detect-emulated(5/6) β a Bool test option that has soft select, soft detect, and emulated (and advanced) capabilities.bool-soft-select-soft-detect-auto(6/6) β a Bool test option that has soft select, soft detect, and automatic (and advanced) capabilities. This option can be automatically set by the backend.
π INT TEST OPTIONS π
There are 7 int test options in total.
int(1/7) β an int test option with no unit and no constraint set.int-constraint-range(2/7) β an int test option with unit pixel and constraint range set. Minimum is4, maximum192, and quant is2.int-constraint-word-list(3/7) β an int test option with unit bits and constraint word list set.int-constraint-array(4/7) β an int test option with unit mm and using an array without constraints.int-constraint-array-constraint-range(5/7) β an int test option with unit mm and using an array with a range constraint. Minimum is4, maximum192, and quant is2.int-constraint-array-constraint-word-list(6/7) β an int test option with unit percent and using an array or word list constraint.int-inexact(7/7) β an int test option that increments the requested value and returns flagSANE_INFO_INEXACT.
π§ FIXED TEST OPTIONS π§
There are 3 fixed test options in total.
fixed(1/3) β a fixed test option with no unit and no constraint set.fixed-constraint-range(2/3) β a fixed test option with unit microsecond and constraint range set. Minimum is-42.17, maximum32767.9999, and quant is2.0.fixed-constraint-word-list(3/3) β a fixed test option with no unit and constraint word list set.
π STRING TEST OPTIONS π
There are 3 string test options in total.
string(1/3) β a string test option without constraint.string-constraint-string-list(2/3) β a string test option with string list constraint.string-constraint-long-string-list(3/3) β a string test option with string list constraint. Contains some more entries...
π BUTTON TEST OPTION π
button(1/1) β a Button test option. Prints some text... π
π FILES π
/etc/sane.d/test.confβ the backend configuration file (see also description ofSANE_CONFIG_DIRbelow). The initial values of most of the basic SANE options can be configured in this file. A template containing all the default values is provided together with this backend. One of the more interesting values may benumber_of_devices. It can be used to check the frontend's ability to show a long list of devices. The config values concerning resolution and geometry can be useful to test the handling of big file sizes./usr/lib64/sane/libsane-test.aβ the static library implementing this backend./usr/lib64/sane/libsane-test.soβ the shared library implementing this backend (present on systems that support dynamic loading).
π ENVIRONMENT π
SANE_CONFIG_DIRβ this environment variable specifies the list of directories that may contain the configuration file. On *NIX systems, the directories are separated by a colon (:), under OS/2, they are separated by a semi-colon (;). If this variable is not set, the configuration file is searched in two default directories: first, the current working directory (".") and then in/etc/sane.d. If the value of the environment variable ends with the directory separator character, then the default directories are searched after the explicitly specified directories. For example, settingSANE_CONFIG_DIRto"/tmp/config:"would result in directoriestmp/config,., and/etc/sane.dbeing searched (in this order).SANE_DEBUG_TESTβ if the library was compiled with debug support enabled, this environment variable controls the debug level for this backend. Higher debug levels increase the verbosity of the output.
Example:
export SANE_DEBUG_TEST=4
β SEE ALSO β
π«Ά AUTHOR π«Ά
Henning Meier-Geinitz <henning@meier-geinitz.de> π
π BUGS π
- config file values aren't tested for correctness
xoxo π β that's sane-test(5) from SANE Scanner Access Now Easy, dated 14 Jul 2008. Go forth and test those frontends, bestie. π
π¦ where this page comes from
- fedora 43: sane-backends 1.4.0-4.fc43 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- fedora 44: sane-backends 1.4.0-6.fc44 Β· GPL-2.0-or-later WITH SANE-exception AND GPL-2.0-or-later AND GPL-2.0-only AND LGPL-2.0-or-later AND LGPL-2.1-or-later AND LicenseRef-Fedora-Public-Domain AND IJG AND MIT
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- opensuse-leap 16.0: sane-backends 1.3.0-bp160.1.14 Β· GPL-2.0-or-later AND SUSE-GPL-2.0+-with-sane-exception AND SUSE-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms