【发布时间】:2016-01-04 20:58:17
【问题描述】:
我使用 JCrop 使用从该网站获得的代码裁剪图像: http://deepliquid.com/content/Jcrop_Implementation_Theory.html
php代码:
$targ_w = $targ_h = 150;
$jpeg_quality = 90;
$img_r = imagecreatefromjpeg($_FILES['afile']['tmp_name']);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'],
$targ_w,$targ_h,$_POST['w'],$_POST['h']);
header('Content-type: image/jpeg');
imagejpeg($dst_r, null, $jpeg_quality);
php 所做的基本上是将裁剪后的图像打印到屏幕上。
但是,我想将此图像存储在我的服务器上的uploads 文件中。通常我会使用move_uploaded_file(),但在这个特定的例子中,我不确定要为move_uploaded_file() 提供什么参数值。有人能指出我正确的方向吗?
【问题讨论】: