Snow Leopard、Django 和 Django 的问题太平洋石油公司
我在获取 Django & 时遇到了一些问题。升级到 Snow Leopard 后,PIL 工作正常。
我已经安装了 freetype、libjpeg,然后是 PIL,它告诉我:
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
但是当我尝试通过 django 管理界面上传 jpeg 时,我得到:
上传有效图像。文件你 上传的要么不是图像,要么是 图像损坏。
它适用于 PNG 文件。
有什么想法吗?
I am having some trouble getting Django & PIL work properly since upgrading to Snow Leopard.
I have installed freetype, libjpeg and then PIL, which tells me:
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
but when I try to upload a jpeg through the django admin interface I get:
Upload a valid image. The file you
uploaded was either not an image or a
corrupted image.
It works fine with PNG files.
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Cato
我对 Leopard 10.5.x 有同样的经历
这是我所做的修复它的方法(可能不适合你)。
cd 到您的构建文件夹
cd 到您的 lib.macosx-10.* 文件夹(特定于您的操作系统)
删除*.so
cd 返回到您的 PIL 构建文件夹
(我为此以 su 身份登录,但如果您愿意,您可以 sudo 这些)
这将重建 PIL clean。 jpeg 报告正常的原因是它只是查找 jpeg lib 文件是否存在,而不查找干净构建和安装 PIL 时发生的依赖关系。
希望这能解决您的问题,我的问题更可能与安装顺序有关,但也许会有所帮助......
Cato
I had the same experience with Leopard 10.5.x
Here is what I did to fix it, (may not work for you).
cd to your build folder
cd to your lib.macosx-10.* folder (specific to your os)
remove *.so
cd back to your PIL build folder
(I logged in as su for this, but you can sudo these if you like)
This rebuilds PIL clean. The reason your jpeg reports ok, is that it just looks for the existence of the jpeg lib files, but not the dependency that happens from a clean build and install of PIL.
Hope this solves your problem, mine was more likely related to the order of installation but maybe it will help...
作为 Ken 回复的后续内容,我在 Snow Leopard 10.6.x 中遇到了同样的问题,这是由于在 libjpeg 之前安装 PIL 造成的。安装 libjpeg 后,我通过执行以下操作重新安装了 PIL。
As a follow up to Ken's response, I had the same problem with Snow Leopard 10.6.x which was caused by installing PIL before libjpeg. After installing libjpeg, I reinstalled PIL by doing the following.
我在 Ubuntu 8.04 上遇到了类似的问题。我只需重新发布我的 PIL 安装(通过 pip)就可以摆脱困境:
不确定问题是什么,但我怀疑它与这里其他人报告的类似。
I ran into a similar issue while on Ubuntu 8.04. I was able to get myself out of it by simply re-issuing my PIL install (via pip):
Not sure what the issue was but I suspect it's similar to what others here reported.