[reportlab-users] canvas.drawImage with unicode string
pier carteri
pier.carteri at gmail.com
Sat Nov 4 09:09:43 EST 2006
Thank you Robin!
For the future, is this list the right place for this kind of problem
or there is a bettere place for this?
Regards
Pier
On 11/4/06, Robin Becker <robin at reportlab.com> wrote:
> pier carteri wrote:
> > but the check fails if you pass it an unicode string, and so the
> > program wrongly recognise the input as an ImageReader.
> >
> > I suggest a check like
> > if type(image) in [type(''), type(u'')]:
> > or
> > if type(image) == type('') or type(image) == type(u''):
> >
> >
> > The use of unicode string for path may seems uncommon but it isn't.
> > For example my program gets paths from an xml file parsed using
> > elementtree. Elementtree returns unicode strings.
> >
> > Hope this helps!
> >
> > Regards
> >
> > Pier
> .......
>
> OK I turned the test around since we're only allowed an ImageReader or a
> filename it gets used like
>
> if isinstance(image,ImageReader):
> rawdata = image.getRGBData()
> name = _digester(rawdata+str(mask))
> else:
> #filename, use it
> name = _digester('%s%s' % (image, mask))
>
> --
> Robin Becker
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
More information about the reportlab-users
mailing list