[PyQt] QImage.save() traceback
hpj at urpla.net
Tue May 6 20:24:49 BST 2008
[ignore the last message..]
Am Dienstag, 6. Mai 2008 schrieb Sergi Blanch i Torné:
> On Tuesday 06 May 2008 13:28:50 Hans-Peter Jansen wrote:
> > Am Dienstag, 6. Mai 2008 schrieb Sergi Blanch i Torné:
> > > Hi,
> > >
> > > I'm try to save some images from a QImage object, but the save method
> > > is only responding me false. I try to fix why this method cannot do
> > > that, but I could know the real reason.
> > >
> > > Do you know how to allows this method to be more expressive to
> > > explains me something?
> > Our favorite PyQt-ML mantra applies:
> > Om, please provide a self contained example demonstrating your problem,
> > Om.
> > Pete
> mmm, interesting, It can be useful (joking).
Well, while I made a funny statement, it was meant serious.
> Yes, I want to explain the
> situation. I'm loading the image from PyTango (the tango's python
> from PyQt4 import QtCore, QtGui, Qt
> import PyTango
> attrImg = PyTango.AttributeProxy("lt/di/iba-01/ROIImage")
> imgData,imgDimX,imgDimY =
> And where we have an image composed by unsigned shorts, it needs a little
> manipulation, to have an unsigned char array, with a method like:
> def convertfrom(image):
> shift = 4
> return "".join(chr(i>>shift) for i in image )
> call like:
> imgData8 = convertfrom(imgData)
> To construct the object:
> image =
> Finally the save call is:
> And all this calls return False (and the file is not in the directory).
> The image is shown in a widget and it seems nice.
You didn't provide a self contained example again. Reduce your problem to a
pure PyQt script, and provide the image somehow, if you really expect help
from this list.
More information about the PyQt