TimThumb: Automatically Resize Images

TimThumb is a PHP script by Darren Hoyt that can automatically create thumbnails on the fly, caching them for later use. It scales images to the width and height you specify, either keeping the original aspect ratio or cropping the image.

To make use of the script, once installed, you simply put the URL of the TimThumb script in an image tag, and pass arguments for the original image and the scaling options.

<img src="/thumbnails/timthumb.php?src=
/images/an_image.jpg&w=128&h=128&zc=1" alt="">

This would be perfect for generating thumbnails for blog posts, which is, interestingly enough, what the script was originally developed for.

  • http://twitter.com/BinaryMoon @BinaryMoon

    It's great to see you mentioning TimThumb and any feedback you have on it would be most welcome.

    I would like to point out though, a popular misconception is that Darren made TimThumb. He came up with the idea for TimThumb but the original version was written by one of his colleagues called Tim (hence the name) and the development is now entirely controlled by me :)

    • http://intensedebate.com/people/redwall_hp redwall_hp

      I didn't know that. Do you have an updated link, or is the current version still at Darren's site?

  • http://www.itsmobetta.com buckigal

    hello,

    I have tried unsuccessfully to install this on my site but the pictures just don’t show up, can someone please assist?

    thanks so much in advance