如今,Macintosh 上的 TWAIN 状态如何?

发布于 2024-09-30 03:23:25 字数 1243 浏览 3 评论 0原文

我目前正在进行一个项目,我们希望在 PC (Windows) 和 Macintosh 上与 TWAIN 扫描仪进行交互。

在 Windows 上,我们基本上已经把一切都准备好了,并且代码可以在绝大多数扫描仪上成功运行。

在 Mac OS X 上,我们基本上也一切正常,并且使用我们用来开发应用程序的主扫描仪可以完美地工作,但我们在使用其他扫描仪时运气不佳。作为该项目开发的副产品,我们手头有来自不同制造商的大量扫描仪可供测试。结果差异很大:

  • 我们用来开发的扫描仪在 Mac OS X 上运行得很好,就像在 Windows 中一样。讽刺的是,这款扫描仪是我们遇到过的最便宜、最差的扫描仪(速度方面),但使用它却是一个梦想。
  • 另一个扫描仪工作得很好 - 直到第二次或第三次扫描,此时应用程序崩溃,没有明确指示发生了什么(我们从调试器获得 EXEC_BAD_ACCESS)
  • 另一个扫描仪显然在 Mac OS X 上没有 TWAIN 支持(在 Mac OS X 上没有数据源) “Image Capture/TWAIN Data Sources”文件夹),尽管它在 Windows 中确实支持 TWAIN。
  • 另一个扫描仪有一个通用数据源,我认为该数据源应该涵盖该制造商的所有可能的扫描仪,但当我们尝试启动本机扫描(这是所有 TWAIN 数据源的要求)时,我们没有得到任何结果。此外,尝试安装该制造商的第二个扫描仪会使一切变得混乱,并且需要手动卸载该公司的所有内容。
  • 另一个扫描仪有一个似乎特定于制造商的 TWAIN 数据源,但它也无法启动本机扫描(但使用本机 GUI 进行扫描 - 与我们的项目不兼容 - 有效)

所以我不确定在哪里就这样吧。我仍在深入研究代码,以找出我们做错了什么(如果有的话),但在对照 TWAIN 标准进行检查时,看起来我们确实做的一切都是正确的,但我们变得非常“命中或-”在我们测试的大多数扫描仪上都没有得到结果。

另外,作为新 Cocoa/Carbon 事件模型的一部分,还额外考虑了 Mac OS X TWAIN 数据源应该实现的“回调”功能,但我没有看到大多数数据源/驱动程序调用它。

因此,所有这些让我想知道 - 是我们只是做错了什么,还是 TWAIN 在 Macintosh 上没有得到很好的支持?

我确实没有在 Macintosh 网上看到很多有关 TWAIN 的信息 - twainforum.org 上偶尔出现的零星询问往往得不到答复。 Windows 还有一个名为 WIA(Windows 图像采集)的功能,在 Windows 端,我们也将其作为一个选项包含在内。除了 TWAIN 之外,Mac 上还有其他我们应该探索的东西吗?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh.

On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners.

On Mac OS X, we also basically have everything working and with the main scanner we used to develop the application with works perfectly, but we're not having a ton of luck with other scanners. As a byproduct of development on this project, we have a fair number of scanners from various manufacturers on-hand to test with. The results vary wildly:

  • The scanner we used to develop with works perfectly on Mac OS X as it does in Windows. Ironically this scanner is the cheapest and crappiest scanner (speed-wise) we've ever encountered but it's been a dream to work with.
  • Another scanner works great - until the second or third scan, at which point the application crashes with no clear indication of what happened (we get an EXEC_BAD_ACCESS from the debugger)
  • Another scanner apparently has no TWAIN support on Mac OS X (no data sources in the "Image Capture/TWAIN Data Sources" folder), although it does have TWAIN support in Windows.
  • Another scanner has a generic data source that I'm thinking is supposed to cover all the possible scanners from this manufacturer but when we try to initiate a native scan (which is a requirement for all TWAIN data sources) we get no results. Also, trying to install a second scanner from this manufacturer gums everything up and requires a manual uninstall for everything from this company.
  • Another scanner has a TWAIN data source that appears to be specific to the manufacturer, but it also fails to initiate a native scan (but a scan using the native GUI - which is incompatible with our project - works)

So I'm not sure where to go with this. I'm still digging into the code to figure out what, if anything, we're doing wrong but in checking against the TWAIN standard it really does look like we're doing everything right, but we're getting very hit-or-miss results on most of the scanners we're testing against.

Also, as part of the new Cocoa/Carbon Events model there's this additional consideration of a "callback" function that Mac OS X TWAIN data sources are supposed to implement and I'm not seeing it called from most of these data source/drivers.

So all of this leads me to wonder - is it that we're just doing something wrong or is TWAIN just not supported properly by and large on the Macintosh?

I'm really not seeing a lot of information on TWAIN on the Macintosh online - the occasional sporadic inquiry on twainforum.org tends to go unanswered. Windows also has a thing called WIA - Windows Image Acquisition - and on the Windows side we also include this as an option. Is there something else on the Mac we should be exploring instead of or in addition to TWAIN?

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

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

发布评论

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

评论(1

煮茶煮酒煮时光 2024-10-07 03:23:25

您可以尝试ImageCaptureCore.framework。但您必须验证您提供解决方案的公司/型号扫描仪是否支持 ImageCapture。
如果任何供应商提供支持,则 ImageCapture 模块将出现在“/Library/Image Capture/Devices”位置。您还可以检查模块内的 plist 以获取支持的型号。

希望它有帮助:-)

You can try ImageCaptureCore.framework. But you have to verify that the company/model scanners to which you are giving solution have ImageCapture support.
If any vendor has given support then a ImageCapture module will be present in location '/Library/Image Capture/Devices'. You can also check the plists inside modules for supported models.

Hope it helps :-)

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