Scanning with Brother MFC is down and to the left, and too large #103
Description
Describe the bug
Scanning with Brother MFC is down and to the left, and too large (all 4 numbers specifying area are too large).
To Reproduce
Steps to reproduce the behavior:
If I manually choose "Flatbed" instead of "Automatic Document Feeder", there is no change (scanservjs or the scanner used the flatbed automatically regardless, which is fine).
Expected behavior
I was able to do a scan from the command line and get the correct portion:
- I scanned a preview image as follows:
SCAN_NAME="ScanImage_`date '+%Y-%m-%d_%H..%m..%S'`.png"
SCAN_PATH=~/$SCAN_NAME
/usr/bin/scanimage -d 'brother4:bus9;dev1' --source FlatBed --format=png --resolution 300 --output-file $SCAN_PATH
- I cropped the image in Gimp to the top left corner of myself in the group photo, and used the Print Size window to get the size in millimeters not including the portion I wanted. Then I did undo, then cropped including the portion I wanted, got that print size in millimeters, then calculated the difference:
# crop (mm):
# x and y are sizes not coordinates. t and l are top and left.
# 119.55,51.65 to 143.43,70.10
# would become:
# -l 119.55 -t 51.65 -x 23.88 -y 18.45
# so:
/usr/bin/scanimage -d 'brother4:bus9;dev1' --resolution 1200 -l 119.55 -t 51.65 -x 23.88 -y 18.45 --source FlatBed --format=png --output-file $SCAN_PATH
The scanner rounds it "in steps of 0.0999908" according to /usr/bin/scanimage -d 'brother4:bus9;dev1' -A
, but that rounding seemed to occur automatically and I didn't have to do any changes to the coordinates. There was a message saying it was rounded, but the scanned portion with the manual command was correct whereas scanning via the web interface was not.
- Notice that the correct numbers differ significantly from the numbers shown it the web interface when that same area is selected visually. I expected them to be slightly different since the GIMP mouse work was more accurate, but the numbers were significantly different (too far off to work correctly):
Source | Left | Top | Width | Height |
---|---|---|---|---|
scannerjs | 143 | 60 | 34 | 27 |
correct | 119.55 | 51.65 | 23.88 | 18.45 |
Client (please complete the following information):
- Browser Firefox
- Version 84
Server (please complete the following information):
- OS: Server is Ubuntu 20.04
- Node version 12.20.0
- NPM version 6.14.8
- Docker version (N/A: manual install)