ColdThumbs is a ColdFusion component to dynamically resize and cache images.
Easy to set up and integrate with your application or website, ColdThumbs is designed to be very simple to use.
Inspired by the popular PHP script: ‘TimThumb‘.
Setting up ColdThumbs is easy.
1) Download the latest version and place in a folder under your webroot.
2) [OPTIONAL] Set up a redirect to run all image files on your site through the ColdThumbs.cfm script. This allows you to use the image file as the SRC and makes use of ColdThumbs transparent to the end user.
3) Pass images to the script and watch them resize before your very eyes!
Usage: <img src=”path/to/coldThumbs.cfm?src=/location/of/image.jpg&w=400&h=600″ />
ColdThumbs uses CFImage functionality to resize images, and therefore requires ColdFusion 8 or above.
It was developed on a Railo server version 3.3.1.000 – however I’m confident it would run fine on earlier versions with CFImage functionality.
Currently ColdThumbs has only been tested in a Windows environment – I don’t have a Linux environment to test with but would appreciate feedback!
Settings and Parameters
ColdThumbs can function with very few parameters, however there are a few things you may customise, either by passing as a URL parameter, or setting via the init method.
src – The location of the image. Use absolute paths from the root of your website.
w – The width of the resized image
h – The height of the resized image
interpolation – The interpolation method to use when resizing (defaults to ‘mitchell’).
cacheFolder – The folder in which to store cached images (defaults to ‘cached’ under the script folder).
allowHotlinking – If true, ColdThumbs will check that the script has been called from the same server as referring page, to combat hotlinking of your cached images.
maxWidth – Maximum width of resized image in pixels.
maxHeight – Maximum height of resized image in pixels.