Jump to content

can i optmize image to 50% quality before uploading 2 server


ryanfern86goa

Recommended Posts

Hi there

 

i have jus written a php program to upload and display images but when i try to upload them it takes a long time to upload if the file is big. But the big problem is when i try to display them. The time taken to display them is huge. so i was just wondering if its posible to optimize a image quality to 50% or reduce size before uploading it to the server and also save some bandwidth. can i do this directly from the upload form for jpeg image

 

$name=$_FILES['file']['name'];

$tmpname=$_FILES['file']['tmp_name'];

$path=images/$name;

$tmp=imagecreatefromjpeg($tmpname);

imagejpeg($tmp,$path,50);

 

Any comments would be grately be appreciated.

 

thanks

hi

 

thanks for your reply. so there isnt any other way that i can do it from the server side?.  or is there any other way to speed the upload time . Also how to preload multiple images in php may be in combonation with javascript.

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.