Forum » » Le coin des codeurs » » Fonction de création d'image
Posté : 21 oct. 2004 à 16:02
<?php
$adresseimage = $the_path.$nom_img;
list($width, $height, $type, $attr) = getimagesize($adresseimage);
$new_height = 85;
$coef_reduc=$new_height/$height;
$coef_reduc=ceil($coef_reduc);//arrondit coef
$new_width=$width*$coef_reduc;
$miniature = imagecreatetruecolor ($new_width, $new_height);
imagecopyresized ($miniature, $adresseimage, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagejpeg ($miniature, "modules/fanart/images/".$nom_img."-mini", 90);
imagedestroy ($miniature);
flush();
?>
Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=13957&forum=5