ColdFusion 9.0 Resources |
IsImageFileParameters
UsageUse this function to determine whether an image file is valid. This function returns a False value if the image file format is not supported by the server where ColdFusion is deployed, or if the pathname to the image file is null or invalid. For a list of standard image file formats supported by ColdFusion, see the supported image file formats provided in cfimage. To determine which image file formats are supported on the server where ColdFusion is deployed, use the GetReadableImageFormats and GetWriteableImageFormats. Example<!--- Use the IsImageFile function to determine whether an image retrieved from the artwork table in the cfartgallery database is a valid image file. ---> <cfif IsImageFile("images/#artwork.largeImage#")> <cfset myImage=ImageNew("images/#artwork.largeImage#")> <cfset ImageResize(myImage,50,"")> <cfimage action="writeToBrowser" source="#myImage#"> <cfelse> <p>I'm sorry, there is no image associated with the title you selected. Please click the Back button and try again.</p> </p> </cfif> |