[PYTHON IMAGE-SIG] width height of gif/jpeg files?

David Ascher da@maigret.cog.brown.edu
Mon, 10 Jun 1996 13:16:26 -0400 (EDT)


> What's the quickest way to read the width and height of image files?
> I want to write a little function to return this info for a bunch of 
> image files. I don't have PIL (yet, I suppose that'll have the answer.)

Definitely the easiest way is to get PIL -- it depends completely on
the image format, and if PIL has already worried about that for most
image formats you'll encounter.  

Once you have PIL:

	>>> import Image
	>>> i = Image.open('image.gif')
	>>> i.size
	(125, 123)

--david


=================
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
=================