Image within a table - Preserve Aspect Ratio

"Pizzolato, Larissa (EC)" <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Hi all,

I would like to add an image within a table (example below - maxIMAGE), but would like the aspect ratio to be preserved.
            from reportlab import platypus as platy
maxIMAGE = platy.Image(maxIMAGE_path,2.2*inch, 2.2*inch)
maxIMAGE_table = Table([[maxIMAGE]],2.3*inch, 2.3*inch, style=[('GRID',(0,0),(0,0),.5, 'black'), ('BACKGROUND',(0,0),(0,0), "white"),('ALIGN',(0,0),(0,0), 'CENTER'),('VALIGN',(0,0),(0,0), 'MIDDLE')])


However, when I try doing preserveAspectRatio=True, I receive the following error:
TypeError: __init__() got an unexpected keyword argument 'preserveAspectRatio'

I've also tried the solution listed here: https://stackoverflow.com/questions/5327670/image-aspect-ratio-using-reportlab-in-python with no success.

Is there another way to render the image into the table that has this capability?

Any ideas?

Cheers!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.