Cod-nes Posted June 13, 2009 Share Posted June 13, 2009 I keep get a fatal error and I don't know why. Fatal error: Call to undefined function imagejepg() in E:\mowes_portable\www\thumb\index.php on line 18 <?phperror_reporting(E_ALL);if(isset($_POST['thumb'])){if (($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/png")){ $name=strtolower($_FILES["file"]["name"]); move_uploaded_file($_FILES["file"]["tmp_name"],$name); if(($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) { $img = imagecreatefromjpeg($name); $width = imagesx($img); $height = imagesy($img); $thumbwidth = 200; $newheight = round($height * (round($thumbwidth/$width,5))); $tmp_img = imagecreatetruecolor($thumbwidth,$newheight); imagecopyresized($tmp_img,$img,0,0,0,0,$thumbwidth,$newheight,$width,$height); imagejepg($tmp_img,"th.$name",100); } unlink($name);}else{die("Not valid file format.");}echo $_FILES["file"]["tmp_name"];}else{$text= <<<TEXT<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html> <head> <title>Thumbnail Generator</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form enctype="multipart/form-data" action="index.php" method="post"> <div>Images must be gif, png, or jpg.</div> <input type="hidden" name="thumb" value="gen"> <input type="file" name="file"><br> <input type="submit" value="Generate Thumbnail"> </form> </body></html>TEXT;echo $text;}?> PHP Version 5.2.8gdGD Support enabledGD Version bundled (2.0.34 compatible)FreeType Support enabledFreeType Linkage with freetypeFreeType Version 2.1.9T1Lib Support enabledGIF Read Support enabledGIF Create Support enabledJPG Support enabledPNG Support enabledWBMP Support enabledXBM Support enabled Link to comment Share on other sites More sharing options...
chibineku Posted June 13, 2009 Share Posted June 13, 2009 it's jpeg, not jepg... Link to comment Share on other sites More sharing options...
Cod-nes Posted June 13, 2009 Author Share Posted June 13, 2009 Thanks. ^^ Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.