I'm hitting a problem that is difficult to diagnose as it kills Python when running on the phone. Basically (if I lose you, shout), I have a Queue which is monitored by a thread pool. I shove an image onto the queue, a thread pops it off the queue and then writes it to file. This works the first time but subsequent writes fall over, even though the save is wrapped around some exception handling. Um.
Here's the worker thread code:
imgpool is populated with stuff from another method in the main application code:
img = imgpool.get()
if img != None:
tm = localtime()
fn = "e:\\Images\\img%02d%02d%02d%02d.jpg" % (tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec)
# if I remove this line, the program continues... demons!
# Do something sensible
I did have a 'print' statement in the exception handling code to aid debugging but that isn't called; the app just dies. Or, even better, if I exit the app after exercising the code once (whereby an image is saved), the Python shell will crash when I click the options button. There's really no need for that now, is there?
img = camera.take_photo(mode="RGB", flash="auto", size=self.image_size)
w, h = self.canvas.size
self.canvas.blit(img, target=(0, 0, w, 0.75 * w), scale=1)
Any ideas? Need more info? Ever wondered what mice look like with no ears?! Oh, this is on an N97 running (glances at phone)... Python 1.9.6. This is some ever so slightly silly idea to speed up the main processing because writing to file is sooooo slow.
My thanks in advance. Unless of course you can't help me.