[reportlab-users] Image Sizes

John Pywtorak jpywtora at calpoly.edu
Thu Sep 1 12:59:16 EDT 2005


Mark Saward wrote:
> Hi,
> 
> I was wondering what's the best way to determine the size of an image?  I have 
> a text file that specifies data which my python app then uses to create a 
> pdf.  Part of that input text file includes an image name.  Since this could 
> change, I need to know the size of the image in order to center it/lay it out 
> appropriately, and maybe even shrink if it's too large.
> 
> Does reportlab have any functions for this?
> 
> Thanks
> Mark Saward
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users

I would imagine PIL could do this, here is a ipython interactive example:

In [1]: from PIL import Image
In [2]: i = Image.open('r25-sis-stop-error.png')
In [3]: i.size
Out[3]: (800, 600)


Johnny P

-- 
Windows
Start Here
Frustrating Hanging Crashing
Blue Screen of Death
Reboot



More information about the reportlab-users mailing list