sbs20 / scanservjs

SANE scanner nodejs web ui
https://sbs20.github.io/scanservjs/
GNU General Public License v2.0
722 stars 142 forks source link

Default Fractional Scan Dimensions Give Invalid Parameter Error #600

Open connorb777 opened 1 year ago

connorb777 commented 1 year ago

Describe the bug Default scan dimensions cause invalid parameter error when attempting to preview. This seems to be the result of the default x dimension being 228.6, since scanning regularly works fine with whole numbers, but I can't figure out where I should go to change this.

To Reproduce Steps to reproduce the behavior:

  1. Install using one-line installer command
  2. Go to server address (127.0.0.1:8080)
  3. Click preview

Expected behavior Scanner scans a preview

Screenshots image

Client (please complete the following information):

Server (please complete the following information):

Logs https://pastebin.com/ZzxgbLQX

Additional context

sbs20 commented 1 year ago

Odd.

To answer your specific question, this recipe should help you.

So the app is running:

/usr/bin/scanimage -d hpaio:/usb/hp_LaserJet_3030?serial=00CNBM002126 --source Auto --mode Color --resolution 100 -l 0 -t 0 -x 228.6 -y 381 --format tiff --brightness 0 --contrast 0 -o data/preview/preview.tif

Which results in

Error: /usr/bin/scanimage -d hpaio:/usb/hp_LaserJet_3030?serial=00CNBM002126 --source Auto --mode Color --resolution 100 -l 0 -t 0 -x 228.6 -y 381 --format tiff --brightness 0 --contrast 0 -o data/preview/preview.tif exited with code: 1, stderr: scanimage: setting of option --br-x failed (Invalid argument)

The scanner is reporting:

Apr 24 21:35:04 raspberrypi server.js[10934]:         '  Geometry:\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '    --length-measurement Unknown|Unlimited|Approximate|Padded [Padded]\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        Selects how the scanned image length is measured and reported, which\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        is impossible to know in advance for scrollfed scans.\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '    -l 0..228.6mm [0]\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        Top-left x position of scan area.\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '    -t 0..381mm [0]\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        Top-left y position of scan area.\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '    -x 0..228.6mm [228.6]\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        Width of scan-area.\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '    -y 0..381mm [381]\n' +
Apr 24 21:35:04 raspberrypi server.js[10934]:         '        Height of scan-area.\n' +

So on the face of it, everything "should" just work.

Anyway, you've verified that it's definitely the decimal that's doing it? What do these do?

vaneno commented 10 months ago

Hello. Same problem with a HP3052 . Preview option gives me the same error as the op. The scanimage -A show the geometry as 228.6 .

Try geometry commands: original 228.6 : error with the 228.5 : works nice with 227.6 : works nice with 228: works nice

I install hplip in docker image to access the scanner.