Skip to content

Instantly share code, notes, and snippets.

@stphnwlkr
Last active December 14, 2015 21:29
Show Gist options
  • Select an option

  • Save stphnwlkr/5151645 to your computer and use it in GitHub Desktop.

Select an option

Save stphnwlkr/5151645 to your computer and use it in GitHub Desktop.
Resize existing photos
<cfoutput>
<cfdirectory directory="#expandpath('#application.root#/gallery/photos/raw')#" action="list" name="rawf" filter="*.jpg">
<cfloop query="rawf">
<cfimage action="read" source="#expandpath('#application.root#/gallery/photos/raw/#rawf.name#')#" name="myimage">
<cfset ImageScaleToFit(myimage, 262, "", "highestQuality")>
<!--- resize it small --->
<cfimage action="write" quality="1" source= "#myimage#" destination= "#expandpath('#application.root#/gallery/photos/sml/#rawf.name#')#" overwrite="yes">
</cfloop>
<h3>Done</h3>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment