Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > Images > Imagick
Imagick Forum d'entraide pour l'extension Imagick permettant de manipuler des images en PHP (port de l'API ImageMagick).
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 23/09/2007, 17h47   #1
Invité de passage
 
Inscription : mai 2007
Messages : 17
Détails du profil
Informations forums :
Inscription : mai 2007
Messages : 17
Points : 1
Points : 1
Par défaut [ImageMagick] problème avec l'appel d'une image ?

voisi mon code
Code :
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 :
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
nerazzurri est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 30/09/2007, 12h58   #2
Invité de passage
 
Inscription : novembre 2005
Messages : 1
Détails du profil
Informations forums :
Inscription : novembre 2005
Messages : 1
Points : 1
Points : 1
Envoyer un message via Yahoo à nerazzurro
Par défaut j fait un petit changement

[QUOTE=nerazzurri;2520601]voisi mon code
Code :
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
nerazzurro est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 23h51.


 
 
 
 
Partenaires

Hébergement Web