getting image resolution via python

im making a script and it would vastly simplify the script if there is a way to find the xy resolution of the image that is applied to a face(at the moment i have to manually type the values in). if you know how PLEASE reply

thanks

I’m afraid this is not possible through the Blender API at the moment. However if you still have access to the Image file you can use PIL (Python Image Library)

import Image
im = Image.open("texture.jpg")
print im.size

The size is given as a 2-tuple (width, height).

PIL is available from:

http://www.pythonware.com/products/pil
or http://effbot.org/downloads#pil