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.
![]()
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
14.03.08 |
Graphics |
2 |
del.icio.us
Stumble
Digg
Furl





RSS/Atom
Comments
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
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.
Wanna say something?
Comments are not allowed on this post..