具体如下:
代码如下:
$image_file = $_GET["src"];
$corner_radius = isset($_GET["radius"]) ? $_GET["radius"] : 20; // The default corner radius is set to 20px
$topleft = (isset($_GET["topleft"]) and $_GET["topleft"] == "no") ? false : true; // Top-left rounded corner is shown by default
$bottomleft = (isset($_GET["bottomleft"]) and $_GET["bottomleft"] == "no") ? false : true; // Bottom-left rounded corner is shown by default
$bottomright = (isset($_GET["bottomright"]) and $_GET["bottomright"] == "no") ? false : true; // Bottom-right rounded corner is shown by default
$topright = (isset($_GET["topright"]) and $_GET["topright"] == "no") ? false : true; // Top-right rounded corner is shown by default
$imagetype=strtolower($_GET["imagetype"]);
$backcolor=$_GET["backcolor"];
$endsize=$corner_radius;
$startsize=$endsize*3-1;
$arcsize=$startsize*2+1;
if (($imagetype=="jpeg") or ($imagetype=="jpg")) {
$image = imagecreatefromjpeg($image_file);
} else {
if (($imagetype=="GIF") or ($imagetype=="gif")) {
$image = imagecreatefromgif($image_file);
} else {
$image = imagecreatefrompng($image_file);
}
}