【发布时间】:2016-11-25 23:48:59
【问题描述】:
伙计们,
我正在 ui=sing 此代码上传和裁剪图像。当我把它放在一起时,裁剪的中心就在图像的中间,效果很好!
我想通过添加裁剪选项来增加功能,而不是从顶部、左侧或底部裁剪居中的图像。这将从上一页的单选框中选择。
我看到了一些相当复杂的方法,但想知道是否有一种简单的方法可以实现它,有什么想法吗?谢谢。
$handle->image_resize = true;
$handle->image_ratio_crop = true;
$handle->image_convert = 'jpg';
$handle->image_x = $x;
$handle->image_y = $y;
$handle->jpeg_quality = 75;
$handle->Process( $dir_dest );
来自上一页的表格:
<label for="artwork">Banner Artwork</label>
<div class="input-group upload-crop">
<input class="upload-button" accept="image/jpg,image/png,image/jpeg,image/gif" name="<?=$strNameInput?>" id="<?=$strNameInput?>" type="file" />
<label><strong>Crop from:</strong></label>
<label for="centre">Centre</label><input checked type="radio" id="centre" name="crop" value="centre" />
<label for="right">Right</label><input type="radio" id="right" name="crop" value="right" />
<label for="left">Left</label><input type="radio" id="left" name="crop" value="left" />
<label for="top">Top</label><input type="radio" id="top" name="crop" value="top" />
<label for="bottom">Bottom</label><input type="radio" id="bottom" name="crop" value="bottom" />
</div>
【问题讨论】: