* Scanner library Ada binding?
@ 2016-09-18 20:25 Stephen Leake
2016-09-20 15:21 ` gautier_niouzes
2016-10-27 21:08 ` Stephen Leake
0 siblings, 2 replies; 5+ messages in thread
From: Stephen Leake @ 2016-09-18 20:25 UTC (permalink / raw)
I'm scanning all the liner notes from my CDs (several hundred).
I've been using some old Epson software, but it's tedious. There are only 3 sizes of paper I need to scan, but the software doesn't provide for saving the sizes, so I have to "preview" and "drag the rect" for each change in size.
So I'd like to write some code to do that.
I found a Python TWAIN module, but the binary distribution is not compatible with any binary Python I could find, and compiling it from source requires MSVC (which I don't have).
So I'm looking for an Ada solution. A web search for "Ada TWAIN" didn't find anything relevant.
Does anyone have an Ada binding to the Windows TWAIN interface? I'm on 64 bit Windows 8.1, GNAT GPL 2016 (32 bit).
Or I could try Linux; I've got VMWare installed (haven't tried to see if that can see the scanner).
-- Stephe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Scanner library Ada binding?
2016-09-18 20:25 Scanner library Ada binding? Stephen Leake
@ 2016-09-20 15:21 ` gautier_niouzes
2016-10-27 21:08 ` Stephen Leake
1 sibling, 0 replies; 5+ messages in thread
From: gautier_niouzes @ 2016-09-20 15:21 UTC (permalink / raw)
[...]
> So I'm looking for an Ada solution.
If the software outputs images in standard formats like JPEG or PNG, you could use the Generic Image Decoder to clip your images in preset sizes, then save them in an easy format like PPM.
> Or I could try Linux; I've got VMWare installed (haven't tried to see if that can see the scanner).
Perhaps Simple Scan lets you set up your rectangle once for a whole bunch of scans. At least it is much more handy than what you find with Windows by default.
_________________________
Gautier's Ada programming
http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a valid e-mail address
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Scanner library Ada binding?
2016-09-18 20:25 Scanner library Ada binding? Stephen Leake
2016-09-20 15:21 ` gautier_niouzes
@ 2016-10-27 21:08 ` Stephen Leake
2016-10-28 0:00 ` Dennis Lee Bieber
1 sibling, 1 reply; 5+ messages in thread
From: Stephen Leake @ 2016-10-27 21:08 UTC (permalink / raw)
On Sunday, September 18, 2016 at 3:25:58 PM UTC-5, Stephen Leake wrote:
> I'm scanning all the liner notes from my CDs (several hundred).
...
> Does anyone have an Ada binding to the Windows TWAIN interface? I'm on 64 bit
> Windows 8.1, GNAT GPL 2016 (32 bit).
I ended up implementing a Windows Metro app, starting from a scanner sample app provided with Microsoft Visual Studio.
It was a frustrating experience. The sample code uses C++ syntax that I could not find definitions for (I think "^" is some variant of pointer). The Microsoft code documentation makes the Google Android docs look wonderful :(. There appear to be at least 2 separate sets of code; those for a Metro app (called "the Windows Runtime") and those for a Desktop app (not clear what that runtime is called). And no way to limit searches to one or the other!
The low-level scan routines only return .BMP files. The only example code I could find that would convert that to JPEG was for the Desktop runtime (the scan example is for the Metro runtime). I already have some Desktop Ada code that incorporates the JPEG files into a PDF via latex, so I added more Ada code to call ImageMagick 'convert' via GNAT.OS_Lib.
It works, and it will save time, but what a pain!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-10-31 13:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-18 20:25 Scanner library Ada binding? Stephen Leake
2016-09-20 15:21 ` gautier_niouzes
2016-10-27 21:08 ` Stephen Leake
2016-10-28 0:00 ` Dennis Lee Bieber
2016-10-31 13:36 ` Sylvain Laperche
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox