[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Error handling non Windows BMP images
Steven M. Castellotti wrote:
> python2 setup.py
>
> and then tweaking all of the references to python2.1 in the Setup file
> to say python1.5. This seemed to work with no problem, until I tried to
> load a jpg image:
this is a bad idea. the setup script uses distutils, and that figures
out a lot about python from the version of python that is running (not
just what is in the Setup file). you can get a version of distutils for
python-1.5.2 and install pygame with the older python.
http://www.python.org/sigs/distutils-sig/download.html
distutils has shipped with pygame since python-1.6, so you'll only need
to do this for the 1.5 releases.
> sprite = pygame.image.load(sprite_file)
> pygame.error: File is not a Windows BMP file
here's what is going on. you can build the pygame.image module with or
without the SDL_image library. when you don't use SDL_image, you only
get support for loading BMP images. this is definitely the problem here,
not finding the SDL_image support.
you can test if pygame.image has the SDL_image support by calling
pygame.image.get_extended(), which will return a nonzero value if you
can load more then just BMP.
this should get you up and running. do let me know if otherwise :]
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org