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

limitations on array_unique()
Does any one know what/how imitations are applied to array_unique? I have an issue where no matter h

COOIS - Saving Object Overview WIP Status layouts
COOIS - Would like to be able to save the layout of an Object Overview - WIP Status report. There i

newbie error
what is wrong with this code ?

<html>
<body>

<?

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:

I am calling this javascript:
<script language="javascript">

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,

I have very strange bug, please help me if you can.

It is reproduced o

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

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