SimulPiscator / AirSane

Publish SANE scanners to MacOS, Android, and Windows via Apple AirScan.
GNU General Public License v3.0
247 stars 26 forks source link

A4 not listed as page size for Fujitsu ScanSnap S1500M #64

Closed watou closed 3 years ago

watou commented 3 years ago

Of all the page sizes listed for my scanner, A4 is not given. This is running latest on latest Synology DSM SANE Backends. It's like I have all page sizes except A4. It is so great to have SANE Backends and AirSane on my Synology; thank you so much for making this possible.

SimulPiscator commented 3 years ago

Is it missing from the web interface, or when accessing the scanner from macOS?

watou commented 3 years ago

Thanks for replying! A4 is missing from all interfaces -- the port 8090 web interface, and all places on macOS Big Sur. The web interface gives the shorter list below, and the macOS gives a very long list of choices, none which is A4. It's the Fujitsu ScanSnap S1500M by the way.

<nobr><label for='PaperSize'>Paper size</label>
<select autocomplete='off' name='PaperSize'>
<option value='A5 Portrait' selected>A5 Portrait</option>
<option value='A5 Landscape'>A5 Landscape</option>
<option value='A6 Portrait'>A6 Portrait</option>
<option value='A6 Landscape'>A6 Landscape</option>
<option value='US Letter'>US Letter</option>
<option value='Full'>Full</option>
</select>
SimulPiscator commented 3 years ago

Available paper sizes are calculated from the maximum scan area size available. For the web interface, this is done inside AirSane, for the macOS GUI, it is done inside the macOS scanner dialog. So it seems there is something wrong with the maximum scan size reported by SANE, or with AirSane's interpretation of it.

Can you log in to your Synology NAS, and run scanimage --help -A -d <ScanSnap device> ?

watou commented 3 years ago

Thanks!

Usage: scanimage [OPTION]...

Start image acquisition on a scanner device and write image data to
standard output.

Parameters are separated by a blank from single-character options (e.g.
-d epson) and by a "=" from multi-character options (e.g. --device-name=epson).
-d, --device-name=DEVICE   use a given scanner device (e.g. hp:/dev/scanner)
    --format=pnm|tiff|png|jpeg  file format of output file
-i, --icc-profile=PROFILE  include this ICC profile into TIFF file
-L, --list-devices         show available scanner devices
-f, --formatted-device-list=FORMAT similar to -L, but the FORMAT of the output
                           can be specified: %d (device name), %v (vendor),
                           %m (model), %t (type), %i (index number), and
                           %n (newline)
-b, --batch[=FORMAT]       working in batch mode, FORMAT is `out%d.pnm' `out%d.tif'
                           `out%d.png' or `out%d.jpg' by default depending on --format
                           This option is incompatible with --output-file.    --batch-start=#        page number to start naming files with
    --batch-count=#        how many pages to scan in batch mode
    --batch-increment=#    increase page number in filename by #
    --batch-double         increment page number by two, same as
                           --batch-increment=2
    --batch-print          print image filenames to stdout
    --batch-prompt         ask for pressing a key before scanning a page
    --accept-md5-only      only accept authorization requests using md5
-p, --progress             print progress messages
-o, --output-file=PATH     save output to the given file instead of stdout.
                           This option is incompatible with --batch.
-n, --dont-scan            only set options, don't actually scan
-T, --test                 test backend thoroughly
-A, --all-options          list all available backend options
-h, --help                 display this help message and exit
-v, --verbose              give even more status messages
-B, --buffer-size=#        change input buffer size (in kB, default 32)
-V, --version              print version information
Output format is not set, using pnm as a default.

Options specific to device `fujitsu:ScanSnap S1500:27767':
  Standard:
    --source ADF Front|ADF Back|ADF Duplex [ADF Front]
        Selects the scan source (such as a document-feeder).
    --mode Lineart|Halftone|Gray|Color [Lineart]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --resolution 50..600dpi (in steps of 1) [600]
        Sets the resolution of the scanned image.
  Geometry:
    --page-width 0..221.121mm (in steps of 0.0211639) [215.872]
        Specifies the width of the media.  Required for automatic centering of
        sheet-fed scans.
    --page-height 0..876.695mm (in steps of 0.0211639) [279.364]
        Specifies the height of the media.
    -l 0..215.872mm (in steps of 0.0211639) [0]
        Top-left x position of scan area.
    -t 0..279.364mm (in steps of 0.0211639) [0]
        Top-left y position of scan area.
    -x 0..215.872mm (in steps of 0.0211639) [215.872]
        Width of scan-area.
    -y 0..279.364mm (in steps of 0.0211639) [279.364]
        Height of scan-area.
  Enhancement:
    --brightness -127..127 (in steps of 1) [0]
        Controls the brightness of the acquired image.
    --contrast -127..127 (in steps of 1) [0]
        Controls the contrast of the acquired image.
    --threshold 0..255 (in steps of 1) [0]
        Select minimum-brightness to get a white point
    --rif[=(yes|no)] [no]
        Reverse image format
    --ht-type Default|Dither|Diffusion [inactive]
        Control type of halftone filter
    --ht-pattern 0..3 (in steps of 1) [inactive]
        Control pattern of halftone filter
    --emphasis -128..127 (in steps of 1) [0]
        Negative to smooth or positive to sharpen image
    --variance 0..255 (in steps of 1) [0]
        Set SDTC variance rate (sensitivity), 0 equals 127
  Advanced:
    --ald[=(yes|no)] [no]
        Scanner detects paper lower edge. May confuse some frontends.
    --df-action Default|Continue|Stop [Default]
        Action following double feed error
    --df-skew[=(yes|no)] [inactive]
        Enable double feed error due to skew
    --df-thickness[=(yes|no)] [inactive]
        Enable double feed error due to paper thickness
    --df-length[=(yes|no)] [inactive]
        Enable double feed error due to paper length
    --df-diff Default|10mm|15mm|20mm [inactive]
        Difference in page length to trigger double feed error
    --dropoutcolor Default|Red|Green|Blue [Default]
        One-pass scanners use only one color during gray or binary scanning,
        useful for colored paper or ink
    --buffermode Default|Off|On [Off]
        Request scanner to read pages quickly from ADF into internal memory
    --sleeptimer 0..60 (in steps of 1) [0]
        Time in minutes until the internal power supply switches to sleep mode
    --lowmemory[=(yes|no)] [no]
        Limit driver memory usage for use in embedded systems. Causes some
        duplex transfers to alternate sides on each call to sane_read. Value of
        option 'side' can be used to determine correct image. This option
        should only be used with custom front-end software.
    --swdeskew[=(yes|no)] [no]
        Request driver to rotate skewed pages digitally.
    --swdespeck 0..9 (in steps of 1) [0]
        Maximum diameter of lone dots to remove from scan.
    --swcrop[=(yes|no)] [no]
        Request driver to remove border from pages digitally.
    --swskip 0..100% (in steps of 0.100006) [0]
        Request driver to discard pages with low percentage of dark pixels
  Sensors:

All options specific to device `fujitsu:ScanSnap S1500:27767':
  Standard:
    --source ADF Front|ADF Back|ADF Duplex [ADF Front]
        Selects the scan source (such as a document-feeder).
    --mode Lineart|Halftone|Gray|Color [Lineart]
        Selects the scan mode (e.g., lineart, monochrome, or color).
    --resolution 50..600dpi (in steps of 1) [600]
        Sets the resolution of the scanned image.
  Geometry:
    --page-width 0..221.121mm (in steps of 0.0211639) [215.872]
        Specifies the width of the media.  Required for automatic centering of
        sheet-fed scans.
    --page-height 0..876.695mm (in steps of 0.0211639) [279.364]
        Specifies the height of the media.
    -l 0..215.872mm (in steps of 0.0211639) [0]
        Top-left x position of scan area.
    -t 0..279.364mm (in steps of 0.0211639) [0]
        Top-left y position of scan area.
    -x 0..215.872mm (in steps of 0.0211639) [215.872]
        Width of scan-area.
    -y 0..279.364mm (in steps of 0.0211639) [279.364]
        Height of scan-area.
  Enhancement:
    --brightness -127..127 (in steps of 1) [0]
        Controls the brightness of the acquired image.
    --contrast -127..127 (in steps of 1) [0]
        Controls the contrast of the acquired image.
    --threshold 0..255 (in steps of 1) [0]
        Select minimum-brightness to get a white point
    --rif[=(yes|no)] [no]
        Reverse image format
    --ht-type Default|Dither|Diffusion [inactive]
        Control type of halftone filter
    --ht-pattern 0..3 (in steps of 1) [inactive]
        Control pattern of halftone filter
    --emphasis -128..127 (in steps of 1) [0]
        Negative to smooth or positive to sharpen image
    --variance 0..255 (in steps of 1) [0]
        Set SDTC variance rate (sensitivity), 0 equals 127
  Advanced:
    --ald[=(yes|no)] [no]
        Scanner detects paper lower edge. May confuse some frontends.
    --df-action Default|Continue|Stop [Default]
        Action following double feed error
    --df-skew[=(yes|no)] [inactive]
        Enable double feed error due to skew
    --df-thickness[=(yes|no)] [inactive]
        Enable double feed error due to paper thickness
    --df-length[=(yes|no)] [inactive]
        Enable double feed error due to paper length
    --df-diff Default|10mm|15mm|20mm [inactive]
        Difference in page length to trigger double feed error
    --dropoutcolor Default|Red|Green|Blue [Default]
        One-pass scanners use only one color during gray or binary scanning,
        useful for colored paper or ink
    --buffermode Default|Off|On [Off]
        Request scanner to read pages quickly from ADF into internal memory
    --sleeptimer 0..60 (in steps of 1) [0]
        Time in minutes until the internal power supply switches to sleep mode
    --lowmemory[=(yes|no)] [no]
        Limit driver memory usage for use in embedded systems. Causes some
        duplex transfers to alternate sides on each call to sane_read. Value of
        option 'side' can be used to determine correct image. This option
        should only be used with custom front-end software.
    --side[=(yes|no)] [no] [read-only]
        Tells which side (0=front, 1=back) of a duplex scan the next call to
        sane_read will return.
    --swdeskew[=(yes|no)] [no]
        Request driver to rotate skewed pages digitally.
    --swdespeck 0..9 (in steps of 1) [0]
        Maximum diameter of lone dots to remove from scan.
    --swcrop[=(yes|no)] [no]
        Request driver to remove border from pages digitally.
    --swskip 0..100% (in steps of 0.100006) [0]
        Request driver to discard pages with low percentage of dark pixels
  Sensors:
    --top-edge[=(yes|no)] [no] [hardware]
        Paper is pulled partly into adf
    --a3-paper[=(yes|no)] [no] [hardware]
        A3 paper detected
    --b4-paper[=(yes|no)] [no] [hardware]
        B4 paper detected
    --a4-paper[=(yes|no)] [no] [hardware]
        A4 paper detected
    --b5-paper[=(yes|no)] [no] [hardware]
        B5 paper detected
    --page-loaded[=(yes|no)] [no] [hardware]
        Page loaded
    --omr-df[=(yes|no)] [no] [hardware]
        OMR or double feed detected
    --cover-open[=(yes|no)] [no] [hardware]
        Cover open
    --power-save[=(yes|no)] [no] [hardware]
        Scanner in power saving mode
    --email[=(yes|no)] [no] [hardware]
        Email button
    --manual-feed[=(yes|no)] [no] [hardware]
        Manual feed selected
    --scan[=(yes|no)] [no] [hardware]
        Scan button
    --function <int> [0] [hardware]
        Function character on screen
    --double-feed[=(yes|no)] [no] [hardware]
        Double feed detected
    --error-code <int> [0] [hardware]
        Hardware error code
    --skew-angle <int> [0] [hardware]
        Requires black background for scanning
SimulPiscator commented 3 years ago

The x and y option's maximum values correspond to an US Letter paper size. For A4, maximum y should be 297mm rather than 279. Strangely enough, page-width and page-height options allow sizes larger than that. It seems that maximum x and maximum y are synchronized with page-width and page-height settings, so AirSane should check those in addition to maximum x and maximum y.

watou commented 3 years ago

Thanks very much for looking at this and for all your work; much appreciated.

SimulPiscator commented 3 years ago

To scan from A4, you can use an option in /etc/airsane/options.conf: device fujitsu:.* page-width 210 page-height 297

watou commented 3 years ago

It appears that the version installed on my Synology is not up to date with respect to the existence of an options.conf? I see the fork here that might be the basis for the Synology package? Is there anything I can do to advance towards a solution? Thank you. If I have this right, would @patters-syno consider building a new AirSane for Synology or point me to how to DIY?

SimulPiscator commented 3 years ago

I remember that @patters-syno at least considered building a package from a more recent version of AirSane. Maybe he did so without updating his fork?

Version information is provided on the AirSane server's main web page (port 8090 by default).

As AirSane is free and open source, you also have every right to build a package yourself.

itsab1989 commented 3 years ago

I hope he is still working on building an updated version of Airsane and the sane-backends. But I guess it probably didn't make much sense to do so before DSM7 was released which changed a lot of things.

SimulPiscator commented 3 years ago

@itsab1989: Is there any possiblity to compile AirSane on the Synology device itself? I would be happy to add instructions if this is possible.

patters-match commented 3 years ago

Hi, I'll try and have a look at compiling a newer build soon, though DSM 7.0 might be its own separate challenge. Have had a hectic few months, job search etc. That's done now, so I should have some available time now.

itsab1989 commented 3 years ago

@SimulPiscator I have no knowledge about coding and compiling applications. I was also hoping that @patters-syno would give it a try so we could use an updated version on Synology devices.

watou commented 3 years ago

I used @patters-syno 's tool information to build the current source for AirSane and run it on my Synology DS1518+ running DSM 6. Observations:

  1. I was not able to get an A4 paper size in either the web interface or on the Mac. I have a file /etc/airsane/options.conf on the nas with the 3 lines given earlier.
  2. It was able to scan with macOS Preview but "stuttered" while scanning and the scanner's main status light flashed as if there was an error.
  3. Scanning from the web page would produce a PDF that could not be read by Preview, unlike the older official build. Below is some verbose log output with this session but run from the NAS command line.
  4. The log output below references "ADF Duplex" but I never had a duplex setting available or given.
sudo target/sbin/airsaned --debug=true --interface=* --base-port=8090 --access-log= --hotplug=true --mdns-announce=true --local-scanners-only=true
git commit: 335e832 (branch master, rev 174)
build date: 2021-08-05T16:20:53Z
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: fujitsu:ScanSnap S1500:27767 (FUJITSU ScanSnap S1500)
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e4024570
[source] := "ADF Duplex" -> reload options
sane_close(0x7fe8e4024570)
sane_exit()
stable unique name: fujitsu:FUJITSU ScanSnap S1500:1
uuid: 6a109ccb-2eb0-5e48-95a6-c3d9744f9b30
published as 'FUJITSU ScanSnap S1500'
listening on 127.0.0.1:8090
listening on 127.0.0.1:listening on X.X.X.X:80908091

listening on X.X.X.X:8091
listening on 169.254.89.196:8090
listening on 169.254.89.196:8091
listening on 169.254.148.231:8090
listening on 169.254.148.231:8091
listening on 169.254.177.230:8090
listening on 169.254.177.230:8091
listening on 172.17.0.1:8090
listening on 172.17.0.1:listening on [::1]:8090
8091
listening on [fe80::211:32ff:fe45:ffff]:listening on [::1]:8091
8090
listening on [fe80::211:32ff:fe45:ffff]:8091
listening on [fe80::40dd:1aff:fe4a:ffff]:8090
listening on [fe80::40dd:1aff:fe4a:ffff]listening on [fe80::1c64:87ff:fe66:ffff]:8090
:8091
listening on [fe80::542d:caff:fe0a:ffff]:8090
listening on [fe80::1c64:87ff:fe66:ffff]:8091
listening on [fe80::14ba:3eff:ffff:5610]:8090
listening on [fe80::542d:ffff:fe0a:7533]:8091
listening on [fe80::ffff:aaff:feb9:ffff]:8090
listening on [fe80::14ba:3eff:fe83:ffff]:8091
listening on [fe80::42:aaff:ffff:9674]:8091
document format requested: image/jpeg
document format used: image/jpeg
job kind: ADF single
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e00052b0
[mode] := "Color" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 50dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e00052b0) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Color"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 50dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e00052b0): End of file reached
images completed: 1
sane_cancel(0x7fe8e00052b0)
sane_cancel(0x7fe8e00052b0)
sane_close(0x7fe8e00052b0)
sane_exit()
document format requested: application/pdf
document format used: application/pdf
job kind: ADF batch
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0005df0
[mode] := "Gray" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 148mm -> reload options
[br-y] := 210mm -> reload options
sane_start(0x7fe8e0005df0) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 147.999mm
[br-y] = 210.01mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0005df0): End of file reached
images completed: 1
sane_start(0x7fe8e0005df0) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 147.999mm
[br-y] = 210.01mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 1
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 1
[variance] = 0
sane_read(0x7fe8e0005df0): End of file reached
images completed: 2
sane_start(0x7fe8e0005df0) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 147.999mm
[br-y] = 210.01mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 1
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 1
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 1
[variance] = 0
sane_cancel(0x7fe8e0005df0)
sane_cancel(0x7fe8e0005df0)
sane_close(0x7fe8e0005df0)
sane_exit()
document format requested: application/pdf
document format used: application/pdf
job kind: ADF batch
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0006b70
[mode] := "Gray" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e0006b70) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0006b70): End of file reached
images completed: 1
sane_start(0x7fe8e0006b70) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0006b70): End of file reached
images completed: 2
sane_start(0x7fe8e0006b70) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 1
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_cancel(0x7fe8e0006b70)
sane_cancel(0x7fe8e0006b70)
sane_close(0x7fe8e0006b70)
sane_exit()
document format requested: image/jpeg
document format used: image/png
job kind: ADF single
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0001350
[mode] := "Color" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e0001350) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Color"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0001350): End of file reached
images completed: 1
sane_cancel(0x7fe8e0001350)
sane_cancel(0x7fe8e0001350)
sane_close(0x7fe8e0001350)
sane_exit()
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0001820
[mode] := "Color" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e0001820) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Color"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_cancel(0x7fe8e0001820)
sane_cancel(0x7fe8e0001820)
sane_close(0x7fe8e0001820)
sane_exit()
document format requested: image/jpeg
document format used: image/png
job kind: ADF single
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0007a10
[mode] := "Gray" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e0007a10) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0007a10): End of file reached
images completed: 1
sane_cancel(0x7fe8e0007a10)
sane_cancel(0x7fe8e0007a10)
sane_close(0x7fe8e0007a10)
sane_exit()
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e00011f0
[mode] := "Gray" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e00011f0) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_cancel(0x7fe8e00011f0)
sane_cancel(0x7fe8e00011f0)
sane_close(0x7fe8e00011f0)
sane_exit()
document format requested: application/pdf
document format used: application/pdf
job kind: ADF batch
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7fe8e0019850
[mode] := "Gray" -> reload options
[source] := "ADF Duplex" -> reload options
[resolution] := 300dpi -> reload options
[tl-x] := 0mm
[tl-y] := 0mm
[br-x] := 216mm
[br-y] := 279mm -> reload options
sane_start(0x7fe8e0019850) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 0
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0019850): End of file reached
images completed: 1
sane_start(0x7fe8e0019850) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 0
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_read(0x7fe8e0019850): End of file reached
images completed: 2
sane_start(0x7fe8e0019850) with options:
[a3-paper] = 0
[a4-paper] = 0
[ald] = 0
[b4-paper] = 0
[b5-paper] = 0
[br-x] = 215.872mm
[br-y] = 279.004mm
[brightness] = 0
[buffermode] = "Off"
[contrast] = 0
[cover-open] = 0
[df-action] = "Default"
[double-feed] = 0
[dropoutcolor] = "Default"
[email] = 0
[emphasis] = 0
[error-code] = 0
[function] = 1
[lowmemory] = 0
[manual-feed] = 0
[mode] = "Gray"
[omr-df] = 0
[page-height] = 279.364mm
[page-loaded] = 0
[page-width] = 215.872mm
[power-save] = 0
[resolution] = 300dpi
[rif] = 0
[scan] = 0
[side] = 1
[skew-angle] = 0
[sleeptimer] = 0
[source] = "ADF Duplex"
[swcrop] = 0
[swdeskew] = 0
[swdespeck] = 0
[swskip] = 0%
[tl-x] = 0mm
[tl-y] = 0mm
[top-edge] = 0
[variance] = 0
sane_cancel(0x7fe8e0019850)
sane_cancel(0x7fe8e0019850)
sane_close(0x7fe8e0019850)
sane_exit()
SimulPiscator commented 3 years ago

The three lines were wrong, I forgot a dot in the first line: device fujitsu:.*

watou commented 3 years ago

OK, I've updated the file:

$ cat /etc/airsane/options.conf 
device fujitsu:.*
page-width 210
page-height 297

and re-run the binary I built from latest commit 335e832047d718fd119f19b8078904ac93eba08b and it very persisently does not want to give me an A4 paper size! I even set 210 and 297 to much bigger values with no change in paper size choises. Here is the debug log output:

$ sudo target/sbin/airsaned.335e832 --debug=true --interface=* --base-port=8090 --access-log= --hotplug=true --mdns-announce=true --local-scanners-only=true
git commit: 335e832 (branch master, rev 174)
build date: 2021-08-05T16:20:53Z
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: fujitsu:ScanSnap S1500:27767 (FUJITSU ScanSnap S1500)
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7faf48024570
[source] := "ADF Duplex" -> reload options
sane_close(0x7faf48024570)
sane_exit()
stable unique name: fujitsu:FUJITSU ScanSnap S1500:1
uuid: 6a109ccb-2eb0-5e48-95a6-c3d9744f9b30
/etc/airsane/options.conf: regex 'fujitsu:.*' matches device name 'fujitsu:ScanSnap S1500:27767'
published as 'FUJITSU ScanSnap S1500'
listening on ...
received SIGHUP, reloading
reading device options from '/etc/airsane/options.conf'
enumerating local devices...
sane_init(nullptr, nullptr)
sane_get_devices() ...
... sane_get_devices() -> SANE_Status Success
sane_exit()
found: fujitsu:ScanSnap S1500:27767 (FUJITSU ScanSnap S1500)
sane_init(nullptr, nullptr)
sane_open(fujitsu:ScanSnap S1500:27767) -> 0x7faf48103390
[source] := "ADF Duplex" -> reload options
sane_close(0x7faf48103390)
sane_exit()
stable unique name: fujitsu:FUJITSU ScanSnap S1500:1
uuid: 6a109ccb-2eb0-5e48-95a6-c3d9744f9b30
/etc/airsane/options.conf: regex 'fujitsu:.*' matches device name 'fujitsu:ScanSnap S1500:27767'
published as 'FUJITSU ScanSnap S1500'
listening on ....
hatscher commented 3 years ago

I have the same problem with the CANON DR-C125, this also does not offer the A4 format. I have made the following entry in the file /etc/airsane/options.conf:

device canon_dr:.* page-width 210 page-height 297

But this does not work either.

SimulPiscator commented 3 years ago

Thank you for the report. Device options (other than gamma) are currently broken, sorry. I will try to fix this ASAP.

c-goes commented 3 years ago

You can change the 11 in this line https://gitlab.com/sane-project/backends/-/blob/1ba63878e40a74e7863a3f2fab53c40d47dbaf0b/backend/fujitsu.c#L2541 to 11.8 and it should work. I tested with my ScanSnap and it now scans a Duplex A4 from Port 8090. macOS now also shows and scans A4 correctly. But I couldn't make the duplex work from within macOS.

SimulPiscator commented 3 years ago

Device options should be fixed now. You may update to the latest version, and try the options given above: device fujitsu:.* page-width 210 page-height 297

watou commented 3 years ago

Thank you, @SimulPiscator. I built your latest commit for Synology DSM 6.0 as before, and the web interface now shows "A4 Portrait" and Preview on Mac via AirPrint now shows A4. The scan via web produced an unusable PDF file, probably due to PDF code regarding duplex scanning. The scan via Preview/AirPrint produced a perfect A4 single-sided scan very quickly.

AirSane Server on nas
Scanners

    FUJITSU ScanSnap S1500

Build

    date: 2021-08-17T17:12:30Z

    commit: 3668c80 (branch master, revision 185)
<select autocomplete='off' name='PaperSize'>
<option value='A4 Portrait' selected>A4 Portrait</option>
<option value='A5 Portrait'>A5 Portrait</option>
<option value='A5 Landscape'>A5 Landscape</option>
<option value='A6 Portrait'>A6 Portrait</option>
<option value='A6 Landscape'>A6 Landscape</option>
<option value='Full'>Full</option>
</select>
SimulPiscator commented 3 years ago

Thank you for your report.