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

unserialize help, getting errors
hi all ,
I got a form with 6 fields (2 input and 4 select box), when the page loads one block is

xml element exists
Code: [Select]<?xml version="1.0"?>
<Addresses>
<

mail with attachment problems
Hi. I have the following code:
Code: else if(file_exists("site".$timp.".zip")

Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

insert quotes
Hi,

I have an output like this:
Code: john,18,Cancer
How can I change this to
Code:

Execure stored procedure on a timer
Can someone tell me an easier way to execute a stored procedure on a timer? I am using Oracle 10g R

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

Add a sign-up feature to a flat file login script
I'm working on a flat file login script and I would like to add a sign-up feature to it with a email

Cannot Display Array from Select Statement + Login question
Hi,
I'm new to PHP but so far so goog. I was assigend a project and I'm very close to completion.

need help modifying script
Hi guys,

I'm fairly new to php and am having a bit of trouble modifying a script.

This

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