function LoadGif ($imgname) {$im = @imagecreatefromgif ($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;}
?php function loadgif( $imgname) {$im = @imagecreatefromgif($imgname); / * Tentative d'ouverture * / if ($im == "") {/ * échec? * / $im = ImageCreate(150,30); / * Crée une image vide * / $bgc = ImageColorAllocate($im,255,255,255); $tc = ImageColorAllocate($im,0,0,0); imagefilledrectangle($im,0,0,150,30,$bgc); imagestring($im,1,5,5 ,"Erreur lors du chargement du fichier $imgname",$tc); / * Affiche un message d'erreur * /} return $im;}?