[reportlab-users] Re: problem with rlzope and reportlab

Jerome Alet reportlab-users@reportlab.com
Tue, 25 May 2004 11:30:39 +0200


On Tue, May 25, 2004 at 11:19:35AM +0200, Samuele Giovanni Tonon wrote:
> hi,
> while playing with reportlab 1.19 on a debian unstable i noticed some
> problem with rlzope.py (the external method to use it to create pdf
> files) .
> The problem is when i have to insert an image:
> on rlzope.py on line 75
> canvas.drawImage(image, inch, doc.pagesize[1] - inch, width, height)
> should be replaced with
> canvas.drawInlineImage(image, inch, doc.pagesize[1] - inch, width,
> height)
> or you will get an 
> rawdata = image.getRGBData() AttributeError: JpegImageFile instance has
> no attribute 'getRGBData'

the problem in rlzope is that I didn't upgrade the code to take
care of recent RL and/or PIL changes

> after solving this problem i found a problem in 
> reportlab/pdfgen/pdfimages.py
> in which you have to add 
> import sys 
> to make line 138 to 142 work:
> if sys.platform[0:4] == 'java':
>                 #jython, PIL not available
>                 (imagedata, imgwidth, imgheight) = self.JAVA_imagedata()
>             else:
>                 (imagedata, imgwidth, imgheight) = self.PIL_imagedata()
> i'm not sure if this is a problem related only to debian (because
> of a lack on the package) or it's related to reportlab and rlzope,
> however, while in doubt i thought it could be nice to alert you all
> about this problem, sorry if it bothers you.

I CC this message to ReportLab's mailing list so that RL maintainers
can handle this problem ASAP if still needed.

bye, and thanks for your help

Jerome Alet