KOFAX 位图文件:如何打开它们?

发布于 2024-09-27 09:36:36 字数 522 浏览 2 评论 0原文

我的 C# 应用程序以 TWSX_FILE 模式从 KOFAX VRS TWAIN 驱动程序接收图像文件,但我自己的基于 .NET 的应用程序和 Windows 默认图像查看器都无法打开这些文件。但是,Adobe Photoshop 可以毫无问题地打开它们。 我尝试了 FreeImage 库,尽管它正确检测了它们的尺寸,但它呈现黑色图像。 KOFAX 似乎有某种自己的位图格式,其标头与普通 bmp 文件不同: http://www.fileformat.info/mirror/egff/ch03_03.htm 我已在此处上传了这些文件之一: http://www.box.net/shared/aby42aagz4 我想知道如何在我的应用程序中打开这些图像,有人知道支持这种图像格式的轻量级开源/免费库或 C++/C# 代码片段吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

杯别 2024-10-04 09:36:36

您基本上已经回答了自己的问题:该文件既不是 Windows 位图文件,也不是记录的 Kofax 光栅格式。

正如您所指出的,前两个字节是“BM”,这表明该文件声称是 Windows 位图。但是,如果确实如此,接下来的四个字节将包含文件大小。在示例文件中,接下来的四个字节包含比实际文件大小大得多的值,因此无法将其正确解释为 Windows 位图文件。

正如您链接到的 fileformat.info 网站所述,如果文件确实采用 Kofax 光栅格式,则它将以字节“68464B2Eh”开头。因此,您的文件也不是 Kofax 光栅格式。事实上,我尝试使用 Kofax 的 VCDemo 软件打开它,并收到以下错误:“错误 20204 - 内部无效状态”

因此,Kofax 自己的软件认为该文件已损坏。

Photoshop 可以打开它并显示某些内容这一事实并不一定意味着它是有效的图像文件格式。图像处理软件包通常会简单地尝试猜测文件的原始字节的解释。有时他们很幸运,有时则不然。

尝试找到可以读取文件的东西假定该文件采用标准格式,但事实并非如此。因此,我不会搜索可以读取文件的内容,而是搜索为什么您正在使用的 VRS/TWAIN 配置会生成非标准格式。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文