You will need to get and install a copy of
PIL (Python Imaging Library) available at:
http://www.pythonware.com/products/pil/index.htm
then in Python:
import Image
filepath='<insert filename path here>'
im=Image.open(filepath)
height, width=im.size
print "%s-height=%i, width=%i" % (filepath, height,
width)
or for all files in a directory
import glob
import Image
filepathlist=glob.glob(r"c:\images\*.tga")
for filepath in filepathlist:
im=Image.open(filepath)
height, width=im.size
print "%s-height=%i, width=%i" % (filepath, height,
width)
Larry Bates
Syscon, Inc.
"haddock" <sa************@gmx.ch> wrote in message
news:8c*************************@posting.google.co m...
hi all
Is it possible to access the size (with and height) of a .tga image in
python? From the documentation I would say no, but I'm pretty new to
python...
if the answer really is no, has someone a suggestion how else I could
write a little script that computes the total area of a large nuber of
image files in a folder? I should check texturespace for 3D Models,
and would like to avoid copy pasting them all into Photoshop...
thanks for your trouble
haddock