-1

我正在裁剪通过带有 jQ​​uery 裁剪插件的表单提交的图像。我有以下。但是,我怎样才能找到目标图像的路径?

$pic = $this->input->post('pic');

//Get the coordinates from the image crop
$x = $this->input->post('x');
$y = $this->input->post('y');
$w = $this->input->post('w');
$h = $this->input->post('h');

$src = imagecreatefromjpeg($pic);
$dest = ImageCreateTrueColor($w, $h);

imagecopy($dest, $src, $x, $y, $x, $y, $w, $h);
4

1 回答 1

1

您只需要声明路径。

imagejpeg($dest, '/path/to/save.jpg', 90);

或较小的图像

imagepng($dest, '/path/to/save.jpg', 9);
于 2013-12-03T15:13:00.010 回答