Contact Us

Alagad is located in Chapel Hill, North Carolina in the Research Triangle Park area.

Phone: 888-ALAGAD4
Fax: 888-248-7836
Email: please use our contact form

208 Calderon Dr.
Chapel Hill, NC 27516 USA

Request an Alagad proposal
Request a TaskForce consultation

Find the Width and Height of an Image

The following source code demonstrates how to open an image and get it's width and height.

Source Code

<!--- create the object --->
<cfset myImage = CreateObject("Component","Image") />

<!--- open the image to inspect --->
<cfset myImage.readImage("d:\examples\georgetown.jpg") />

<!--- get the width --->
<cfset width = myImage.getWidth() />
<!--- get the height --->
<cfset height = myImage.getHeight() />

<!--- output the image size --->
<p>
<b>georgetown.jpg:</b><br>
<img src="/examples/georgetown.jpg"><br>
<cfoutput>
Width: #width#<br>
Height: #height#
</cfoutput>
</p>

Results

AIC Example - Find the Width and Height of an Image