Mam błąd Fatal error: Call to undefined function: imagecreatefromjpeg() in c:\program files\easyphp1-8\www\image.php on line 54
<?php
$opis = $_POST['opis'];
$zdjecie = $_FILES['zdjecie']['name'];
$ImageDir ="C:/Program Files/EasyPHP1-8/www/zdjecia/";
$ImageThumb = $ImageDir . "thumbs/";
$ImageName = $ImageDir . $zdjecie;
list
($width, $height, $type, $attr) = getimagesize($ImageName); if ($type > 3) {
echo "Przesłany obraz nie jest w formacie GIF , JPG lub PNG.<br>"; } else {
$insert = "INSERT INTO realizacje
(opis, zdjecie, data)
VALUES
('$opis', '$zdjecie', '$today')";
$newfilename = $ImageDir .$lastpicid . ".jpg";
if ($type == 2){
rename($ImageName, $newfilename); } else {
if ($type == 1) {
$image_old = imagecreatefromgif($ImageName);
} elseif ($type == 3) {
$image_old = imagecreatefrompng($ImageName);
}
$image_jpg = imagecreatetruecolor($width, $height);
imagecopyresampled($image_jpg, $image_old, 0, 0, 0, 0,
$width, $height, $width, $height);
imagejpeg($image_jpg, $newfilename);
imagedestroy($image_old);
imagedestroy($image_jpg);
}
$newthumbname = $ImageThumb . $lastpicid . ".jpg";
$thumb_width = $width * 0.10;
$thumb_height = $height * 0.10;
$largeimage = imagecreatefromjpeg($newfilename);
$thumb =imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($thumb, $largeimage, 0, 0, 0, 0,
$thumb_width, $thumb_height, $thumb_width, $thumb_height);
imagejpeg($thumb, $newthumbname);
imagedestroy($largeimage);
imagedestroy($thumb);
$url= "location: showimage.php?id=" . $lastpicid;
}
}
?>
Dlaczego?