Bonjour,
J'ai créer un fichier image.php que j'ai placé sur mon serveur distant dont voici les codes:
Ceux ci sont issus de l'adresse suivante qui possède toutes les explications utiles:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 <?php //On importe l'image a laquelle nous allons ajouter le texte $img = imagecreatefrompng('image.png'); //On prepare la couleur, en RGB $noir = imagecolorallocate($img, 0, 0, 0); //On ajoute le texte a l'aide de la fonction imagettftext imagettftext($img, 20, 0, 15, 30, $noir, 'chopin_script.ttf', 'Mon texte'); //On affiche l'image header('Content-type: image/png'); imagepng($img); ?>
http://www.supportduweb.com/scripts_...gettftext.html
Néanmoins je ne parviens pas à faire apparaître l'image comme indiquée dans ce tuto.
Et voici le message retourné lorsque je lance ce fichier:
Et voici le message affiché sous Wamp:Warning: imagecreatefrompng(image.png): failed to open stream: No such file or directory in /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php on line 3 Warning: imagecolorallocate() expects parameter 1 to be resource, boolean given in /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php on line 5 Warning: imagettftext() expects parameter 1 to be resource, boolean given in /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php on line 7 Warning: Cannot modify header information - headers already sent by (output started at /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php:3) in /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php on line 9 Warning: imagepng() expects parameter 1 to be resource, boolean given in /customers/6/0/9/jeuxechecs.fr/httpd.www/image.php on line 10
Je serai bien curieux de savoir pourquoi cette image ne peut apparaître?L'image "http://localhost/image/image.php" ne peut être affichée car elle contient des erreurs.
C'est ainsi que je m'adresse à vous pour tenter de comprendre pourquoi cela ne fonctionne pas.
Et de pouvoir y remédier bien sûr.
Merci d'avance.







Répondre avec citation
Partager