LIBRAIRIE GD

Fermé
Maractidus Messages postés 150 Date d'inscription dimanche 22 juin 2008 Statut Membre Dernière intervention 20 septembre 2009 - 23 nov. 2008 à 19:18
Maractidus Messages postés 150 Date d'inscription dimanche 22 juin 2008 Statut Membre Dernière intervention 20 septembre 2009 - 3 déc. 2008 à 14:30
Bonjour, j'avais une question : http://www.commentcamarche.net/forum/affich 9487028 remplacer texte par image help
et on m'a dit d'utiliser gd j'ai suivi le tuto du site du zéro :
et il s'affiche :
Warning: Cannot modify header information - headers already sent by (output started at /home/web/clients/world-of-marco.hostarea.org/www/testgd.php:9) in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at /home/web/clients/world-of-marco.hostarea.org/www/testgd.php:9) in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 11

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 12

Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: 'http://world-of-marco.hostarea.org//forum/images/smilies/A.gif ' is not a valid JPEG file in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 12

Warning: Cannot modify header information - headers already sent by (output started at /home/web/clients/world-of-marco.hostarea.org/www/testgd.php:9) in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 14

Fatal error: Call to undefined function imagejpg() in /home/web/clients/world-of-marco.hostarea.org/www/testgd.php on line 16

Que faire ??? Quel est le script pour remplacer "A" par l'image de mon site : http://world-of-marco.hostarea.org//forum/images/smilies/A.gif
mici d'avance !

VOICI MON SCRIPT UTILISER :

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>aaa</title>
<?php header ("Content-type: image/jpg");
?><?php header ("Content-type: image/jpeg");
$image = imagecreatefromjpeg("http://world-of-marco.hostarea.org//forum/images/smilies/A.gif ");
?><?php header ("Content-type: image/jpg"); // 1 : on indique qu'on va envoyer une image PNG
$image = imagecreate(200,50); // 2 : on crée une nouvelle image de taille 200x50 // 3 : on fait joujou avec notre image (on va apprendre à le faire)
imagejpg($image); // 4 : on a terminé de faire joujou, on demande à afficher l'image
?>
</head>
<body>
<br>
</body>
</html>


3 réponses

Alain_42 Messages postés 5361 Date d'inscription dimanche 3 février 2008 Statut Membre Dernière intervention 13 février 2017 894
23 nov. 2008 à 20:40
Bonsoir,

avant <?php header ("Content-type: image/jpg");

il ne doit y avoir aucune balise HTML

hors toi tu en as plein

ne mets pas <html etc...
0
Maractidus Messages postés 150 Date d'inscription dimanche 22 juin 2008 Statut Membre Dernière intervention 20 septembre 2009 4
25 nov. 2008 à 18:39
MErci cela a marché ( seul problème au lieu de l'image a.gif il s'affiche le lien de ma page convertit en image) mais maintenant je dois configurer le scrot pour que sois les internaute qui choisissent l'image à affiché :
Comme sur le site de cooltext :
On entre un, texte dans une boite de dialogue et on affiche le texte en image avec GD
mici de vos explications d'avvance !

esssayé sur : http://world-of-marco.hostarea.org/testgd.php
0
Maractidus Messages postés 150 Date d'inscription dimanche 22 juin 2008 Statut Membre Dernière intervention 20 septembre 2009 4
3 déc. 2008 à 14:30
up plz !
0