Problem in PNG2BMP

Chao Liu chaoliu08 at
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 ='a.png')‘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\", line 1439, in save

    save_handler(self, fp, filename)

File "C:\Python24\Lib\site-packages\PIL\", line 242, in

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

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

    s = e.encode_to_file(fh, bufsize)

IOError: (0, 'Error')

I'm wondering if anyone can help me.


Chao Liu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list