ImageInfo

Description

Returns a structure that contains information about the image, such as height, width, color model, size, and filename.

Returns

A structure that contains information for image parameters.

Function syntax

ImageInfo(name)

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

Required. The ColdFusion image on which this operation is performed.

Usage

Use this function to determine whether images are compatible. For example, to use the ImageOverlay function to overlay two images, both images must have the same color model.

Example

<!--- This example shows how to retrieve information associated with the image. ---> 
<!--- Create a ColdFusion image from a JPEG file.---> 
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" name="myImage"> 
<!--- Retrieve the information associated with the image. ---> 
<cfset info=ImageInfo(myImage)> 
<cfdump var="#info#"></cfdump> 
<p>height = <cfoutput>#info.height#</cfoutput> 
<p>width = <cfoutput>#info.width#</cfoutput> 
<p>source = <cfoutput>#info.source#"</cfoutput> 
<p>pixel size = <cfoutput>#info.colormodel.pixel_size#</cfoutput> 
<p>transparency = <cfoutput>#info.colormodel.transparency#</cfoutput>