ImageCFC: Documentation: Method Description

imageCFC.getImageInfo()

Description

Get a variety of information about an image.

Returns

A structure containing the following fields:

keyvalue
errorCode0 for success, non-zero for failure. Always returned, but not really used if the throwOnError option is set to true.
errorMessageA description of the error. Always returned, but not really used if the throwOnError option is set to true.
widththe images width in pixels
heightthe images height, in pixels
colorModela string representation of the color model
sampleModela string representation of the sample model
imageTypethe type of image
misca (useless) string representation of the image object

Function Syntax

getImageInfo(objImage,inputFile)

ParameterRequired?DefaultDescription
objImage YES - A java image object, or a blank string.
inputFile YES - File path or URL to an image, or a blank string.

You must supply either an image object or a file path to a source image.

Example

<cfset imageCFC = createObject("component","image")>
<cfset imgInfo = imageCFC.getImageInfo("", "C:\Inetpub\wwwroot\myimage.jpg")>
<cfoutput>
Image Dimensions: #imgInfo.width# x #imgInfo.height#
</cfoutput>

Please read this project's LICENSE

This is an open source project written by Rick Root. Please visit The Coldfusion Open Source Blog for more information.

Please report bugs, make suggestions, and send compliments to me via email.