Adobe ColdFusion 8

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.

Category

Image functions

Function syntax

ImageInfo(name)

See also

cfimage, ImageGetHeight, ImageGetWidth, IsImage, IsImageFile

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>