21,886
社区成员
发帖
与我相关
我的任务
分享
$path = $_GET['path'];
$x = $_GET['x'];
$y = $_GET['y'];
$width = intval($_GET['width']);
$height = intval($_GET['height']);
list($owidth,$oheight) = getimagesize($path);
$n_image = imagecreatetruecolor($width,$height);
//$n_image = imagecreate($width,$height);
//$image = imagecreatefromjpeg($path);
$image = imagecreatefromjpeg("test1.jpg");
//imagecopyresampled($n_image,$image,0,0,$x,$y,$owidth,$oheight,$owidth,$oheight);
imagecopyresized($n_image,$image,0,0,$x,$y,$owidth,$oheight,$owidth,$oheight);
imagejpeg($n_image,'1.jpg',100);
echo $image.'<img src="./1.jpg"/>';