python - 缺少一些 PIL.ImageFile 属性,如 LOAD_TRUNCATED_IMAGES

标签 python python-imaging-library intel-edison

我正在开发具有使用 Yocto 项目构建的自定义分发版的 Intel Edison,我正在使用的确切 python 版本是 2.7.3,PIL 版本是 1.1.7。

在尝试通过将 LOAD_TRUNCATED_IMAGES 属性设置为 true 来启用截断图像加载时,我发现 Edison 上不存在它,但它存在于具有相同 PIL 版本的我的 Ubuntu 上。

是否有任何其他方法可以启用截断图像加载,Edison 是否不支持该功能,为什么在具有相同 PIL 版本的其他机器上存在的地方错过了 future ?

我是 Linux 新用户,如果这看起来像一个虚拟问题,我很抱歉。

最佳答案

LOAD_TRUNCATED_IMAGES 选项在 PIL 中不可用。它被引入 Pillow,PIL 的一个分支。 (它是在 Pillow 2.0.0 中添加的。)

最后一个 PIL release was five years ago ,但 Pillow 是 PIL 的维护分支。

先删除 PIL,然后安装 Pillow:

pip 安装枕头

关于python - 缺少一些 PIL.ImageFile 属性,如 LOAD_TRUNCATED_IMAGES,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28313465/

相关文章:

python - python中是否有比networkx更有效的计算最短路径问题的方法?

javascript - 使用javascript提交一个django表单

python - 在 apscheduler 中捕获日志

python - 如何改进从图像中提取文本?

python - 在 python 中为照片添加类似纸印的效果需要什么?

嵌入式系统上的 Docker,为什么不呢?

node.js - 从 systemd Node 应用程序生成的 Shell 脚本不编辑等文件

python - 在Python中将年份添加到日期(d-m-y)列

python - 在没有 freetype 的情况下在 PIL 中使用字体

python - Pyaudio:将输入连接到输出时出错