Je débute avec GD,
Je voudrais savoir quelle fonction est la plus efficace pour redimensionner une image jpg.
// 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);