hello i want to create a php that creats a jpeg with 4 vars it gets like the path filename width en height
both all it give's is a black picture what i'm a doing wrong
<?php
$path = "babe";
$file = "babe.jpg";
$max_h = "500";
$max_v = "500";
$size = getimagesize ("$path/$file");
list($breedte,$hoogte) = sscanf($size[3],"width=\"%d\" height=\"%d\"");
if ($breedte > $max_v)
{ $coffiecient = $max_v / $breedte;
$hoogte = $hoogte * $coffiecient;
$breedte=$max_v;
}
if ($hoogte > $max_h)
{ $coffiecient = $max_h/ $hoogte;
$breedte = $coffiecient * $breedte;
$hoogte = $max_h;
}
Header("Content-type: image/jpeg");
$dst_img=ImageCreate($breedte,$hoogte);
$src_img=imagecreatefromjpeg($path."/".$file);
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
imagejpeg($dst_img);
// ImageDestroy($dst_img);
?>