[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-26 Thread Tobias Leupold
https://bugs.kde.org/show_bug.cgi?id=451082

Tobias Leupold  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

--- Comment #6 from Tobias Leupold  ---
This has meanwhile be fixed by
https://invent.kde.org/graphics/libksane/-/merge_requests/62 and
https://invent.kde.org/graphics/libksane/-/merge_requests/63 :-)

-- 
You are receiving this mail because:
You are watching all bug changes.

[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-09 Thread Tobias Leupold
https://bugs.kde.org/show_bug.cgi?id=451082

--- Comment #5 from Tobias Leupold  ---
Here we are, https://invent.kde.org/graphics/libksane/-/merge_requests/60 is
how I would do it :-)

-- 
You are receiving this mail because:
You are watching all bug changes.

[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-09 Thread Tobias Leupold
https://bugs.kde.org/show_bug.cgi?id=451082

--- Comment #4 from Tobias Leupold  ---
My coding skills are quite limited, but of course, I'll help if I can :-)

I didn't dive into the sources too much yet. The question is where this could
or should be fixed preferably. Where does the "Automatic Document Feeder"
string come from? Is this something SANE decides, or does it come directly from
the backend? Libksane simply gets it from SANE, doesn't it?

The brscan backend is proprietary, this is right. I fear we're lost here. I can
try to find out if I can report this somewhere, but I wouldn't rely on this.

Well, after all, the scanner does arguably have an ADF, with the limitation
that it can only feed one document at a time automatically.

I only thought that having an additional "only one scan at a time" option for
devices with an ADF would possibly be a benefit for everbybody not wanting to
trigger batch scans, even if multiple documents are provided by the ADF.

So, leaving Brother's upstream out: We can blacklist this very device or add an
option. If you want, I can try to add it and create a PR if I succeed. What
option would you prefer? As said, I think that an additional option would
possibly be a benefit for all ADF devices (and when set to true, the current
behavior also would remain unchanged).

Also, I think that for devices with only one "source" option, this option
should not be exposed, as it can't be changed anyway. What do you think?

I'll see how far I can get ;-)

-- 
You are receiving this mail because:
You are watching all bug changes.

[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-09 Thread Kåre Särs
https://bugs.kde.org/show_bug.cgi?id=451082

Kåre Särs  changed:

   What|Removed |Added

 Status|REPORTED|CONFIRMED
 Ever confirmed|0   |1

--- Comment #3 from Kåre Särs  ---
I think this is a bug in the backend, if it is not an "Automatic Document
Feeder" it should not advertise itself as one.

My preferred solution would be to have the brother backend "fixed". Maybe it
should state only "Document feeder"?

Then again this is not a thing that is governed by the sane-standard and only
heuristics in libksane... :( 

Adding an option like you said is not impossible either, but a bit ugly
workaround for something that could be "fixed" in the backend... Then again
there might be code shared between multiple brother scanners and that would add
extra burden there...

You seem to have coding skills ;) maybe you want to help?
1) My first choice would be to ask brother to fix it.  Seems to be proprietary
:( 
2) Add a public API to libksane and use that in Skanlite.

3) A bit risky variant would be to "blacklist" ADF for that model 

Are you willing to do it?

-- 
You are receiving this mail because:
You are watching all bug changes.

[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-08 Thread Tobias Leupold
https://bugs.kde.org/show_bug.cgi?id=451082

--- Comment #2 from Tobias Leupold  ---
What about some option like "Start ADF batch scans automatically" or such,
which is checked by default if m_executeMultiPageScanning is evaluated to be
true? This way, this could be unchecked for e.g. the Brother DS-640, and the
underlying infrastructure would not have to be changed?

-- 
You are receiving this mail because:
You are watching all bug changes.

[libksane] [Bug 451082] libksane should not expose "source" for the Brother DS-640

2022-03-03 Thread Tobias Leupold
https://bugs.kde.org/show_bug.cgi?id=451082

Tobias Leupold  changed:

   What|Removed |Added

 CC||t...@l3u.de

--- Comment #1 from Tobias Leupold  ---
The problem seems to be that, as soon as the "source" option contains something
that looks like the device had an ADF, multi page scanning is activated:

void KSaneCorePrivate::determineMultiPageScanning(const QVariant &value)
{
const QString sourceString = value.toString();

m_executeMultiPageScanning =
sourceString.contains(QStringLiteral("Automatic Document Feeder")) ||
sourceString.contains(sane_i18n("Automatic Document Feeder")) || 
sourceString.contains(QStringLiteral("ADF")) ||
sourceString.contains(QStringLiteral("Duplex"));
}

And here, it's started automatically:

void KSaneCorePrivate::imageScanFinished()
{
Q_EMIT q->scanProgress(100);
if (m_scanThread->frameStatus() == KSaneScanThread::ReadReady) {
Q_EMIT q->scannedImageReady(*m_scanThread->scanImage());
// now check if we should have automatic ADF batch scanning
if (m_executeMultiPageScanning && !m_cancelMultiPageScan) {
// in batch mode only one area can be scanned per page
Q_EMIT q->scanProgress(-1);
m_scanThread->start();
return;
}
...

m_cancelMultiPageScan can, as far as I could see it, only be set to true by
calling KSaneCore::stopScan().

Can we even fix this within libksane? Or is this something upstream should care
about?

-- 
You are receiving this mail because:
You are watching all bug changes.