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 22/02/2006, 08h45   #1
Candidat au titre de Membre du Club
 
Inscription : mai 2005
Messages : 42
Détails du profil
Informations forums :
Inscription : mai 2005
Messages : 42
Points : 11
Points : 11
Par défaut [ImageMagick] Enregistrer l'image redimensionnée

Bonjour bonjour,

J'ai recupéré une fonction sur le net qui me sert à redimensionner une image. Seulement, il y a un soucis. L'image que j'affiche dans mon navigateur est à la bonne taille mais je souhaite l'enregistrer dans un dossier bien précis... Seulement, je ne sais pas comme faire. QQun pourrait-il m'éclairer ??? Merci beaucoup!!

Voilà 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
 
$filename = 'colombier_plan_rez_E1.gif';
 
// Définition de la largeur et de la hauteur maximale
$width = 120;
$height = 90;
 
// Content type
header('Content-type: image/gif');
 
// Cacul des nouvelles dimensions
list($width_orig, $height_orig) = getimagesize($filename);
 
if ($width && ($width_orig < $height_orig)) {
   $width = ($height / $height_orig) * $width_orig;
} else {
   $height = ($width / $width_orig) * $height_orig;
}
 
// Redimensionnement
$image_p= 
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromgif($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
 
// Affichage
$test=imagegif($image_p, null, 100);
echo $test;
J'ai déjà essayer un copy... mais rien n'y fait!

Merci d'avance!!!
tilou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/02/2006, 08h57   #2
Membre habitué
 
Inscription : août 2005
Messages : 142
Détails du profil
Informations forums :
Inscription : août 2005
Messages : 142
Points : 124
Points : 124
Slt
enleve le header('Content-type: image/gif');
et à la fin de ton script fait
imagegif( $image_p, '/mondossier/nomfichier.gif' );
zulkifli 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 14h57.


 
 
 
 
Partenaires

Hébergement Web