PDA

View Full Version : Altering Uploaded Image Sizes


doog
February 9th, 2005, 05:23 PM
Is there a way to modify the size of an Image (common formats) using PHP via a webpage? I current have a gigabyte of upload space and I do not want to use it all up uploading 5+ mb pictures. I do not want to just limit the file type and size during the upload.

Thanks,

degsy
February 9th, 2005, 06:01 PM
There are many scripts to do that but why would you let a user upload a massive image only for it to be resized?

The Limit in the script would be a better choice.

Checkout GD, imageMagik and Gallery scripts.

doog
February 9th, 2005, 09:43 PM
I don't! I want the user to resize the pictures before the pictures are uploaded to my server, so I was thinking an applet or php could do that using the client machine (not by using my server) and therefore not using my bandwidth.

renegade600
February 9th, 2005, 10:08 PM
how are the users uploading pictures to your server? Who is this user? ARe you talking about 5+ meg of pictures or each picture is 5+ meg? What type of site is this?

doog
February 9th, 2005, 10:26 PM
The pictures are being uploaded through the web. Users are whoever signs up. The size of the files will depend on the megapix on the camera or resolution of the scanner, but I would guess between 1 MB to 5 MB per picture. The site is built in php and is for commercial business.

I would like to get the pictures down to 100kb by reducing the size before the pictures are uploaded onto the server.

renegade600
February 9th, 2005, 10:48 PM
The problem is you want the script to be downloaded into the visitors computer. This could cause issues. Your best bet will be to require the visitor to change the sizes themselves using the graphic program of their choice before uploading then have some sort of script to check the size or file extension before loading into your computer.

Decreasing the size that drastically will reduce the quality of the picture. Letting the visitor change the size themselves could eliminate any possible legal problems over quality.