2008-12-19 63 views
3

我试图建立PIL 1.1.6反对cygwin或mingw,而对Windows的Python安装运行。当我做任何构建工作,但我尝试保存文件时遇到以下故障。如何在建立在mingw/cygwin上时使PIL工作?

 
$ python25 
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on 
win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from PIL.Image import open 
>>> im = open('test.gif') 
>>> im.save('output1.gif') 
Traceback (most recent call last): 
    File "", line 1, in 
    File "c:\Python25\Lib\site-packages\PIL\Image.py", line 1405, in save 
    save_handler(self, fp, filename) 
    File "c:\Python25\Lib\site-packages\PIL\GifImagePlugin.py", line 291, in _save 

    ImageFile._save(imOut, fp, [("gif", (0,0)+im.size, 0, rawmode)]) 
    File "c:\Python25\Lib\site-packages\PIL\ImageFile.py", line 491, in _save 
    s = e.encode_to_file(fh, bufsize) 
IOError: [Errno 0] Error 
>>> 

我不与JPEG或ZIP支持的库编译,但我不认为这应该是与此有关。

失败的行似乎是encode.c中的encode_to_file中的写入。

我怀疑发生这种情况是因为文件描述符是从Python(它是在visual studio 2003下构建的)传递给_imaging.pyd,但是文件描述符不匹配,因为在windows上文件描述符是抽象的在操作系统之上。有人对这个有了解吗?

回答