PHP Smart Image Resizer Script

Smart image resizer is a PHP script which makes it very easy to resize & crop images. And, this is done without touching the original image.

PHP Image Resizer

The width & height of the image to be resized is mentioned in the img tag like:

<img src="/image.php/coffee.jpg?width=200&height=200ℑ=//uploads/coffee.jpg" alt="Coffee" />

and image is resized via the GD library.

Newly created image is stored in a cache directory & won’t be re-created until new dimensions are mentioned to improve the system performance.

Cropping an image also warks the same way. Simply mention the crop ratio & that’s all.

Smart Image Resizer supports JPG, GIF & PNG images and requires PHP 5.1.0+ to run.

  • 5.1+ required? I could probably write this for 4.2 and have it work exactly the same.

  • Great resource!.
    Thanks a lot.

  • dirk

    There is a very weird charactter used in the parameter line, how does that work?

  • dirk

    found it, it is ampersand image= wich isconverted by a browser to an utf character funny J &image=

  • rohith

    thanks..its useful for me