Found via Google: http://www.sitepoint.com/blog-post-view.php?id=168133

Quick and Dirty Way to get Image Dimensions by David Medlock

However I can't see the need to invoke java.awt.Image as he has, so I removed the call. I also shoved everything into <cfscript>.

-------------------- <code> --------------------
<cfscript>
tk = CreateObject("java", "java.awt.Toolkit");

// "myImage" has to have the full physical path and file name.
myImage = "C:\fi_logo.gif";

img = tk.getDefaultToolkit().getImage(myImage);

width = img.getWidth();
height = img.getHeight();
</cfscript>

<cfoutput>
W: #variables.width#
<br />
H: #variables.height#
</cfoutput>
-------------------- </code> --------------------

Edit: Daniel's post showed up just before I hit submit. Tested on my local Win2k desktop (CFMX on JBoss via cygwin), but this code should run anywhere java runs.

Booyah!

-- Adrian


Kevin Fricke wrote:
Yes but I am trying to find out if there is a way for Coldfusion to
determine the size of the image....WxH?

Any ideas?
  -----Original Message-----
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 20, 2005 1:15 PM
  To: [EMAIL PROTECTED]
  Subject: Re: image manipulation


Doesn't photoshop give you this info when you check on Image size?


----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm





Reply via email to