How can we easily rotate an image using reportlab? I have not found an easy method. The only way found comes from http://dods.ipsl.jussieu.fr/orchidee/SANORCHIDEE/TEMP/TEMP_LOCAL/cdat_portable/lib_new_wrong_gcc/python2.4/site-packages/reportlab/test/test_graphics_images.py using for example:
>>> from reportlab.graphics.shapes import Image, Drawing
>>> from reportlab.platypus import SimpleDocTemplate
>>> from reportlab.lib.pagesizes import A4, portrait
>>> from reportlab.lib.units import mm
>>> img = Image(-202/25.4, -125/25.4, 210/25.4, 138/25.4, 'uneBelleImage.png') # (x, y [from lower left corner], width, height, path, **kw)
>>> d = Drawing(0, 0) # (width, height, *nodes, **keywords)
>>> d.add(img)
>>> d.scale(100,100) #(%width, %height)
>>> d.rotate(90)
>>> report=[]
>>> report.append(d)
>>> page = SimpleDocTemplate('toto.pdf', pagesize = portrait(A4), rightMargin=20*mm, leftMargin=20*mm, topMargin=10*mm, bottomMargin = 10*mm)
>>> page.build(report)
This is working, but it is using a sledgehammer to crack a nut. Is there a more direct method, using for example the classical reportlab.platypus.Image?