Hi - I am getting photos uploaded with a size of 0kb when I try out the code below. ANy ideas?
if(!empty($foto))
{
$newfotoname = uniqid("");
}
if (($foto_type == "image/gif") or ($foto_type == "image/pjpeg"))
{
$image_attribs = @getimagesize($foto);
$width=$image_attribs[0];
$height=$image_attribs[1];
$type=$image_attribs[2];
$ratio = ($width > $height)? 300/$width : 300/$height;
$new_width = $width*$ratio;
$new_height = $height*ratio;
$im_old = @imageCreateFromJpeg($foto);
$im_new=imagecreatetruecolor($new_width, $new_height);
imagecopyresized($im_new, $im_old, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imageJpeg($im_new, "../fotos_coches/".$newfotoname,80);
Thanks a lot.
Jon
(P.S Can anyone explain to me what the @ signs do? - Thanks)