在shell和runserver中使用easy_缩略图时出现Django错误

在shell和runserver中使用easy_缩略图时出现Django错误,django,macos,thumbnails,python-imaging-library,Django,Macos,Thumbnails,Python Imaging Library,我正试图使用本地Django开发服务器(runserver)或python shell,在笔记本电脑(OSX Lion)上的Django(1.5)项目中使用easy\u缩略图。我安装了支持jpeg的PIL库,我在虚拟环境中工作。我正在用以下命令在django shell中测试easy\u缩略图应用程序: th = get_thumbnailer(mymodel.image) th.get_thumbnail(options) 这些命令在服务器上工作正常,缩略图创建成功。但是,在本地django

我正试图使用本地Django开发服务器(
runserver
)或python shell,在笔记本电脑(OSX Lion)上的
Django(1.5)
项目中使用
easy\u缩略图。我安装了支持jpeg的
PIL
库,我在虚拟环境中工作。我正在用以下命令在django shell中测试
easy\u缩略图
应用程序:

th = get_thumbnailer(mymodel.image)
th.get_thumbnail(options)
这些命令在服务器上工作正常,缩略图创建成功。但是,在本地django shell中,当使用runserver时,相同的命令会导致以下错误:

File "/.../site-packages/easy_thumbnails/files.py", line 397, in get_thumbnail
  thumbnail = self.generate_thumbnail(thumbnail_options)
File "/.../site-packages/easy_thumbnails/files.py", line 293, in generate_thumbnail
  "The source file does not appear to be an image")
InvalidImageFormatError: The source file does not appear to be an image
Python图像库在我的计算机上运行良好。在普通(非django)python shell中,我可以读取、验证和写入jpeg图像


我已经尝试了许多不同的方法来解决这个问题,因为我知道这可能是图书馆PAHT的一个潜在问题,如中所述。我不知道该如何解决这个问题,任何提示都将不胜感激。

尝试使用枕头而不是PilThank@catherine我也尝试过,但没有帮助。现在,我想知道在调用
get\u thumbnail
尝试创建缩略图文件时是否存在权限问题。也许runserver环境无法在服务器上写入新的缩略图图像……实际上,我刚刚意识到,如果缩略图以前是在服务器上使用
get_thumbnail
创建的,那么同样的命令在本地也可以正常工作。