…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!
…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!
{ 11 comments }
i always get -1 for both height and width…hrmph!
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.
Does anyone have this working on Linux?
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();
How can I use this script with online images. Ex. http://www.images.com/image.jpg ?
anyway of doing this with SWFs?
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();
Wow! This is great! Thanks for posting this.
A W E S O M E ! …thanks, I needed this!
try removing the () after getDefaultToolkit so it becomes img = tk.getDefaultToolkit.getImage(“C:\image.jpg”);
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?
Comments on this entry are closed.