Does anyone know...

Discussion in 'PHP' started by oo7ml, Apr 29, 2008.

  1. #1
    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);
    PHP:
    thanks in advance
     
    oo7ml, Apr 29, 2008 IP
  2. nihcer

    nihcer Member

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    check http://www.php.net/imagejpeg

    quality

    quality is optional, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default is the default IJG quality value (about 75).
     
    nihcer, Apr 29, 2008 IP
  3. oo7ml

    oo7ml Well-Known Member

    Messages:
    656
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    ok cool, thanks
     
    oo7ml, Apr 29, 2008 IP