[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] Import Error with Imageext



Steven M. Castellotti wrote:
> I'm having a strange problem displaying images through Pygame.
> Any help/advice would be greatly appreciated.

hmm, this is certainly a curious one.
the "setup.py" script will run the "config.py" script if a "Setup" 
config file is not present. my config script does a reasonable (not 
excellent) job of finding which SDL modules are available, and 
commenting out the ones it cannot find. this is why you see imageext not 
being built. the config is far from foolproof, but it generally works 
and is easy to hand-cleanup anything it didn't get right.

the "not a BMP" error you are getting is when trying to use SDL to load 
an image without SDL_image. SDL does support BMP loading, so the 
pygame.image will try to use the basic SDL loader if it cannot get the 
full SDL_image based one (which as you've found is used from the 
internal imageext module)

since the imageext module can't be imported, pygame falls back to the 
regular BMP loader.

the initial config looks in the directories listed in "sdl-config 
--libs" for the SDL_image library. if it is not found, it disables the 
imageext. this is probably why it's not finding it, but i've never seen 
a setup where SDL.so and SDL_image.so are in different locations.

the strange thing is that when importing imageext it complains about 
missing symbols that should definitely be in libjpeg. this leads me to 
believe it's finding SDL_image.so fine, but then unable to find libjpeg.

ugh, it seems like a messy libraries issue, which isn't totally
uncommon these days (although your situation is unique). many problems 
have been solved by copying libs from /usr/local/lib to /usr/lib. 
although this is an unclean solution, it's solved many a problem up to 
now. the first thing to check would be if normal "c" programs can use 
SDL_image without error. much farther than that and i quickly get into 
my "grey area" of linux and linking knowledge.

hopefully some of the details in my mail can at least clear up what is 
going on in the different stages.

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org