Daiver2

Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору arcanum и censssored ок, показываю... Как сделать превьюшку картинки из галлереи квадратную без потери пропорции правим thumb.php в блоке switch($_REQUEST['smode']){ ... } добавляем код Код: case 4 : $thumb_w = 120; $thumb_h = 120; break; | ниже, вместо Код: if(GALLERYTHUMB_METHOD == "imagecopyresampled") { @imagecopyresampled($ziel, $quelle, 0, 0, 0, 0, $w, $h, imagesx($quelle), imagesy($quelle)); } else { @imagecopyresized($ziel, $quelle, 0, 0, 0, 0, $w, $h, imagesx($quelle), imagesy($quelle)); } | ставим Код: if ($_REQUEST['smode'] == 4) { $width = $thumb_w; $height = $thumb_h; list($width_orig, $height_orig) = getimagesize($q); $image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($q); if ($width_orig>$height_orig) @imagecopyresized($image_p, $image, 0, 0, round((max($width_orig,$height_orig)-min($width_orig,$height_orig))/2), 0, $width, $width, min($width_orig,$height_orig), min($width_orig,$height_orig)); if ($width_orig<$height_orig) @imagecopyresized($image_p, $image, 0, 0, 0, 0, $width, $width, min($width_orig,$height_orig), min($width_orig,$height_orig)); if ($width_orig==$height_orig) @imagecopyresized($image_p, $image, 0, 0, 0, 0, $width, $width, $width_orig, $width_orig); $ziel=$image_p; } else { if(GALLERYTHUMB_METHOD == "imagecopyresampled") { @imagecopyresampled($ziel, $quelle, 0, 0, 0, 0, $w, $h, imagesx($quelle), imagesy($quelle)); } else { @imagecopyresized($ziel, $quelle, 0, 0, 0, 0, $w, $h, imagesx($quelle), imagesy($quelle)); } } | и теперь при вызове <img border=0 src="system/thumb.php?img_id=".$row->id."&smode=4"></a> будет показываться требуемая превьюшка |