View Full Version : resize image on upload

09-07-2009, 06:07 PM

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



09-07-2009, 08: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:

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

09-07-2009, 09:36 PM