The Dopefly Tech Blog

« The Dopefly Tech Blog Main page

Alagad image.cfc - fake bicubic resize

posted under category: ColdFusion on September 13, 2004 at 12:00 am by Nathan

I've been playing and tinkering just a bit with the Alagad Image Component. It's a nice tool, but making thumbnails with it is tricky, and the output tends to be ugly. Here's my work-around for resizing an image with this thing.

imgWidth = image.getWidth();
if (imgWidth GT 500) {
image.blur(int(image.getWidth()/500));
image.scalePixels(...);
}

That's it. For every 500 pixels, you blur it one pixel before you size it down to make your thumbnail. YMMV, but 500px seems to be the sweet spot for me.