Am o functie care face resize la niste imagini. Ea arata cam asa:
si este apelata in felul urmator:Cod:function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth, $newName) { $srcImg = imagecreatefromjpeg("$imageDirectory/$imageName"); $origWidth = imagesx($srcImg); $origHeight = imagesy($srcImg); $ratio = $origWidth / $thumbWidth; $thumbHeight = ceil($origHeight / $ratio); $thumbImg = imagecreatetruecolor($thumbWidth, $thumbHeight); imagecopyresized($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $origWidth, $origHeight); imagejpeg($thumbImg, "$thumbDirectory/$newName", 100); }
Intrebarea ar fi de ce pozele micsorate nu sunt clare ?Cod:createThumbnail("poze", "$poza_mare", "poze", 300, "$poza_mare");



Răspunde cu citat
