Click to See Complete Forum and Search --> : Does anyone know...


oo7ml
04-29-2008, 01:40 PM
Does anyone know what the highlighted 80 means in the code below:

$name = $_FILES[$fieldname]['name'];
$temp_name = $_FILES[$fieldname]['tmp_name'];
$newwidth = 400;
// make a unique filename for the uploaded file and check it is not taken, try again if so
$now = time(); //current time stamp
$path_parts = pathinfo($_FILES[$fieldname]['name']);
$uploadFilename = $uploadsDirectory . $now . "." . $path_parts["extension"];

$size = getimagesize($temp_name);

if(preg_match("~\.jpg$~", strtolower($name)))
$img = imagecreatefromjpeg($temp_name);

$round = round( $size[1] / ($size[0]/$newwidth));
$trumb = imagecreatetruecolor($newwidth, $round);
imagecopyresampled($trumb, $img, 0, 0, 0, 0, $newwidth,$round, $size[0],$size[1]);
imagejpeg($trumb, $uploadFilename, 80); //what does this 80 mean
imagedestroy($trumb);

thanks in advance

chazzy
04-29-2008, 01:50 PM
http://us2.php.net/imagejpeg

The third parameter is "quality"

oo7ml
04-29-2008, 01:54 PM
cool... thanks is there a big difference between having it at 90 instead of 80

apulmca2k4
04-30-2008, 04:25 AM
This is size Of file in KB.