I have been playing around with the new cfimage tag in coldfusion 8. I am very impressed with the resize capability. Coldfusion 8 seemed to do a great job resizing my images into thumbnails. I created a tutorial here.

Here is a little bit of code to create thumbnails.


<cfimage action=“info” structname=“imagetemp” source=“Path to your image”>
<cfset x=min(150/imagetemp.width, 113/imagetemp.height)>
<cfset newwidth = x*imagetemp.width>
<cfset newheight = x*imagetemp.height>
<cfimage action=“resize” source=“#Path to your image#” width=“#newwidth#” height=“#newheight#” destination=“#thumbnail destination#”>

Update: My Using CFIMAGE to Generate Thumbnails tutorial was published at learncf.com

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Print
  • Technorati
  • Twitter

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

7 Comments

Michael EvangelistaNovember 18th, 2007 at 9:01 pm

Hi Damon -
I just started playing with this, too, and I am both impressed (at quality and speed) and relieved (at no longer jumping through extraneous hoops for images!).

I put up a little upload-resizer demo here
http://mredesign.com/demos/cfimage-example/
(no tutorial, though)

Dan G. Switzer, IINovember 19th, 2007 at 3:38 pm

@Damon:

You might want to look into the imageScaleToFit() function. The &#34;resize&#34; option doesn’t keep proportion, where the imageScaleToFit() function does.

RobinJuly 3rd, 2009 at 4:50 pm

I really like what you put together on your demo. Do you have the code for download? This demo could come in handy! Thanks, Robin.

damonledetJuly 3rd, 2009 at 7:10 pm

Yes you can download the code at http://learncf.com/zip/19

bobJuly 10th, 2009 at 9:47 pm

don't forget to round your new values

Stephen GraceySeptember 3rd, 2009 at 1:40 pm

It's bogging down my site, I think–anyone else experiencing delays with more than a few images on a page??

cfperformanceDecember 17th, 2009 at 1:12 am

Yep the performance on concurrency would probably bog down your server . If I use a 1.3 MB jpg to resize.
It takes about 13 seconds after the upload is complete to resize.

Leave a comment

Your comment