Author Topic: Output tab bug and possible fix  (Read 3103 times)

jturner

  • Jr. Member
  • **
  • Posts: 9
Output tab bug and possible fix
« on: November 13, 2008, 08:49:03 PM »
I found that when I installed the python image library to get the output tab in the qube gui to display a wider range of image formats, the output tab stopped working altogether and I got the error:
Traceback (most recent call last):
  File "/usr/lib64/python2.3/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 14572, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
  File "/hosts/isilon/ifs/home/jturner/dev/qube/gui/trunk/jobOutput.py", line 132, in refreshDisplay
    wxImg.SetData(pilImg.tostring())
  File "/usr/lib64/python2.3/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 3098, in SetData
    return _core_.Image_SetData(*args, **kwargs)
ValueError: Invalid data buffer size.

After a little investigation I found that if I changed line 132 of jobOutput.py to:
wxImg.SetData(pilImg.convert('RGB').tostring())
This resolved the error and images would display in teh output tab. Was I doing something wrong or is this a fix that could be included in the next release?

Scot Brew

  • Hero Member
  • *****
  • Posts: 272
    • PipelineFX
Re: Output tab bug and possible fix
« Reply #1 on: November 17, 2008, 09:31:31 PM »
Yes, it looks like you have identified a limitation with non-RGB images with PIL and also have provided a solution.  Thank you!

We'll take a look at it and see about incorporating it in the next release.