…posted by davidjmedlock:
#height#
I’m by no means a master of all things Java, but this is an easy way to grab the height and width of an image. I haven’t tried it with GIF’s just yet, but I think it’ll work… Enjoy!
Related posts:
- A Quick-And-Dirty Way To Update Your Firefox Extensions For Firefox extension users, not extension developers, this post details...
- Sumo Paint: A Very Fine, Free Online Image Editor Jennifer takes a look at Sumo Paint, a superb web-based...
- How To Create A Color Palette From An Image Using Kuler Jennifer shows you how to use Kuler to extract a...
- Better Selections In Photoshop With Quick Masks The Quick Mask in Photoshop offers a really easy way...
- Two Quick Illustrator Text Effects Jennifer shows you how to create two text effects in...






I tried using this script and CF didn’t like the second period on the first script line – the one after getDefaultToolkit()
Am I doing something wrong?
May 10th, 2004 at 7:17 pm
try removing the () after getDefaultToolkit so it becomes img = tk.getDefaultToolkit.getImage(”C:\image.jpg”);
May 18th, 2004 at 1:47 pm
A W E S O M E ! …thanks, I needed this!
July 7th, 2004 at 7:30 pm
Wow! This is great! Thanks for posting this.
July 30th, 2004 at 10:19 am
Looks great, but I get this error… any thoughts?
Element GETDEFAULTTOOLKIT is undefined in TK.
The error occurred in D:\Inetpub\flatfishdesign\ii\asis\imageSize.cfm: line 4
2 :
3 :
4 : img = tk.getDefaultToolkit.getImage(”./images/espn.gif”);
5 : width = img.getWidth();
6 : height = img.getHeight();
August 25th, 2004 at 10:34 am
anyway of doing this with SWFs?
October 18th, 2004 at 1:00 pm
How can I use this script with online images. Ex. http://www.images.com/image.jpg ?
October 20th, 2004 at 5:17 pm
Here is an example that uses it with online images.
SELECT image
FROM table
img = tk.getDefaultToolkit().getImage(”C:\www\www.yourdomain.com\images\#image#”);
width = img.getWidth();
height = img.getHeight();
#image#
November 9th, 2004 at 11:32 am
Does anyone have this working on Linux?
April 2nd, 2005 at 7:53 am
I am also trying to make this work on Linux with no luck.
Steveroot, have you found a solution on Linux.
I`m looking for a way to determine a photo`s width and height so if any one has any suggestions it would be very much apreciated.
May 7th, 2006 at 2:29 am
i always get -1 for both height and width…hrmph!
June 27th, 2007 at 12:38 pm