LinksTraffic - Links and traffic exchange system

Resize an Image

english directory french directory
Search: Advanced Search

Index Webmaster | Tutorials | Web Scripts

Resize 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, try it here (new window).

This example takes a local image, resizes it and saves the result under a new name.

The source code:

Notes:
- 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

Comments

No comment yet, write the first now here or onto our webmaster forum

Webmaster Corner

The Millionaire league
Dozens of Easy and Automatic Ways to Make Money Online Everyday!

Niche Annihilation Method
Crush Your Competition!
Download the method Now

iPowerWeb
Incredible Membership Packages - Web Hosting!

One Month Free Trial! ProStores - an eBay Company
Gain customers, increase sales, and boost profits with your own Web Store.

Get Google Pay-Per-Click Ads Free!
Automated Cash Formula $$$

Categories

Copyright 2004-2008 @ LinksTraffic RHM Solution ::: Partners | Privacy | Contact us form