par
stakanof » 04 déc. 2007, 13:20
ok merci
ce script marche bien:
Par contre comment dois je faire pour copier la photo générée dans un répertoire ?
// This sets it to a .jpg, but you can change this to png or gif
header('Content-type: image/jpeg');
//-----------------
//Start Thumbnail script
//marc.jpg étant la photo origine
$image = imagecreatefromjpeg('marc.jpg');
//This will set our output to 50% of the original size
$size = 0.50;
// Setting the resize parameters
list($width, $height) = getimagesize('marc.jpg'); // retourne un array --> list // presentation
$modwidth = $width * $size; //largeur finale
$modheight = $height * $size; // hauteur finale
// Resizing the Image
$tn = imagecreatetruecolor($modwidth, $modheight);
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
//------------------
imagejpeg($tn, null, 70); //notice we set the quality (third value)
imageDestroy($tn);
ok merci
ce script marche bien:
Par contre comment dois je faire pour copier la photo générée dans un répertoire ?
[php]
// This sets it to a .jpg, but you can change this to png or gif
header('Content-type: image/jpeg');
//-----------------
//Start Thumbnail script
//marc.jpg étant la photo origine
$image = imagecreatefromjpeg('marc.jpg');
//This will set our output to 50% of the original size
$size = 0.50;
// Setting the resize parameters
list($width, $height) = getimagesize('marc.jpg'); // retourne un array --> list // presentation
$modwidth = $width * $size; //largeur finale
$modheight = $height * $size; // hauteur finale
// Resizing the Image
$tn = imagecreatetruecolor($modwidth, $modheight);
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
//------------------
imagejpeg($tn, null, 70); //notice we set the quality (third value)
imageDestroy($tn);
[/php]