Тема: Обрезла аватара на дцмс 644 (WAP/WEB мастеру/Помощь мастерам) CuCTEMA_CEPBEPA (8 Sep 2014 в 10:47) width и height используй. mcerebas (8 Sep 2014 в 12:32) CuCTEMA_CEPBEPA, у меня они не обрезают аватар а умешают сяс дам код, может там гдето запрет. mcerebas (8 Sep 2014 в 12:44) Так не обрезает фото, а сжимает. echo \" <a href=\'/ank.php\'><img style=\'vertical-align: middle; padding: px; width: 50px; height: 50px;\' src=\'/foto/foto48/$foto[id].$foto[ras]\' alt=\'$foto[name]\' alt=\'naSIMbe.ru\' \'></a>\"; CuCTEMA_CEPBEPA (8 Sep 2014 в 17:37) mcerebas, непонимаю каким образом тебе её обрезать нада? mcerebas (8 Sep 2014 в 23:18) CuCTEMA_CEPBEPA, зайди на мой сайт и глянь, там не правильное отображе, фото двух варинтол, вертиканое и горизонтальное. Но мне надо, что бы у них виризался на кладрат определеного размера, а не с жималось. Engine (8 Sep 2014 в 23:26) Это называется кроп изображений. В интернете куча готовых вариантов есть mcerebas (9 Sep 2014 в 06:29) Engine, я не нашол. Engine (9 Sep 2014 в 15:44) http://yandex.ru/msearch?text=crop+%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F+&clid=2083694 mcerebas (9 Sep 2014 в 19:52) --Цитата-- Engine (9 Sep 2014 в 15:44): http://yandex.ru/msearch?text=crop+%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D1%8F+&clid=2083694 ---------- Engine, нашол, один мне понравиля очень простой, но как теперь эти функции вызвать в аватор? mcerebas (9 Sep 2014 в 19:53) <?php // Original image $filename = \'photo.jpg\'; //die(print_r($_POST)); $new_filename = \'photo1.jpg\'; // Get dimensions of the original image list($current_width, $current_height) = getimagesize($filename); // The x and y coordinates on the original image where we // will begin cropping the image, taken from the form $x1 = $_POST[\'x1\']; $y1 = $_POST[\'y1\']; $x2 = $_POST[\'x2\']; $y2 = $_POST[\'y2\']; $w = $_POST[\'w\']; $h = $_POST[\'h\']; //die(print_r($_POST)); // This will be the final size of the image $crop_width = 100; $crop_height = 100; // Create our small image $new = imagecreatetruecolor($crop_width, $crop_height); // Create original image $current_image = imagecreatefromjpeg($filename); // resamling (actual cropping) imagecopyresampled($new, $current_image, 0, 0, $x1, $y1, $crop_width, $crop_height, $w, $h); // creating our new image imagejpeg($new, $new_filename, 95); ?> Источник: http://www.dcms-social.ru/forum/20/44/54319/