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





