Dec 22, '04 09:03:00AM • Contributed by: Anonymous
To alleviate this a little, I've written a small Python script. When run from the Terminal, the script will search for all JPEG, GIF or PNG images in the current directory, and output a user-named HTML file. The file will include each image's name plus its dimensions in HTML format, ready for you to copy and paste into your working document. I've found it's saved me a lot of time on the site I'm currently building, and I hope it might help you, too.
My imgDetails.py script [view source] uses the extremely-useful Mac OS 10.3 command line utility sips, which allows you to query (and modify if you wish) images from the Terminal. This utility was only added in 10.3, hence my script will not work on prior versions of Mac OS X.
[robg adds: I tested this one, and it worked as described -- you get a nice HTML file that contains the IMG tags with the proper 'width' and 'height' tags already included.]
