Trying to implement limitation on image width/height of uploaded images by users of my site. The file indeed is being uploaded because ive been able to copy it from tmp to another directory and it exists. So the form, and upload works but imagecreatefromjpeg seems not to be a valid function???
if (ereg("[a-zA-Z/]+jpeg$", $_FILES['photo']['type']))
$img = imagecreatefromjpeg($_FILES['photo']['tmp_name']);
if (ereg("[a-zA-Z/]+gif$", $_FILES['photo']['type']))
$img = imagecreatefromgif($_FILES['photo']['tmp_name']);
$width = imagesx($img);
echo "<br>Width: ".$width;
unlink($_FILES['photo']['tmp_name']);
Should tell me the width of the uploaded image right? Not so it sdays function imagecreatefromjpeg not defined:
Fatal error: Call to undefined function: imagecreatefromjpeg() in ....... on line 15
Heres the php.net manual page for imagecreatefromjpeg
http://ca3.php.net/manual/en/function.imagecreatefromjpeg.php
Does this function realy exist? wheres the definition for it, isnt it an internal function?