Hi!,
can someone help me with this code ... it print the echo "before" but not the "after" ... i've got GD 2.0.1.2
//Get Forms Values
$f_country = $REQUEST["f_country"];
$File = $FILES["File"]["tmp_name"];
$size = getimagesize($File);
$w = $size[0];
$h = $size[1];
$max_w = 480;
$max_h = 350;
$dir = "../../xml/en/";
$quality = 90;
$id = "10.jpg";
if(($w > $max_w) || ($h > $max_h)){
if($h > $w){
$ratio = ($h/$w);
$new_h = $max_h;
$new_w = ($new_h/$ratio);
echo "1";
}
if($w > $h){
$ratio = ($w/$h);
$new_w = $max_w;
$new_h = ($new_w/$ratio);
echo $new_w." - ".$new_h;
}
if($w == $h){
$ratio = "1";
$new_w = $max_w;
$new_h = $max_h;
echo "3";
}
echo "before";
$source = imagecreatefromjpeg($File);
$template = imagecreatetruecolor($new_w,$new_h);
echo "After";
imagecopyresampled($template,$source,0,0,0,0,$new_w,$new_h,$w,$h);
imagejpeg($template,"$dir/$id",$quality);
}else{
copy($File,"$dir/$id");
}