[visionegg] Re: pre-loading a large number of stimuli
- From: Jascha Swisher <swisher@xxxxxxxxxxx>
- To: visionegg@xxxxxxxxxxxxx
- Date: Mon, 15 Aug 2005 22:54:05 -0400 (EDT)
Hi Nick,
I think the method you are looking for may be Image.load() from
PIL. VisionEgg calls Image.open(filename) in Texture.__init__ in
Textures.py, which as you note opens a file but doesn't necessarily
actually read any data until it is accessed.
Since Textures can be created from PIL images as well as from
filenames, you may be able to do what you want by first explicitly calling
Image.open(filename), then calling load() on the image object you just
created, and finally passing the newly-loaded image as the argument to the
Texture constructor.
Whether or not this will actually cause the file handles to be closed and
therefore fix your problem, I'm not sure. :) Seems reasonable, though.
FYI, everything I know about the PIL im.load() method comes from here:
http://www.pythonware.com/library/pil/handbook/image.htm
-- jascha
> What I'm looking for is a way to force PIL to read the data from the
> file and then close the file; I'm not conversant enough with PIL to
> know how to force this and was hoping somebody on the list might know
> (I haven't figured out in VisionEgg where in the process PIL is used
> to actually load the Texture into open gl, thus closing the file
> handle).
======================================
The Vision Egg mailing list
Archives: http://www.freelists.org/archives/visionegg
Website: http://www.visionegg.org/mailinglist.html
- References:
- [visionegg] Re: pre-loading a large number of stimuli
- From: Nick Knouf
Other related posts:
- » [visionegg] pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- » [visionegg] Re: pre-loading a large number of stimuli
- [visionegg] Re: pre-loading a large number of stimuli
- From: Nick Knouf