WPF:使用 JPEG 压缩的 TIFF 图像?
我有大量 TIFF 图像需要在 WPF 程序(特别是 .NET 3.5 SP1 并使用 C#)中使用。 一半的 TIFF 文件包含使用 JPEG 压缩编码的彩色图像,并且它们不适用于 WPF。 “Microsoft Office Document Imaging”应用程序可以很好地处理文件。 由于 Windows 本身也不喜欢它们(例如不能生成缩略图),我假设这是标准 Windows 成像组件 (WIC) 库中的限制。
有谁知道如何正确读取使用标准 .NET/WPF 库的 JPEG 压缩的 TIFF 图像?
或者有人知道 WIC 的任何替代第三方 TIFF 编解码器我可以用来解决此问题吗?
或者最后是否有任何 TIFF 文件的替代 .NET 库仍然可以轻松地与 WPF 一起使用?
谢谢!
I have a large number of TIFF images that I’d need to use in a WPF program (.NET 3.5 SP1 specifically and using C#). Half of the TIFF files contain color images encoded using JPEG compression and they don’t work with WPF. The “Microsoft Office Document Imaging” application handles the files fine. As Windows itself doesn’t really like them either (can’t produce thumbnails for instance) I’m assuming this is a restriction in the standard Windows Imaging Components (WIC) libraries.
Does anyone have any ideas on how to correctly read the TIFF images that are using JPEG compression with the standard .NET/WPF libraries?
Or does anyone know of any alternate third party TIFF codecs for WIC that I might be able to use to work around this issue?
Or finally are there any alternate .NET libraries for TIFF files that are still easily usable with WPF?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
TIFF 包装的 JPEG 有两种类型 - 类型 6 和类型 7。您所描述的是类型 6 TIFF。 尽管 Adobe 多年来一直建议不要使用此类型(请参阅技术说明 2 了解详细信息),一些图形包仍然使用它。
我知道一些 .NET 商业图形包可以读取它们,例如 Captiva ISIS PixTools(以前称为 Pixtran)库,但不知道任何开源或免费的东西。
TIFF-wrapped JPEGs come in two flavors - type 6 and type 7. What you are describing are the type 6 TIFFs. While Adobe has recommended for years that this type not be used (see Tech Note 2 for details), several graphics packages still use it.
I know of a few commercial graphics packages for .NET that can read them such as the Captiva ISIS PixTools (formerly Pixtran) libraries, but do not know offhand of anything open source or otherwise free.
您使用什么 WPF API 来处理它们?
您是否尝试过使用 TiffBitmapDecoder System.Windows.Media.Imaging 命名空间?
What WPF API are you using to handle them?
Have you tried using TiffBitmapDecoder from the System.Windows.Media.Imaging namespace?
您需要升级到 Windows 7、Windows Server 2008(或更高版本)才能以本机方式打开这些文件。
Libtiff (C++) 和 LibTIFF.NET (.Net) 应该能够打开这些文件。 请确保在构建这些库之一时,在构建中启用了 TIFF_JPEG(6 和 7)。 这些格式在默认构建设置中被禁用。
You will need to upgrade to either Windows 7, Windows Server 2008 (or newer) in order to open these files natively.
Libtiff (C++) and LibTIFF.NET (.Net) should be able to open these files. Please make sure that when you build one of these libraries, that the TIFF_JPEG (both 6 and 7) are enabled in the build. Those formats are disabled in the default build settings.