Hello.

   Recently we wrote about memory problems of PIL while converting large
number of png files to 8-bit palette format. After some number of messages
simple converting script (see in attach) takes all available memory from a
system and produces QuantizationError. After some examinating of PIL source
code we've founded that QuantizationError arrises after failed malloc. Each
new image increase memory usage, whereas this script should work in fixed
amount of memory (it processes image, then takes the next one).
I've realized that problem can be solved by applying simple patch (see
attach). After tests on huge number of png files memory consumption looks
fixed and converting works correct.
I'd like to know PIL author's opinion. Thank you.

Evgeny

Attachment: PIL_mem_leak.diff
Description: Binary data

Attachment: to_8bit.py
Description: Binary data

_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to