Determines whether a variable returns a ColdFusion image.
isImage(value)
returns boolean
Name | Type | Required | Default | Description |
---|---|---|---|---|
value | any | Yes | The value that is checked. |
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");