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

Remy C. Cool reportlab-users@reportlab.com
Mon, 22 Mar 2004 17:00:16 +0100


On Monday 22 March 2004 16:56, Remy C. Cool wrote:
> On Monday 22 March 2004 15:20, Robin Becker wrote:
> > In article <f6IGZaAKJuXAFwCH@chamonix.reportlab.co.uk>, Robin
> > Becker <robin@reportlab.com> writes
> >
> > >In article <PGECLPOBGNBNKHNAGIJHOECPKIAA.andy@reportlab.com>,
> > > Andy Robinson <andy@reportlab.com> writes
> > >
> > >>Oh dear.  This getRGBData thing is coming up again and
> > >>again.  We changed a call to PIL in a way which seemed
> > >>to work fine for us and which I assumed was always available,
> > >>but it seems to break for a lot of other people.
> > >>
> > >>Robin, can you check if PIL changed recently in this
> > >>regard, and post the results here?   And if there is a
> > >>version-and-platform-proof way to get pixels out of PIL
> > >>let's switch to using it...
> > >>
> > >>- Andy
> > >
> > >....there was indeed a change in the way that some PIL things
> > > were done, but I thought that related only to where the gif
> > > color tables were held.
> > >
> > >I've been hacking on this in the recent past and it seems to
> > > have broken something in our demos as well.
> >
> > In fact I think the problem is probably caused by people passing
> > unicode into places where we expect a string or something with a
> > 'read' attribute, I found one error related to passing in a file,
> > but I've now fixed that and am testing for various different
> > image scenarios.
>
> That looks to be the case.
>
> When I change:
>
>     Image(filename, width=width, height=height)
> to
>     Image(str(filename), width=width, height=height)
>
> the PDF get's generated without any problems.
>
> Now if I only could get the picture to align LEFT.

Got that with i.hAlign= 'LEFT'