imageInfo
Description
Returns a structure that contains information about the image, such as height, width, color model, size, and filename.
Categories
Related
History
ColdFusion
8: Added this function.
Syntax
ImageInfo(name)
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| name | Required. The ColdFusion image on which this operation is performed. |
Returns
A structure
that contains information for image parameters.
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> height = <cfoutput>#info.height#</cfoutput> width = <cfoutput>#info.width#</cfoutput> source = <cfoutput>#info.source#"</cfoutput> pixel size = <cfoutput>#info.colormodel.pixel_size#</cfoutput> transparency = <cfoutput>#info.colormodel.transparency#</cfoutput>