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; |
Partager