redimensionar imagens usando o dhtmlxVault

CyberOps

I'm cool cuz I Fold
boas, isto n ta a funcar e é por causa da funcao imagecreatefromjpeg. alguma ideia pq?

cumps

PHP:
<?php
$id  = $_GET['sessionId'];
    $id = trim($id);
 
    session_name($id);
    session_start();
    $inputName = $_GET['userfile'];
    $fileName  = $_FILES[$inputName]['name'];
	$tempLoc   = $_FILES[$inputName]['tmp_name'];
	
	$img = imagecreatefromjpeg($_FILES[$inputName]['tmp_name']);
	$wo      = imagesx($fileName);
	$ho      = imagesy($fileName);
	echo ("<script> window.alert(\"$wo, $ho\") </script>");
	if ($wo>$ho){$wd=640; $hd=480;}
	else{$wd=480; $hd=640;}
	
	$imgd    = imagecreatetruecolor($wd, $hd);
	imagecopyresized ($imgd, $img, 0, 0, 0, 0, $wd, $hd, $wo, $ho);	
    
    echo $_FILES[$inputName]['error'];
    $target_path = 'c:\\';
    $target_path = $target_path . basename($fileName);
	
	$target_path1 = 'c:\\new\\able.jpg'
	
	
    if(move_uploaded_file($tempLoc,$target_path))
    {
        $_SESSION['value'] = -1;
    }
	
	imagejpeg($imgd,$target_path1);
 
?>
 
Back
Topo