Determines whether a variable returns a ColdFusion image.

isImage(value) → returns boolean

Argument Reference

value any

The value that is checked.

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#">

Output whether the online file is an image


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