-
Notifications
You must be signed in to change notification settings - Fork 136
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
Implement --page-height
and --page-width
#401
Comments
Hi. This should hopefully work for you: https://github.com/sbs20/scanservjs/blob/master/docs/config.md#override-scanner-dimensions |
Thats amazing! I will try it today :) |
So i created a config:
which gets picked up correctly but the problem is that the cli argument
therefore we run into the issue described here: https://alioth-lists.debian.net/pipermail/sane-devel/2015-January/032999.html I checked and ran the following command manually:
and this works like a charm. Can I force the param to be set? |
Hmm. It's not configurable. I'd be up for making it configurable but probably won't get to it all that quickly. You could manually add a line somewhere round here though:
If it works then we can figure something out. |
I guess something like if ('page-height' in params) {
cmdBuilder.arg('--page-height', params.pageHeight);
} should cover this case right? By default it would not be set but if i overwrite the device configuration it should be appended. As far as I understood the mailing list the |
Should |
As far as I understood the documentation it seems that this is an attribute that is supported by some scanners. Mostly the ones with ADF but eg. some brother scanners do seem to have some troubles with it. Gut feeling from my side is I would not set it by default but rather as an opt-in. |
Agreed. But would anyone ever need to change |
No i think can be set once and forget about it afterwards. In my case I would probably set it to 800 or similar but the x and y limits are the options i want to modify in the ui. |
Well, you are right, I want to use 297 for my scanners and have a problem: For my Fujitsu scanner, I have to set
However, then I cannot use my Samsung scanner (SCX 3405 FW). Hence, page-height must not be set. So is it possible to set |
Does anyone have an idea how to solve this problem? |
I can confirm the same issue happens for a Fujitsu Fi-7160. I can't select A4 even though the scanner supports dimensions of up to 224mm (width) and 2750mm (height). It even detects the page size if you set it higher, but scanservjs cuts the pages off. It doesn't seem to detect the maximum scannable size correctly, in the UI the max I can select is 215.8x279.3 |
Here's the relevant help section from my scanner:
It seems like the scanservjs takes the ranges from l,t,x,y, which are apparently constrained by the defaults for page-width and page-height (not their respective maximums) |
Issue #401 The original fix for #401 involved adding additional arguments for `scanimage` but globally. This had a bad side-effect for users with multiple scanners with differing characteristics. The new solution treats these additional parameters as first class citizens and automatically adds them as required. The UI still does not present the user with the ability to override the values - although the API supports it should that become a requirement in the future. As a result the app always uses the default values provided by SANE. The net result is that `scanimageAdditionalParameters` has been removed and is ignored. And no customisation should be required at all. However, in the event that the values provided by SANE are unsatisfactory, then it is possible to override the value as per all other device customisation - this has been noted in the `config.md` doc. Other changes: * Updated the yml used by swagger to refect the new parameters * There is more granular checking of the individual geometry elements now - the previous behaviour relied on a bad assumption that `x`, `y`, `t` and `l` were always there or always not. * Additional unit tests
I'm hoping that PR #503 resolves this issue properly. I've added notes about the implementation in the PR. If anyone is able to test, then that would be great. You may still need to tinker with the device settings - how to do so is documented too. You can see the changes in the PR. |
--page-height
and --page-width
Thanks a lot, I will give it a try! |
Hi, |
I have a Fujitsu fi-7260. When I change the source to Flatbed, I get the following error:
It seems the page-height option is inactive with the Flatbed source, but I do need this option for ADF source to be able to properly scan Legal-size documents. I've tried both the current implementation and #503 to no avail. Thoughts? |
Thank you - that's really helpful. Ok. So if the source = Flatbed then I need to exclude Actually - can you share the output of |
@sbs20 Sure thing. Here's the output. First is the defaults (with Flatbed as source):
And here's one with ADF Front as source (truncated since only the Geometry section changed):
|
@JMacalinao that is really really helpful. And kind of bad! It's opened up a whole can of worms in that I did not know you coud run |
So just looking at this again, I think that #503 will help in that the Flatbed option should not throw an error since it excludes the option. But it won't help with the ADF option since it thinks that I think I'm going to merge #503 in to mainline for now since it's better than it was and at least enables users to override |
Issue #401 The original fix for #401 involved adding additional arguments for `scanimage` but globally. This had a bad side-effect for users with multiple scanners with differing characteristics. The new solution treats these additional parameters as first class citizens and automatically adds them as required. The UI still does not present the user with the ability to override the values - although the API supports it should that become a requirement in the future. As a result the app always uses the default values provided by SANE. The net result is that `scanimageAdditionalParameters` has been removed and is ignored. And no customisation should be required at all. However, in the event that the values provided by SANE are unsatisfactory, then it is possible to override the value as per all other device customisation - this has been noted in the `config.md` doc. Other changes: * Updated the yml used by swagger to refect the new parameters * There is more granular checking of the individual geometry elements now - the previous behaviour relied on a bad assumption that `x`, `y`, `t` and `l` were always there or always not. * Additional unit tests
So, I scanned a lot of documents today and the following command worked fine:
Config:
|
Looks like it's still including
I can confirm ADF source ignored I'm on the mainline now, using the config below:
Regardless, I'll just have to wait until #510 is resolved since apparently what I uncovered is a whole different ball game (umm... you're welcome? lol). I'm cool with staying at v2.23 for now. |
That makes sense - you're specifically overriding the Which has given me an idea (forgive any mistakes, this is freestyle): module.exports = {
afterDevices(devices) {
// Set common defaults for any usage of this scanner
devices.filter(d => d.id.includes('fujitsu'))
.forEach(device => {
device.name = 'Fujitsu (Flatbed)';
device.features['--mode'].default = 'Color';
device.features['--resolution'].default = 300;
device.features['-t'].limits = [0, 356];
device.features['-y'].limits = [0, 356];
});
// Create a clone of the flatbed settings
const fujitsuAdf = JSON.parse(JSON.stringify(devices.filter(d => d.id.includes('fujitsu'))[0]));
fujitsuAdf.name = 'Fujitsu (ADF)';
fujitsuAdf.features['--page-height'] = {
default: 356,
limits: [0, 356]
};
// Add the clone as a whole new device
devices.push(fujitsuAdf);
}
}; |
That works for Flatbed. Thanks! Unfortunately, |
Figured it out. @sbs20 I have it on my fork in the meantime, but if you want this merged, just let me know so I can put up a PR. |
Oh nice one! That's really helpful. I'm retiscent to use |
Describe the bug
I have a FUJITSU fi-6130dj scanner. It is well supported with sane but I can not scan a full A4 page (297mm). At the moment the max setting on the scanservjs frontend is 279.364mm in height. I searched the internet a bit and found this thread from 2011: https://alioth-lists.debian.net/pipermail/sane-devel/2015-January/032999.html which seems to tackle a similar problem.
Expected behavior
I would like to use the full scan range of
y = 0..879.489mm
andx = 0..224.846mm
Client:
Server:
Logs
Device Info
The text was updated successfully, but these errors were encountered: