我使用Image Cropper(here official site),我的裁剪结果不是方形图像。如下图所示:
作品选择
CROP RESULT
这是我的HTML:
<input type="hidden" name="dataX" id="dataX">
<input type="hidden" name="dataY" id="dataY">
<input type="hidden" name="dataHeight" id="dataHeight">
<input type="hidden" name="dataWidth" id="dataWidth">
和我的jquery:
var $image = $(".dynamic-image img"),
$dataX = $("#dataX"),
$dataY = $("#dataY"),
$dataHeight = $("#dataHeight"),
$dataWidth = $("#dataWidth");
$image.cropper({
aspectRatio: 1,
minContainerWidth:760,
minContainerHeight:350,
done: function(data) {
$dataX.val(data.x);
$dataY.val(data.y);
$dataHeight.val(data.height);
$dataWidth.val(data.width);
}
});
* sory for my english:)