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


Posted on 16th Feb 2014 07:03 pm by admin

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

No comments posted yet

Your Answer:

Login to answer
282 Like 26 Dislike
Previous forums Next forums
Other forums

Ariba 9r - SAP MM Integration
Hi experts,

The standard Ariba adapter for 9r creates a relationship between Cost Centers

ScriptManager History and Opera Issue
I am having an issue in opera with the ScriptManager. I have a ScriptManager on a page with history

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

How to copy a part of a vector in a raw memory
Hi,

How can I copy a part of a vector into a memory:

1
2
3
4
5

Which practice of iteration through containers is preferred
In the "real world" what kind of loop do most people use to iterate through a container like a vecto

Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...

The coeffi

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

dinamic "textboxes"?
Ey all, my first post here, i hope its not a hard one

I display mysql results in a table

BIG file upload!
Hey guys!

I'm trying to upload a file, it works well with smaller files but with 60mb+, I get

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash