imageInfo

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

imageInfo(name) → returns Struct

Member Function Syntax

someImage.info()

imageInfo Argument Reference

name
Required

The image on which this operation is performed.

Examples sample code invoking the imageInfo function


Get Image Info

Uses the imageRead function to read an image from a url.

<cfset img = imageRead("http://lorempixel.com/10/20/")>
<cfset imgInfo = imageInfo(img)>
<cfoutput>Image is #imgInfo.height#px high and #imgInfo.width#px wide.</cfoutput>

Expected Result: Image is 20px high and 10px wide.


Using info member function

CF 11+ Lucee 4.5+ Exract the image info

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
info = imgObj.info();
writeDump(info);

Fork me on GitHub