I tried:
function LoadJpeg ($imgname) {
$im = @imagecreatefromjpeg ($imgname); / Attempt to open /
if (!$im) { / See if it failed /
$im = imagecreate (150, 30); / Create a blank image /
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc = imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
/ Output an errmsg /
imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
However it doesn't display anything. It doesn't get past the line:
$im = @imagecreatefromjpeg ($imgname);
Also I tried:
$src=ImageCreateFromJpeg($image);
$swidth=ImageSx($src);
$sheight=ImageSy($src);
$dwidth=$swidth.25;
$dheight=$sheight.25;
$dst=ImageCreateTrueColor($dwidth,$dheight);
ImageCopyResampled($dst,$src,0,0,0,0,$dwidth,$dheight,$swidth,$sheight);
ImageJpeg($dst,$thumbname);
ImageDestroy($src);
ImageDestroy($dst);
And then I got this message:
"<b>Fatal error</b>: Call to undefined function: imagecreatefromjpeg()"
I am using PHP version 4.1.1
Does anyone know what is going on?