IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[ImageMagick] Appel d'une image ?


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Futur Membre du Club
    Inscrit en
    Mai 2007
    Messages
    17
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 17
    Points : 6
    Points
    6
    Par défaut [ImageMagick] Appel d'une image ?
    voisi mon code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
     
    <?
    header("Content-type: image/jpeg");
    	echo "<body onLoad='window.print()' leftmargin='0' topmargin='0'>";
    $n_ins = $_GET["n_ins"] ;
    $nom = $_GET["nom"] ;
    $prenom = $_GET["prenom"] ;
    $an= $_GET["an"] ;
    $moy_an = $_GET["moy_an"] ;
    $crd_an= $_GET["crd_an"] ;
    $anuni= $_GET["anuni"] ;
    $lieun= $_GET["lieun"] ;
    $daten= $_GET["daten"] ;
    $fond="certif.jpg";
    $image = imagecreatefromjpeg($fond);
    $image=imagecreate(700,460);
    $blanc = imagecolorallocate($image, 255, 255, 255);
    $noir = imagecolorallocate($image, 0, 0, 0);
    $bleu = imagecolorallocate($image, 0, 0, 255); 
    $data_fond=getimagesize($fond);
    /* 	0 pour la largeur
    	1 pour la hauteur
    	2 pour le type 1=gif 2=jpg 3=png
    	3 pour la chaine complete "height=xxx width=yyy"  */         
    	$fondtoload=imagecreatefromjpeg($fond);
    $larg=$data_fond[0];
    $haut=$data_fond[1];
    $x=700;
    $y=($x*$haut)/$larg;
    if ($y>$x) { $y=$x; $x=($y*$larg)/$haut; }
    $posx=(100-$x)/2;
    $posy=(100-$y)/2;
    imagecopyresized($image, $fondtoload, 0, 0, 0, 0, 700, 460, $data_fond[0], $data_fond[1]);
    $texte=$nom;
    $texte6=$prenom;
    $lentexte=strlen($texte);
    $hp=50;
    $y0=235;
    $x0=168;
    $lentexte=$lentexte+$hp;
    $lentexte=$lentexte+$x0;
    if (((700-$texte)/2) < 0)
    { //$police=$police-1;
    }
    $taille=12;
    //$date=date("d-m-Y");
    $anuni2=$anuni+1;
    imagestring( $image, $taille, 535, $y0-64, $anuni."/".$anuni2, $bleu ) ;
    imagestring($image, $taille, $x0+22, $y0-29, $texte,$bleu);
    imagestring($image, $taille, $lentexte+100, $y0-29, $texte6,$bleu);
    $texte2=$daten;
    $y1=252;
    $x1=168;
    imagestring($image, $taille, $x1+22, $y1-28, $texte2,$bleu);
    imagestring( $image, $taille,$x1+162, $y1-28, $lieun, $bleu ) ;
    imagestring($image, $taille, $x1+97, $y1-10, $n_ins,$bleu);
    $texte3=$moy_an;
    $y2=279;
    $x2=143;
    if ($an==1){$term="ére";}else{$term="éme";}
    imagestring($image, $taille, $x2+137, $y2-19, $an.$term,$bleu);
    $y2=295;
    imagestring($image, $taille, $x2+95, $y2-17, $texte3,$bleu);
    imagestring($image, $taille, $x2+314, $y2-17, $crd_an,$bleu);
    line 64:imagejpeg($image, "certi" .$n_ins.".jpg");
    echo "<table cellpadding='0' cellspacing='0' ><tr valign='top'><td valign='top'>
     <img src='certi".$n_ins.".jpg'></td></tr></table>";
    imagedestroy($image);
    ?>
    et voici l'erreure
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Warning: imagejpeg(): Unable to open 'certi05/03/27/00177.jpg' for writing in c:\program files\easyphp1-8\www\note1\admin\attestation1.php on line 64

  2. #2
    Nouveau Candidat au Club
    Inscrit en
    Novembre 2005
    Messages
    1
    Détails du profil
    Informations forums :
    Inscription : Novembre 2005
    Messages : 1
    Points : 1
    Points
    1
    Par défaut j fait un petit changement
    [QUOTE=nerazzurri;2520601]voisi mon code
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
     
    <?
    header("Content-type: image/jpeg");
    	echo "<body onLoad='window.print()' leftmargin='0' topmargin='0'>";
    $n_ins = $_GET["n_ins"] ;
    $nom = $_GET["nom"] ;
    $prenom = $_GET["prenom"] ;
    $an= $_GET["an"] ;
    $moy_an = $_GET["moy_an"] ;
    $crd_an= $_GET["crd_an"] ;
    $anuni= $_GET["anuni"] ;
    $lieun= $_GET["lieun"] ;
    $daten= $_GET["daten"] ;
    $fond="certif.jpg";
    $image = imagecreatefromjpeg($fond);
    $image=imagecreate(700,460);
    $blanc = imagecolorallocate($image, 255, 255, 255);
    $noir = imagecolorallocate($image, 0, 0, 0);
    $bleu = imagecolorallocate($image, 0, 0, 255); 
    $data_fond=getimagesize($fond);
    /* 	0 pour la largeur
    	1 pour la hauteur
    	2 pour le type 1=gif 2=jpg 3=png
    	3 pour la chaine complete "height=xxx width=yyy"  */         
    	$fondtoload=imagecreatefromjpeg($fond);
    $larg=$data_fond[0];
    $haut=$data_fond[1];
    $x=700;
    $y=($x*$haut)/$larg;
    if ($y>$x) { $y=$x; $x=($y*$larg)/$haut; }
    $posx=(100-$x)/2;
    $posy=(100-$y)/2;
    imagecopyresized($image, $fondtoload, 0, 0, 0, 0, 700, 460, $data_fond[0], $data_fond[1]);
    $texte=$nom;
    $texte6=$prenom;
    $lentexte=strlen($texte);
    $hp=50;
    $y0=235;
    $x0=168;
    $lentexte=$lentexte+$hp;
    $lentexte=$lentexte+$x0;
    if (((700-$texte)/2) < 0)
    { //$police=$police-1;
    }
    $taille=12;
    //$date=date("d-m-Y");
    $anuni2=$anuni+1;
    imagestring( $image, $taille, 535, $y0-64, $anuni."/".$anuni2, $bleu ) ;
    imagestring($image, $taille, $x0+22, $y0-29, $texte,$bleu);
    imagestring($image, $taille, $lentexte+100, $y0-29, $texte6,$bleu);
    $texte2=$daten;
    $y1=252;
    $x1=168;
    imagestring($image, $taille, $x1+22, $y1-28, $texte2,$bleu);
    imagestring( $image, $taille,$x1+162, $y1-28, $lieun, $bleu ) ;
    imagestring($image, $taille, $x1+97, $y1-10, $n_ins,$bleu);
    $texte3=$moy_an;
    $y2=279;
    $x2=143;
    if ($an==1){$term="ére";}else{$term="éme";}
    imagestring($image, $taille, $x2+137, $y2-19, $an.$term,$bleu);
    $y2=295;
    imagestring($image, $taille, $x2+95, $y2-17, $texte3,$bleu);
    imagestring($image, $taille, $x2+314, $y2-17, $crd_an,$bleu);
    line 64:imagejpeg($image, "certi" .$nom .".jpg");
    echo "<table cellpadding='0' cellspacing='0' ><tr valign='top'><td valign='top'>
     <img src='certi".$n_ins.".jpg'></td></tr></table>";
    imagedestroy($image);
    ?>
    dant la ligne 64 j changer n_ins avec nom_et il n'afiche pas l'erreure il sauvegarder l'image me elle ce safiche pas je c pas comment fair les amis
    aide moi

Discussions similaires

  1. [ImageMagick] Cherche à faire une image avec texte et image
    Par dnipro dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 18/05/2006, 14h08
  2. [ImageMagick] Redimension d'une image
    Par Shin_RockmanX dans le forum Bibliothèques et frameworks
    Réponses: 4
    Dernier message: 24/04/2006, 21h17
  3. [ImageMagick] Affichage d'une image png
    Par JavaAcro dans le forum Bibliothèques et frameworks
    Réponses: 15
    Dernier message: 06/02/2006, 09h13
  4. [ImageMagick] Création d'une image miniature
    Par popeye82 dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 01/02/2006, 20h10
  5. [ImageMagick] Comment générer une image d'un code à entrer ?
    Par MiJack dans le forum Bibliothèques et frameworks
    Réponses: 5
    Dernier message: 16/01/2005, 21h29

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo