hi!
I have images gallery. First i load images on the fly with auto resizing. when I load some images crashed. How i detect this corrupt images and put error massage?
I see this from www.php.net :
<?php
function LoadJpeg($imgname)
{
$im = @imagecreatefromjpeg($imgname); / Attempt to open /
if (!$im) { / See if it failed /
$im = imagecreatetruecolor(150, 30); / Create a black 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;
}
?>
but i dont know how use this!
Thank you!