-1

jQuery トリミング プラグインを使用して、フォームから送信された画像をトリミングしています。私は次のものを持っています。しかし、どうすれば目的の画像へのパスを見つけることができますか?

$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 に答える