...

View Full Version : resize image on upload



andrew1234
09-07-2009, 05:07 PM
Hi

I want to write a little script that uploads an image and resizes it.

But I want to write it myself without using someone else's code.

so here here is my question:

What php function do you recommend for resizing the image that I upload

eg upload a 400px x 400px 1mb jpg and convert it to a 100px x 100px 30 kb jpg.

or do you have a URL that explains more about this concept?

I would also like to do it in standard php5?

is this posible?

thanks for the help

Thanks

A

mlseim
09-07-2009, 07:22 PM
You will be using PHP GD.

Here is a place to start with many script examples.
I know you want to write your own, but these examples explain a lot:
http://us.php.net/manual/en/function.imagecopyresampled.php

You'll be doing a PHP upload script that saves the full-size original image,
and then loads that full-size and makes a thumbnail, and resaves it either
into a different directory or a different filename (add _t ) to the filename?

To get to GD help quickly for various topics, use Google.
Type PHP GD and then the word you're looking for,
Example: PHP GD getimagesize

andrew1234
09-07-2009, 08:36 PM
thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum