Problem in PNG2BMP

Chao Liu chaoliu08 at gmail.com
Wed Feb 15 05:10:53 CET 2012


Hi, everyone,

I have a PNG file, and I need to convert it to BMP file.
I use,

import PIL

from PIL import Image

im = Image.open('a.png')

im.save(‘a.bmp’)


It works in Python 2.6 with PIL 1.1.7,

But when I use Python 2.4, the error occured,


File "C:\Python24\Lib\site-packages\PIL\Image.py", line 1439, in save

    save_handler(self, fp, filename)

File "C:\Python24\Lib\site-packages\PIL\BmpImagePlugin.py", line 242, in
_save

    ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, stride,
-1))])

File "C:\Python24\Lib\site-packages\PIL\ImageFile.py", line 499, in _save

    s = e.encode_to_file(fh, bufsize)

IOError: (0, 'Error')



I'm wondering if anyone can help me.

Thanks


Chao Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120215/8e89d8f6/attachment.html>


More information about the Python-list mailing list