[Image-SIG] Too many opened images

Michele Petrazzo - Unipex srl michele.petrazzo at unipex.it
Wed Oct 24 21:23:31 CEST 2007


Joancarles Casasín wrote:
> Hi,
> 
> Is there any way to deal with the "Too many opened images" error?
> 
> I mean, I've a script which opens a (huge) bunch of images, crops a
>  part and adds it to a resulting image. When the process has been
> done with around 200 images the script raises the "Too many opened
> images" Error. Can I manage this?

Are you sure that this are a PIL problem?

michele:~/tmp/Imaging-1.1.6$ grep -R -i "Too many" *
_imaging.c:     PyErr_SetString(PyExc_TypeError, "too many data entries");
PIL/Image.py:        raise ValueError("Too many dimensions.")
michele:~/tmp/Imaging-1.1.6$

Like you can see, inside the last PIL sources, no "Too many opened
images" string are found!

However a solution, for me, can be to create an external python script
that do something you want with the image and after it'll be close. For
do this, you have to deal with the subprocess lib.

Michele


More information about the Image-SIG mailing list