Tuesday, 27 September 2011

Script for Image Resizing / Image Rescaling / Image Cropping or creating Image Thumbnail in php


The script is very simple to use.I have researched lot for this and i got one perfect script for resizing/rescaling/cropping images.

This script Image Thumbnail will allow you to create thumbnail of any size image by resizing image or rescaling image or by cropping it.
You have the option of cropping it or to just make a normal thumbnail to cover all pixels of image by changing the value of zc=0 for normal thumbnail or zc=1 for cropping it.

How to use it ?
step 1) Download the script Image Thumbnail

step 2) Put that script in your server directory where other files are located

step 3)change image tag img src="thumb.php?src=products/images/&h=150&w=150&zc=0" alt="Image not available"

step 4) Now in image tag, you can see zc=0, this is for normal image thumbnail covering all pixel of image of any size, you can change it to zc=1, and then check the changes, it will resize for perfect fit.

Explanation : In image tag h is for height and w is for width and z is for cropping for auto fit in given width and height.

A Script from tim-thumb

No comments:

Post a Comment