Thanks! I implemented it and it works great. It does not seem much slower with 2 threads in comparison to having all available threads working on it, but at least I am sure that 20 threads will not try opening 30MP images and run out of memory.
↧