[reportlab-users] Use of Image flowable results in AttributeError.

Remy C. Cool reportlab-users@reportlab.com
Sun, 21 Mar 2004 17:23:55 +0100


Hello,

In my program I can use the flowables: Paragraph, Preformatted, 
XPreformatted and Spacer without problems, but when I 'stick' a Image 
flowable into the flowables list, I get the following Exception:

AttributeError : 'unicode' object has no attribute 'getRGBData'

...
631: doctemplate.py: self.handle_flowable(flowables)
549: doctemplate.py: if self.frame.add(f, self.canv, 
trySplit=self.allowSplitting):
135: frames.py: flowable.drawOn(canv, self._x + self._leftExtraIndent, 
y,_sW=self._getAvailableWidth()-w) 
 83: flowables.py: self._drawOn(canvas)
367: flowables.py: self.draw()#this is the bit you overload
367: flowables.py: mask=self._mask
586: canvas.py: rawdata = image.getRGBData()

The Image flowable is created with:
flowables.append(Image('test.jpg')) 

When the flowable list is fed to the doc.build(flowables), the 
Exception occurs. 

According to __init__.py in package reportlab I have version 1.19 
(debian package: python2.3-reportlab) PIL is also installed.

Any hints?

Regards,
Remy