Bug 387268 - Acquire Image Tool Not Found under Windows : Twain interface not ported to KF5
Summary: Acquire Image Tool Not Found under Windows : Twain interface not ported to KF5
Status: RESOLVED FIXED
Alias: None
Product: libksane
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Kåre Särs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 16:04 UTC by hardy.public
Modified: 2017-12-30 18:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Scanner Installed OK. (23.49 KB, image/png)
2017-12-28 10:57 UTC, hardy.public
Details
Debug Log (25.23 KB, text/plain)
2017-12-28 10:57 UTC, hardy.public
Details
XnView can select both scanners. (7.93 KB, image/png)
2017-12-28 11:55 UTC, hardy.public
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hardy.public 2017-11-24 16:04:57 UTC
I am using a CanoScan 4200F on Windows 10. I can scan using the CanoScan Toolbox but I can't see the Acquire Image tool mentioned in the help.

Any help would be appreciated.
Comment 1 caulier.gilles 2017-11-24 17:22:25 UTC
The Acquire Image tool relie on libksane which must be compiled under Windows, but it is not in fact. This is why the tool is not available.

I will investigate to found the reason.

Gilles Caulier
Comment 2 caulier.gilles 2017-11-26 14:56:38 UTC
Git commit 08529d131824c3b4c2fca1e2126ef6007124ed82 by Gilles Caulier.
Committed on 26/11/2017 at 14:52.
Pushed by cgilles into branch 'master'.

Prepare to compile libksane under MacOS and Windows.
My older Windows port through Twain interface of libksane have been dropped. Code
still in libksane but it's not compiled. This must be fixed by libksane maintainers.

M  +75   -16   project/bundles/3rdparty/ext_libksane/CMakeLists.txt
A  +74   -0    project/bundles/3rdparty/ext_libksane/libksane-drop-ktextwidgets.patch

https://commits.kde.org/digikam-software-compilation/08529d131824c3b4c2fca1e2126ef6007124ed82
Comment 3 caulier.gilles 2017-11-26 15:01:48 UTC
The problem with Windows digital scanner support is more complex than expected.

In the past (KDE4), i written myself a Qt Windows Twain interface in libksane to use as well to replace libsane UNIX support.

Now, with KF5, this one have been disabled and not ported to Qt5.

So, the libksane maintainer need to restore this feature :

https://cgit.kde.org/libksane.git/tree/CMakeLists.txt#n154
https://cgit.kde.org/libksane.git/tree/ksanetwain

So, i move this file to libksane components to ask viewpoint to maintainer.

Gilles Caulier
Comment 4 hardy.public 2017-11-26 15:08:12 UTC
Thank you for progressing this Gilles.
Comment 5 Kåre Särs 2017-11-27 20:05:32 UTC
Ack

Added to my todo.

Regards,
  Kåre
Comment 6 Kåre Särs 2017-12-21 05:10:32 UTC
Git commit 006bc99296b5d2ec39f9e51c6e03cde5d6236c90 by Kåre Särs.
Committed on 21/12/2017 at 05:02.
Pushed by sars into branch 'master'.

Port the twain wrapper to Qt5 and KF5

The twain wrapper seems to work on par with the Qt4/KDE4 version.
Both versions work with a twain test scanner, but fail with my
Canon MX455.

We still have to check translation.

M  +21   -22   CMakeLists.txt
M  +31   -18   ksanetwain/CMakeLists.txt
M  +5    -5    ksanetwain/ktwain_widget.cpp
M  +78   -41   ksanetwain/twainiface.cpp
M  +3    -3    ksanetwain/twainiface.h
M  +1    -0    src/CMakeLists.txt

https://commits.kde.org/libksane/006bc99296b5d2ec39f9e51c6e03cde5d6236c90
Comment 7 caulier.gilles 2017-12-27 22:34:55 UTC
I just rebuild the digiKam 5.8.0 pre-release bundle with libksane + new twain interface for Windows. You must be able to use the scanner interface now. 32 and 64 bits installer are here :

https://files.kde.org/digikam/

Please test and report here. Thanks in advance...

Gilles Caulier
Comment 8 hardy.public 2017-12-28 10:01:13 UTC
I see the Import -> Import From Scanner... menu option but absolutely nothing happens.

I searched for some info and found some worrying comments on deprecated TWAIN support in Windows in favour of WIA.

https://www.tenforums.com/drivers-hardware/46516-unable-open-twain-source-post629295.html#post629295

https://docs.microsoft.com/en-us/windows-hardware/drivers/image/twain-compatibility

Not sure if its relevant to this problem though.

I tried the solution posted here but no improvement:

https://www.tenforums.com/drivers-hardware/46516-unable-open-twain-source-post792019.html#post792019
Comment 9 hardy.public 2017-12-28 10:57:04 UTC
I checked the DbgView log and there is no reaction to my clicking the "Import From Scanner". It's like the menu option doesn't trigger any event.

Also I'm not sure there's any problem in Windows now because it seems to recognise my scanner OK. See picture attached.
Comment 10 hardy.public 2017-12-28 10:57:28 UTC
Created attachment 109552 [details]
Scanner Installed OK.
Comment 11 hardy.public 2017-12-28 10:57:45 UTC
Created attachment 109553 [details]
Debug Log
Comment 12 Kåre Särs 2017-12-28 11:28:04 UTC
Do you get the same problem with this virtual scanner?

https://developer.dynamsoft.com/dwt/kb/2659
Comment 13 hardy.public 2017-12-28 11:54:42 UTC
Yes, same problem.

In XnView MP I can select the virtual scanner and my CanoScan 4200F but still nothing happens in digiKam.
Comment 14 hardy.public 2017-12-28 11:55:05 UTC
Created attachment 109554 [details]
XnView can select both scanners.
Comment 15 caulier.gilles 2017-12-30 17:01:28 UTC
TWAIN is perhaps deprecated under Windows, but it's a legacy digital Acquisition system which must work as expected. From wikipedia page, this one still maintained until now :

https://en.wikipedia.org/wiki/TWAIN

The advantage of Twain is the compilation one : it do not require an extra library from Microsoft. All is include in core. This is why we can cross compile whole DK with Twain support under Linux as well. This is a great advantage, because we won't to require Windows and MSVC to compile the whole DK bundle including Qt5, KF5, and all extra dependecies required. With a cross compiler open source as MXE, i just to press a button under Linux, and 2 hours later, the installer is ready to use under Windows. Magic.

In other words, i won't to use M$ stuff to compile whole DK : it's just a waste of time. M$ is not a devel env for me, it's just a graphic console dedicated to run softwares.

I'm my viewpoint, very negative about Windows, but it's the reality. I devel cross plateform softwares in my office, and Windows is THE computer puzzle for developers.

So, from my side, There is no way to switch whole DK windows compilation in the future, and until the end of the world.

Gilles Caulier
Comment 16 caulier.gilles 2017-12-30 17:02:38 UTC
Ah and i forget another VERY important point for me : cross compile under Linux ==> no M$ virus possible at end in the bundle (:=)))...

Open source must be safe for end users.

Gilles Caulier
Comment 17 caulier.gilles 2017-12-30 17:59:09 UTC
It's clear :

https://en.wikipedia.org/wiki/Windows_Image_Acquisition

WIA is a "proprietary" SDK... It will be difficult to use in open source world...

Gilles Caulier
Comment 18 hardy.public 2017-12-30 18:08:23 UTC
No problem. I guess those comments on WIA was a false alarm because it seems TWAIN still works on Windows 10 anyway.
Comment 19 caulier.gilles 2017-12-30 18:14:00 UTC
I think the problem with button from dialog in TWAIN interface is due to a wrong re-route of TWAIN event loop to Qt5. This last one work fine with Qt4, but with Qt5, this require certainly more indeed tunes.

Perhpas a post to Qt community wiki can help.

Look here : https://forum.qt.io/topic/53770/problem-with-qt-5-4-1-and-twain/2

Gilles Caulier
Comment 20 caulier.gilles 2017-12-30 18:20:55 UTC
As it's explained here, the Twain scanner driver must be installed before to use on target Windows computer :

https://github.com/manisandro/gImageReader/wiki/FAQ

gImageReader can use Twain under Windows and as a frontend written in Qt5. So perhaps the solution can be found here...

Gilles Caulier