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

Using loop to count number of entries
I'm writing a program that must ask user to type in numbers. After each entry, the program has to re

array_diff weirdness
I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_va

error help - Dynamic Image
I've been working on making my site less cluttered in the directories and more secure lately. In an

Why is this function returning a false value when it shouldn't be??
This is in an include file. I want it to check a value in an html form and see if it's just white s

array help
Does anyone know how to require 10 text fields for individual grades and output class average? (10 p

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

BI in Upstream Production operations
Appreciate if you can assist in the following areas:
1) Examples of life before and after BI i

Update not working ... please help
Hi,

I am trying to update a row using an edit form by passing id of the row .. but it is not

$_POST variable un-useable
I'm trying to use a $_POST variable in a mysql update statement but i can't use it for some unknown

big pagination problem in php
<?php

$connect = mysql_connect("localhost", "root", "")

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