Cropping an Image
Copy and paste the following code into your editor and run it (code comments are included). If you want to see the live result (we believe this is the best way to learn what is the script about), try it here (new window). The source code This example takes a local image, crops it and saves the result under a new name. download the file - there are some functions which require the GD 2.0.1 library or later (2.0.28 or later is recommended);
- you need to have the necessary permissions to be able to write a file on your server (see chmod on linux/unix);
- try this if you wish to verify the GD version: var_dump(gd_info());
You may wish to read additional materials from:
- http://us.php.net/getimagesize
- function.imagecreatetruecolor.php
- function.imagecreatefromjpeg.php
- function.imagecopyresampled.php
- function.imagejpeg.php
Post a comment
|
Webmaster Corner
The ClickBnk Code
Another Killer Product From Michael Jones, simply follow the Blueprint For Easy Online Wealth Using Click Bank...
Mass Article Control #1 Create Thousands Of Articles From only 1 Article and Have them Submitted Automatically With A brand New Submitter!
iPowerWeb

Incredible Membership Packages - Web Hosting!
→ Maverick Money Makers - Get Paid For Life!
|
Categories
|