isImage

Determines whether a variable returns a ColdFusion image.

isImage(value) → returns boolean

Argument Reference

value any
Required

The value that is checked.

Examples
Sample code invoking the isImage function

If the local file is an image, write it to the browser

<cfset myImage = imageNew("./sample.png")>
<cfif isImage(myImage)>
	<cfimage action="writeToBrowser" source="#myImage#">
</cfif>

Output whether the online file is an image

isImage(imageRead("https://cfdocs.org/apple-touch-icon.png");

Expected Result: true

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub