RT: scanning

Brian K. White brian at aljex.com
Tue Nov 2 15:16:29 PDT 2010


Getting there...

I found a public domain twain library and got it to compile from source 
and made a working, if utterly basic, non-interactive command-line scan 
util.

The library has limitations that it can only grab a single image and 
only knows how to write BMP.

The util has further limitations that it's all hard coded and only 
accepts one command line argument, which is the filename to save the BMP to.

With this you _could_ actually make a fully open source scanning 
solution already, because you could wrap the basic util in small script 
to loop and re-run the util until a feeder is empty, incriment the 
output filenames, process the bmp's with imagemagick to turn the bmp's 
into whatever you want.

But I actually have a whole different, open source, text console mode 
twain scanner app (from the twain group themseves, on sourceforge) that 
uses the FreeImage library, so I can probably get the util to save in 
any format the FreeImage library support pretty soon. The FreeImage 
library is open source, so I could get away with just including a copy 
of the .dll they provide on their site, but I'm working on getting that 
to compile from source as part of the same project as the other stuff.

And I found a modified version of eztwain that DOES include a looping 
variant of the AcquireNative function and a callback mechanism so you 
can process images in separate threads as soon as the first one is 
acquired while the main thread keeps acquiring new images as fast as the 
scanner can deliver them. This needs to be cherry-picked out because 
that version of eztwain was also changed in other ways to make a delphi 
library instead of a windows.dll, but it looks actually pretty doable.

So, I think before too long we may have a util that starts to be as 
useful as things like Informatik ScanCMD50.exe, Dosadi Acquire.exe, 
Dynarythmic TwainSave.exe, etc... But completely open source.

I'll be updating the public repo shortly. Until then a copy is here:
http://install.aljex.com/AljexClient/eztwain.7z
http://install.aljex.com/AljexClient/eztc.7z

Just put eztw32.dll and eztc.exe in a directory and run "eztc test.bmp"

I haven't written any wrapper script around it yet because I think I'm 
close enough to making such a wrapper obsolete that I'd rather just keep 
plugging at the util itself for now and see how far I get. The only 
reason I'm even posting the current results at this early stage is 
because this is now just past the possible vs not-possible milestone. It 
functions and it's non-interactive and it's a stand-alone exe and it's 
fully open source and nothing quite like it with all 4 qualities existed 
yet. It's now possible to attach scanning in a functional way to a 
legacy app, all for free, in both the beer and speech senses. It only 
gets better from here. The next 10 steps to go from proof of concept or 
prototype to pretty-good tool are comparatively smaller easier and fewer 
steps than the first big one to get to this point.

-- 
bkw


More information about the Filepro-list mailing list