Smart Image Resizer: Image Resizing, With Style!

Maintaining graphic-intensive websites can be a pain, every webmaster knows that. Having to go through the painstaking process of manually creating thumbnails is a boring and time-consuming duty we’d all like to get rid of (even if we have spent countless hours developing state-of-the-art photoshop actions sets for that purpose). Well, guess what? The time of pain is over!

While looking for interesting on-the-fly image resizing techniques, we came accross a ridiculously easy-to-use PHP script for resizing images the smart way. Created by the Joe Lencioni, the guy behind Shifting Pixel, this little piece of gold consists of a single PHP script, that you’ll put anywhere on your web server along with a companion folder named “imagecache”. And then you let the magic begin.

Shifting Pixel

All you have to do from now โ€” and believe us, it’s really as easy as that โ€” is to src to the script in every <img> tag you want to get a thumbnail for, with the proper querystring. Your tag will then look like something similar to:

<img src=”image.php/output_image_name.ext?
     width=nnn&height=nnn&
     image=path_to__image.ext” />

Oh boy, it works like a charm!

But wait, there’s more: thanks to this script, you can also get square thumbnails. These add a definitive classy touch to your pages, and just require a simple extra “&cropratio=1:1” argument in the call. Isn’t the world a beautiful place? And since the usage of the script is fully transparent for the developer, it can be called from any host language โ€” as long as your webserver runs PHP and GD and your language outputs valid (X)HTML!

ยป Download Smart Image Resizer


2 Responses to “Smart Image Resizer: Image Resizing, With Style!”

  • pavan Says:

    hii..nice script..
    i want to resize the images that are coming from the DB, the script i downloaded did not work.
    can you please help me where i should provide the image paths..
    many thanks

  • Marc Says:

    Hi Pavan,

    I suggest you take a look at the author’s website to get additional info on how to use the script. That said, as far as I know, the script will only work with images that physically exist on the web server. In my understanding, it won’t be of use for images that are stored as blob objects in a database, unless you output the blob content to a file first. But pay a visit to shifting pixel, I’m sure it’ll help.

Leave a Reply