English 中文(简体)
KOFAX Bitmap Files : How can I open them?
原标题:

My C# application receives image files from KOFAX VRS TWAIN driver in TWSX_FILE mode, but neither my own .NET based application nor Windows default image viewer can open these files. However, Adobe Photoshop can open them without any problem. I tried FreeImage library and although it detects their dimensions correctly it renders black images. It seems that KOFAX has some kind of its own bitmap format which its header is different from normal bmp files: http://www.fileformat.info/mirror/egff/ch03_03.htm I have uploaded one of these files here: http://www.box.net/shared/aby42aagz4 I wanted to know how can I open these images in my applications, anybody knows any lightweight open source/free library or C++/C# code snippet, supporting this image format?

问题回答

You ve basically answered your own question: The file is neither a Windows bitmap file nor is it in the documented Kofax Raster Format.

As you pointed out, the first two bytes are BM , which would indicate the file is purporting to be a Windows bitmap. However, if that were truly the case the next four bytes would contain the file size. In your sample file, the next four bytes contain a value much bigger than the actual file size so it can t be correctly interpreted as a Windows bitmap file.

As the fileformat.info site you linked to states, if the file was truly in Kofax Raster Format, it would start with the bytes 68464B2Eh . Thus, your file isn t in Kofax Raster Format either. In fact, I tried opening it with Kofax s VCDemo software and got the following error: "Error 20204 - Internal invalid state"

Thus, Kofax s own software thinks the file is corrupt.

The fact that Photoshop can open it and display something doesn t necessarily mean it s a valid image file format. Image processing software packages will often simply try to guess at interpreting the raw bytes of the file. Sometimes they get lucky, sometimes not.

Trying to find something that can read the files assumes that the file is in a standard format, which it isn t. Thus, I wouldn t search for something that could read the file but instead search for why the VRS/TWAIN configuration you are using is producing a non-standard format.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签