salut à tous,
un truc tout bête pour vous mais un casse tête pour moi,
en faîte mon code fonctionne tel quel mais si je veux redimentionner une image qui est dans un repertoire spécifique genre "$oldname = "photo/cravatte3.jpg";" il me genère une erreur , normal car la variable veux un nom mais en même temps elle ne trouve pas le fichier....comment lui dire d'aller chercher une image dans un repertoire particulier??????
/////////////mon code//////////////////////
$oldname = "cravatte3.jpg";
$newname = "thumb.".$oldname;
$newh = 240;
// interpolating
$size = getImageSize($oldname);
$w = $size[0];
$h = $size[1];
$neww = intval($newh * $w / $h);
echo "Previous: $w x $h \n";
echo "Now: $neww x $newh \n";
// converting
$resimage = imagecreatefromjpeg($oldname);
$newimage = imagecreatetruecolor($neww, $newh); // use alternate function if not installed
imageCopyResampled($newimage, $resimage,0,0,0,0,$neww, $newh, $w, $h);
// saving
imageJpeg($newimage, 'photomini/'.$newname, 85);
////////////////////////////////////////////////////////////////fin/////////////////////////////////////////////////////////////////
merci à tous!