Unable to scan 3.5GB image using C# Twain/WIA

283 views Asked by At

I'm trying to scan a 2400DPI A3-size image to TIFF with an Epson scanner using C# (which will result in a 3.5GB uncompressed TIFF). I've tried twain-cs, twaindotnet and ntwain as wrappers (which should use the 64-bit capable twaindsm.dll) as well as WIA.

In all cases when telling Twain to scan to file - just over halfway (the expected 2GB mark) it gives an error that the driver doesn't have enough memory to do that. Unless I set it to save using jpeg compression (as the Epson driver doesn't seem to have lossless compression for photo formats).

When telling Twain to do a memory transfer, it does the full scan, but when I tranfer the memory and write it to a TIFF (using libTiff), the first half is okay (which I guess is around 2GB), the last half is just a single line repeated (still not sure which line, as it doesn't seem to be the last line it has scanned). So even though it doesn't generate an error, it has a problem after the 2GB mark.

WIA gives me a hard limit of 1200DPI, which I think is a limit set in the Epson driver. Next to that, I haven't been able to get WIA to tranfer directly to file As I can't find a way to set TYMED_FILE (and all C++ code I find uses low-level minidriver calls). Also haven't found a way to get the stream so I can write it to a file myself. Creating a minidriver then gives me a problem with an unsigned (and certainly not MS certified) driver.

Any help or links that will point me in the right direction will be welcome!

0

There are 0 answers