Forum OpenACS Q&A: Response to Is there a tcl function to get image size?

Using the AOLserver API you can get the width & height for a .gif via ns_gifsize, and for a .jpg via ns_jpegsize.

If you want to work in pure Tcl then you might want to look at the Tcl'ers Wiki where you can find examples of how to read the dimensions of .gif, .jpeg, and .png files.