Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created August 29, 2012 14:32
<cfset source = "c:\users\raymond\dropbox\photos\airplane.gif">
<cfset ext = listLast(source,".")>
<cfimage action="read" source="#source#" name="img">
<cfif ext neq "gif">
<cfset imageScaleToFit(img,125,125)>
<cfset bits = imagegetblob(img)>
<cfcontent type="image/#ext#" variable="#bits#">
<cfelse>
<cfset bits = fileReadBinary(source)>
<cfcontent type="image/gif" variable="#bits#">
</cfif>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment