UMD Web Site

Page Content   Main Links   Page Links   Utility Links   Search   Footer Links

ColdFusion Development Project

cf_imageinfo

Description: Returns detailed information about the image file supplied to this tag. The information contains details such as: filename, file type (JPG, GIF, PNG), image dimensions (W x H), file size, true colors etc.
Syntax:
<cf_imageinfo
  image = "file_name"
  verbose = "Yes" or "No">
See also: cf_imageprocessing
Attributes:
Attribute Name Required/Optional Default Description
image required
Absolute, physical path to the image file. The image file must be physically located on the same server.
verbose optional No Returns a more detailed set of information for the image file.
Returns: A variable imgInfo is created as local variable in the calling page. The values are:

imgInfo = file not found if the specified image file does not exist
imgInfo = <image information> for a valid image file

The image information can vary depending on the type of the image. The short version is space-delimited, the verbose version are new line character delimited description:value pairs. Use ColdFusion string and list manipulation functions to extract the desired pieces. Additional documentation on the output format can be found here.
Example:

Short version of the image information:
<cf_imageinfo image="#expandPath('cograilway.jpg')#">
Result:
/webroots/www.umassd.edu/cf_project/custom_tags/cograilway.jpg JPEG 640x480 DirectClass 52kb 0.000u 0:01

Verbose (detailed) version of the image information:
<cf_imageinfo image="#expandPath('cograilway.jpg')#" verbose="Yes">
Result:
Image: /webroots/www.umassd.edu/cf_project/custom_tags/cograilway.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Geometry: 640x480
Class: DirectClass
Colorspace: RGB
Type: TrueColor
Depth: 8 bits
Endianess: Undefined
Channel depth:
Red: 8-bits
Green: 8-bits
Blue: 8-bits
Channel statistics:
Red:
Min: 0
Max: 255
Mean: 128.815
Standard deviation: 46.3044
Green:
Min: 0
Max: 255
Mean: 134.533
Standard deviation: 45.3029
Blue:
Min: 0
Max: 252
Mean: 109.556
Standard deviation: 74.3753
Colors: 80208
Rendering-intent: Undefined
Resolution: 72x72
Units: PixelsPerInch
Filesize: 52kb
Interlace: None
Background Color: white
Border Color: #DFDFDF
Matte Color: grey74
Dispose: Undefined
Iterations: 0
Compression: JPEG
Orientation: Undefined
JPEG-Quality: 80
JPEG-Colorspace: 2
JPEG-Sampling-factors: 2x2,1x1,1x1
signature: 4378457f26ebadd9fce0d9b904a80b36612cf64c79ce2ee1c17a786aebbf6819
Profile-exif: 20 bytes
Tainted: False
User Time: 0.010u
Elapsed Time: 0:01

Contact Info:

Email: webdevelopment@umassd.edu - Web Design & Development

Main Links

Page Links

Utility Links

Search

 
Text Only Options

Top of page


Text Only Options

Open the original version of this page.

Usablenet Assistive is a UsableNet product. Usablenet Assistive Main Page.