Skip to content

Instantly share code, notes, and snippets.

@jbuda
Created March 19, 2013 12:53
Show Gist options
  • Save jbuda/5195861 to your computer and use it in GitHub Desktop.
Save jbuda/5195861 to your computer and use it in GitHub Desktop.
CF resize and save image
<cfdirectory action="list" directory="#expandPath('/imgs')#" name="imgs" filter="*.jpg" />
<cfoutput query="imgs">
<cfimage source="#directory#/#name#" name="img" />
<cfset ImageGrayscale(img) />
<cfset imageScaleTofit(img,200,'') />
<cfimage source="#img#" action="write" destination="#expandPath('/finalimages/')##listFirst(name,'_')#.jpg" overwrite="no" />
<cfflush>
#name# done <br/>
</cfoutput>
<br/>
all done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment