Hi, i know very little about this php gig, i am trying to make a function that will resze a jpeg on uploading, so that i dont end up with a whole lot of huge images that will mess around with my lovely layout. this is the error message that i'm getting...
Fatal error: Call to undefined function: imagecreatefromjpeg() in c:\program files\apache group\realdocs\files\catagories\tryingresize.php on line 13
As i say i dont know much about this stuff and havent managed to find a decent book on it yet so any help would be much appreciated.
function do_upload($filename,$image_name) {
$file = basename($filename);
$src_img = imagecreatefromjpeg($filename);
$new_h =imagesy($src_img)/4;
$dst_img =imagecreate($new_w,$new_h);
imagecopyresized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));
$tmp_upload_path = "c:\windows\";
$new_file_name = "c:\program files\apache group\realdocs\files\catagories\images\".$image_name;
if (!copy($tmp_upload_path.$file, $new_file_name)) echo "failed to copy file<br>\n";
return;}