Whatever message this page gives is out now! Go check it out!

ImageGetWidth

Last update:
May 18, 2026

Description

Retrieves the width of the specified ColdFusion image.

Returns

An integer that represents the width of the ColdFusion image in pixels.

Category

Function syntax

ImageGetWidth(name)

See also

History

ColdFusion 8: Added this function.

Parameters

Parameter
Description
name
Required. The ColdFusion image on which this operation is performed.

Example

<!--- This example shows how to retrieve the width of an image. ---> 

<!--- Create a ColdFusion image from an existing JPEG file.---> 

<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage"> 

<!--- Get the width of the image. ---> 

<cfset width=#ImageGetWidth(myImage)#> 

<!--- Display the width of the image in pixels. ---> 

<cfdump var=#width#>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page