How can I get PIL to work when it is built on mingw / cygwin?

I am trying to create PIL 1.1.6 against cygwin or mingw while working with python installation on windows. When I do either build, but also get the following crash when trying to save files.

$ 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
>>>

I do not compile with libraries to support jpeg or zip, but I do not think this should be appropriate.

The fault-tolerant string appears to be an entry in encode_to_file in encode.c.

I suspect that this is due to the fact that the file descriptor is passed from Python (which was created in Visual Studio 2003) to _imaging.pyd, but that the file descriptors do not match, as there is an abstraction on the top of the operating file descriptors in Windows system. Does anyone know about this?

+3

All Articles