Do you Ever wished you could be able to upload your images, and didn’t care about manually resizing it? If yes, here is a real good code snippet: A php open-source script that can resize your images “on the fly”.
To achieve this goal, follow these simple steps:
1.Get the source script into a new document called ‘timthumb.php (I assume you named it timthumb.php)
2.Use a FTP client to connect to your server and create a new directory called scripts. Upload the timthumb.php file in it.
3.Once done, you can call images like this:
<img src="/scripts/timthumb.php?src=/images/whatever.jpg&h=150&w=150&zc=1" alt="" />
TimThumb allows the following parameters:
zc: zoom crop (0 or 1)
q: quality (default is 75 and max is 100)
In other words, you just have to call the timthumb.php file and pass your image as a parameter, same goes for desired width or height. What a real time saver this script is!