【问题标题】:Getting coordinates of the cropped image in Cropie在 Cropie 中获取裁剪图像的坐标
【发布时间】:2020-02-25 10:41:45
【问题描述】:

使用 Cropie,我可以成功裁剪上传的图像并保存为 base64。我知道如何将 base64 数据保存为后端的新文件。

我想知道的是,有没有办法得到裁剪的area (x1, y1, x2, y2),这样我就可以上传原始图像而不是裁剪的 base64 并在后端使用 imagemagick 完成裁剪。

参考example code here:

$('#upload').on('change', function () {
    readFile(this);
});
$('.upload-result').on('click', function (ev) {
    $uploadCrop.croppie('result', {
        type: 'canvas',
        size: 'original'
    }).then(function (resp) {
        $('#imagebase64').val(resp);
        $('#form').submit();
    });
});

【问题讨论】:

    标签: javascript crop


    【解决方案1】:

    我放弃了,搬到了 Cropper。答案是 Croppie 不适合做这件事。

    【讨论】:

      猜你喜欢
      • 2013-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-02
      • 2016-07-10
      • 2016-11-29
      • 2015-08-18
      • 2016-12-09
      相关资源
      最近更新 更多