Просмотр поста

.
Iron_Man
Добавлено: 03.12.2018 / 18:54
kantry,
$nameimg = $id . '.' . $ext[1];

            function create_img($name_big, $name_small, $xs, $ys) {
                list($x, $y, $t, $attr) = getimagesize($name_big);

                if ($t == IMAGETYPE_GIF)
                    $big = imagecreatefromgif($name_big);
                else
                    if ($t == IMAGETYPE_JPEG)
                        $big = imagecreatefromjpeg($name_big);
                    else
                        if ($t == IMAGETYPE_PNG)
                            $big = imagecreatefrompng($name_big);
                        else
                            return;

               $small = imagecreatetruecolor($xs, $ys);

 

imagesavealpha($small, true);

 

$trans_colour = imagecolorallocatealpha($small, 0, 0, 0, 127);

imagefill($small, 0, 0, $trans_colour);

 

$red = imagecolorallocate($small, 255, 0, 0);

imagefilledellipse($small, 400, 300, 400, 300, $red);

 

$res = imagecopyresampled($small, $big, 0, 0, 0, 0, $xs, $ys, $x, $y);

imagedestroy($big);

imagepng($small, $name_small);

imagedestroy($small);

            

            create_img('' . $_FILES["filename"]["tmp_name"] . '', 'logo/big' . $nameimg, 110,
                70);
            create_img('' . $_FILES["filename"]["tmp_name"] . '', 'logo/small' . $nameimg,
                15, 15);
            echo '<br/><br/><img src="logo/' . $nameimg . '" alt=""/>Готово ';
            mysql_query("update `m_team` set `logo`='" . $nameimg . "' where id='" . $id .
                "';");
            break;


Что не так

Добавлено: 03.12.2018 / 19:07
imagedestroy($small);
}

Так тоже пробовал