English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

does anyone know how i can resize an image when someone tries to upload a file to my site but not as a thumbnail actually resize the image ??

2007-12-26 16:57:53 · 3 answers · asked by steven m 2 in Computers & Internet Programming & Design

3 answers

i think the bellow fuction can resize the image thez going to be uploaded to your size..

bool imagecopyresized ( resource $dst_image , resource $src_image , int $dst_x , int $dst_y , int $src_x , int $src_y , int $dst_w , int $dst_h , int $src_w , int $src_h )

2007-12-26 18:13:27 · answer #1 · answered by Anonymous · 1 0

There are various ways...
The first problem is that you cannot know te image size on the server BEFORE it is uploaded!
So, you can limit the upload size (use MAXSIZE in file transfer).
When it is uploaded, use the function "getimagesize" to find out its size.
Then use the function above (resize).
Check the functions at www.php.net, search "getimagesize", and on the left, you have all image functions.
Very useful.

2007-12-29 05:07:39 · answer #2 · answered by just "JR" 7 · 0 0

I don't think GD will do.

Invoke 'convert' utility from ImageMagick via exec() - it is available on most Unix hosting platforms:

For example:

convert -geometry 400x200 file1.jpg file2.jpg

Of course, there's more to that, but I hope you get the idea.

---
On the second thought, GD seems to be capable of image resizing, however, I haven't verified that.

Check this:
http://us2.php.net/imagecopyresized

2007-12-27 01:05:06 · answer #3 · answered by General Cucombre 6 · 0 0

fedest.com, questions and answers