Lamez Posted December 14, 2008 Share Posted December 14, 2008 I am trying to upload a image, then resize it. here is my error: Fatal error: Call to undefined function imagecopyresampled() in /var/www/krazypicks/admin_area/foot/new_foot_bowl_proc.php on line 32 here is line 32: $file = "bowls_img/" . $imagepath; //This is the original file here is the entire script: <?php ob_start(); $path = "../../"; $title = "Create Football Bowls"; $rank = "yes"; $u_login = "yes"; $admin = "yes"; include ($path."main/include/cons/head.php"); $counter = $_SESSION['counter']; for ($counter = 1; $counter <= $num; $counter++) { //Image Settings! $imagename = $_FILES['image-'.$counter]['name']; $source = $_FILES['image-'.$counter]['tmp_name']; $target = "bowls_img/".$imagename; move_uploaded_file($source, $target); $imagepath = $imagename; $save = "bowls_img/" . $imagepath; //This is the new file you saving $file = "bowls_img/" . $imagepath; //This is the original file $modwith = $twidth; $modheight = $theight; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; $save = "ibowls_img/sml_" . $imagepath; //This is the new file you saving $file = "bowls_img/" . $imagepath; //This is the original file list($width, $height) = getimagesize($file) ; $modwidth = 80; $diff = $width / $modwidth; $modheight = $height / $diff; $tn = imagecreatetruecolor($modwidth, $modheight) ; $image = imagecreatefromjpeg($file) ; imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height) ; imagejpeg($tn, $save, 100) ; echo "Large image: <img src='bowls_img/".$imagepath."'><br>"; echo "Thumbnail: <img src='bowls_img/sml_".$imagepath."'>"; echo $name."<br>"; if($name == ("")){ $image = "main/style/img/b_default.jpg"; }else{ $image = "admin_area/foot/bowls_img/".$name; } echo $image; $id = $counter; $name = $_POST['name-'.$counter]; $ta = $_POST['ta-'.$counter]; $tb = $_POST['tb-'.$counter]; $pnt = $_POST['pnt_val'.$counter]; $date = $_POST['date-'.$counter]; $time = $_POST['time-'.$counter]; $network = $_POST['net-'.$counter]; $place = $_POST['place-'.$counter]; $rank_a = $_POST['rna-'.$counter]; $rec_a = $_POST['ra-'.$counter]; $rank_b = $_POST['rnb-'.$counter]; $rec_b = $_POST['rb-'.$counter]; $query = "INSERT INTO `foot_bowls` (id, name, pnt_val, team_a, team_b, image, date, time, network, place, rank_a, rank_b, rec_a, rec_b) VALUES ('".$id."', '".$name."', '".$pnt."', '".$ta."', '".$tb."', '".$image."', '".$date."', '".$time."', '".$network."', '".$place."', '".$rank_a."', '".$rank_b."', '".$rec_a."', '".$rec_b."')"; mysql_query($query)or die(mysql_error()); }//end loop echo "<br>All Done!"; echo "<br>Proccessed ".$id." number of forms"; include ($path."main/include/cons/foot.php"); ?> Any Ideas? Quote Link to comment https://forums.phpfreaks.com/topic/136919-images/ Share on other sites More sharing options...
Mark Baker Posted December 14, 2008 Share Posted December 14, 2008 Suggests that gd isn't enabled Take a look at the appropriate page in the PHP manual on installing gd Quote Link to comment https://forums.phpfreaks.com/topic/136919-images/#findComment-715096 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.