-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scanning with Brother MFC is down and to the left, and too large #103
Comments
Can you upload the logs please? Something like this should work: sudo journalctl | grep server.js > scanservjs.log.installed.txt |
Here you go: |
The log may help with #102 as well, and may help with the docker part if the docker version uses the same log file. |
What's different about this scanner is that the x/y ratio is not an ISO standard - i.e. it's not A4 / A5. The ratio of this scanner is I had thought that the UI (which translates the pixels to mm) was getting confused because of the different aspect ratio (which is a bug) and sending the wrong values for scanning. And, the evidence suggests this is likely the case. What I can't figure out is quite why or where this is happening - every attempt I have made to reproduce this has failed. Out of interest, if you just reload the page now, does it fix itself? (it may be a bug in reloading the preview image) |
I tested it a few times so I don't think reloading the preview helps. I'll try the fix, thanks! |
I got the same issue today with a Brother MFC 7320. |
I wonder if this is something to do with the source. Does it get closer when set to |
Is this issue still present? I made some changes recently for #118 which may make a difference to this. Not being able to reproduce myself, makes it hard to test! |
Sorry, I didn't see your answer from February. |
If you're doing a direct install (not docker) then there is now a one line install which should preseve all your existing config for you. That said, devices.json will get recreated as it's a new version.
Yeah, that's mostly what I do too!
Thank you - very kind!! |
😄
You're right. That is very interesting. So, I'm wondering if I can ask you to run a few tests for me and share the logs of what happens - not urgent, and completely understand if you don't have time. But I want to see where and why a square is turning into a rectangle.
Thank you! |
Hope it'll be useful, sorry, I changed the document inbeween, and left ADF selected but my scanner uses FB instead since it senses there is nothing in FB... I'm happy to help if you like this, just don't expect snappy answers outside weekends due to time-consuming day-job on weekdays... |
Thank you so much. Same here for weekdays! One other thing, any chance of the logs? The final piece of the puzzle! |
Hmm.. Where can I find the logs ? |
I did this, shoudl contain what you need There are quite a few scans/preview I failed and did not paste above, sorry if it's a bit of a mess to find which logs corresponds to which scan, already deleted the files that could have contained the hour:minute... |
I usually do |
Ok. Observations:
Some questions for when you next get a chance to look at this.
Hypothesis
I have also found a bug which may be masking this issue. The preview code ignores the source (so it's always using the ADF setting). |
Will come back with scanimage and exact dimensions later, but in fact the pane of glass of the flatbed is indeed a bit larger and quite a bit higher than standard A4 paper, 355mm sounds right, will check though. But I've never really used it to scan anything higher than an A4 sheet of paper and I always got the feeling that somehow it tends to "snap" onto A4 size, especially with ADF I remember having scanned several sheets of A4 stuck together by the short size to make like a rolled paper and feeding it through the ADF, it will scan the first page and then continue unrolling until the end of the paper before wanting to scan the next page. |
For whenever you get a chance... New hypothesis:
Tests:
My suspicion (hope) is that the flatbed will be ok, but the ADF will not. Thank you so much for your help with this. And no need to hurry! 🙏 |
Thank you so much for all your help!! I think this gives me enough to guess what's happening but I need time to write it up. Thanks again! |
Ok, as you hinted at, I think the clue is in:
The preview image in the screenshot has an approximate ratio of 1.41 which is the same as the ISO (e.g. A4) ratio. If the preview was the size we'd expect (from the scanner dimensions) it would have a ratio of more like 1.65 (355/215). Therefore I'm willing to guess that running the following command line will result in an A4 scan: /usr/bin/scanimage -d 'brother3:bus2;dev1' --mode '24bit Color' --source 'FlatBed' --resolution 200 -l 0 -t 0 -x 215 -y 355 --format 'tiff' > ~/ratio-test.tif Assuming that is the case then something between and including Once we assume that the auto-cropping is happening, everything else follows... the software uses the aspect ratio of the scanner (not the image), then the cropping will be off - as I'd expect. If it's the case that the scanner is doing this, then as far as I can see, there is no reasonable fix and I will close this issue. |
So yes, something is cropping to A4 regardless... So I'm perfectly fine with this issue being closed since the issue is realy in the scanner not doing what it's being told. I'm simply going to trust you that relying on the scanner reported dimensions is the right way and not analyzing the file it returns. Nonetheless, now that I've been able to test it under windows, I can confirm, despite the physical size of the scanner being larger than A4, there is no way in which I got the scanner to scan anything larger than A4, even in preview mode or anything, and using the manufacturer's tools or windows integrated tools... So maybe as a hack, do you have any idea on how to trick the tools in believing the scanner reports a size of A4 paper an no bigger ? Or is it something hardcoded in the driver and we can't change it ? I'm in the process of editing the devices.conf to fake the dimensions, will report back if any sucess. |
Bizarre! Ok cool.
Yes. Create / edit a afterDevices(devices) {
const device = devices.filter(d => d.id.includes('brother'))[0];
if (device) {
device.features['-l'].limits = [0, 215];
device.features['-t'].limits = [0, 297];
device.features['-x'].default = 215;
device.features['-x'].limits = [0, 215];
device.features['-y'].default = 297;
device.features['-y'].limits = [0, 297];
}
} |
Also... Week after the fact, I see that the scanner reports to be able to scan in a lot of resulutions that it is in fact not capable of, it tops out at 1200dpi in real life, and scanservjs sees it having a max at 9600dpi... Any proposal for device.features['resolution'].max=1200 ? Also, I'm not seeing A4 in the proposed paper sizes in the preview window. 5Sorry, I'm turning this issue into a bit of a mess). Going back to testing the new size and config.local.js Edit: I'm trying to scan at 1200dpi to get more pixels and have a better calculation of the real scan size, so I noticed that the scanner is taking so long that it seems scanservjs is giving up on it and does not show the scanned file... I'm doing this in console to see what it does, the tiff is already at 200MB and still growing, maybe that's an issue for scanservjs ;) |
Also add the following to the local config to control the resolutions (use your own values) device.features['--resolution'].default = 150;
device.features['--resolution'].options = [75, 150, 300, 600];
Paper sizes greater than the device dimensions are excluded - my guess is that the dimensions have at least one axis less than the equivalent A4 axis. Note that there's a bug pre
Haha - don't worry - this is all very helpful!
Yeah, I have seen than before. I'm more inclined to limit the resolutions than do anything else. |
so, your options to limit the resolution looks fine and works for me too ! As you guessed, the real size turned out to be below A4 paper size in my calculations. But now I'm giving up, since I believe the scanner is a lost cause, in fact it crops quite a bit into a real a4 paper, but when I try setting the real size or get too close to it I hit some weird artifacts where the lost bottom of the page repeats in a vertical band on the right of the paper.... That magically disappeared when I set source to FlatBed... I've got it setup to be able to select A4 paper size in case someone wants to use it, and with a size set to 210x297 I'm now not too far off, just by what the scanner realy crops... I have the workaround to scan then crop, for a feature I almost never use, that'll be fine... Anyway, I pimped up my config.local.js quite a bit:
But also fixed up my prefered pipelines and added them on top of the list:
Too lazy to search for the length of my pipelines and make a loop, it's been too long since I last did some javascript... I do like this pipeline that give both the pdf with OCR and the jpg thought, I use this for archiving ! Maybe one day I'll get around to making a pdf-a since pdf+jpg is probably not the best for archiving, pdf-a might be preferrable... Anyway, that's now in a state where I'm very satisfied with what it does ;) Scanning from my phone is a breeze ! Thanks again ! |
Maybe one last thing : is there an easy way for me to "disable" the Auto(Reverse) batch mode since I only use Auto(Collate) ? |
Right. I'm going to close this. Root issue is mismatch between SANE reported values and what actually happens. Addressed with documentation here
This recipe might help!
I've raised #223 for you.
Done. See #222 (I also disabled that mode by default since I doubt anyone uses it) |
Awesome! Thanks a lot and congrats again on the amazing soft! |
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:
Click Preview
Choose an area:
Scan
Click "Files."
You get (blurred for privacy):
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:
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.Client (please complete the following information):
Server (please complete the following information):
The text was updated successfully, but these errors were encountered: