Windows上的PIL和JPEG库 [英] PIL and JPEG library on Windows

查看:123
本文介绍了Windows上的PIL和JPEG库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从源代码构建了Python的PIL库(由于从安装程序可执行文件安装的版本中存在错误),并且可以从构建计算机上的jpg文件创建Image()对象,但是当我使用PyInstaller打包此Python应用程序时,应用程序无法打开JPEG图像.如 PIL编码器jpeg不可用所述,我是否没有正确构建PIL?还有其他问题吗?

I have built Python's PIL library from source (due to an error in the version installed from the installer executable) and can create Image() objects from jpg files on the build computer, however when I package this Python application using PyInstaller, the application is unable to open JPEG images. Have I not built PIL correctly, as described at PIL encoder jpeg not available, or is something else wrong?

更新:错误消息为"IOError:编码器jpeg不可用".

Update: The error message is "IOError: encoder jpeg not available".

从安装程序可执行文件安装的版本(对于1.1.7和1.1.6版本,如果不是较早的版本,则也存在问题)是它链接到VC90.DebugCRT库/程序集,我不这样做"t是要分发的,而PyInstaller在我的系统上找不到(尽管有版本).

The problem with the version installed from the installer executable (for both versions 1.1.7 and 1.1.6, if not earlier ones, too) is that it links against the VC90.DebugCRT library/assembly, which I don't is meant to be distributed and which PyInstaller could not find on my system (though a version was there).

推荐答案

您需要在安装中包含jpeg编码器/解码器dll,否则它将在尚未安装的系统上不起作用.

You need to include the jpeg encoder/decoder dll with your installation, otherwise it won't work on systems that doesn't already have it.

我自己还没有尝试过,但是您也可以通过静态链接来执行此操作,而不是通过--enable-static运行configure脚本.

Haven't tried this myself, but you might also be able to do this by static linking instead by running the configure script with --enable-static.

这篇关于Windows上的PIL和JPEG库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆