不支持的TIFF压缩

2024-06-01 04:06:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用openslide-python打开一个svs映像,遇到了以下问题:

>> import openslide as osi
>> a = osi.OpenSlide('image.svs')

产生错误

^{pr2}$

我还没有找到任何关于这个问题的在线解决方案;我已经检查了libopenjpeg和其他相关库,以确保它们是各自的最新版本。在


Tags: imageimport版本as错误osi解决方案svs
1条回答
网友
1楼 · 发布于 2024-06-01 04:06:14

如果你看看代码: https://github.com/openslide/openslide/blob/7b99a8604f38280d14a34db6bda7a916563f96e1/src/openslide-vendor-generic-tiff.c#L222-L226

if (!TIFFIsCODECConfigured(compression)) {
  g_set_error(err, OPENSLIDE_ERROR, OPENSLIDE_ERROR_FAILED,
              "Unsupported TIFF compression: %u", compression);
  goto FAIL;
}

您将看到它使用libtiff:函数TIFFIsCODECConfigured由底层的libtiff库提供(请参见man page)。在

compression标记被设置为7;这是非常受支持的JPEG ('new-style' JPEG)压缩方案,有时也称为JPEG-in-TIFF;您需要为其安装编解码器。在

如果您还保留着幻灯片并使用了柯达成像技术,那么您可能可以使用不同的压缩方式再次扫描它们;但这将是一种迂回的方式。尝试添加编解码器并在libtiff中启用它可能更容易。在

^{} documentation

Support for JPEG compression is controlled by JPEG_SUPPORT. The JPEG codec that comes with libtiff is designed for use with release 5 or later of the Independent JPEG Group's freely available software distribution. This software can be retrieved from the directory ftp.uu.net:/graphics/jpeg/.

因此支持是可选的,您可能需要重建libtiff(请参见instructions)。在

By default JPEG support is not configured.

参考文献:

相关问题 更多 >