【问题标题】:How to crop before uploading with Cloudinary's own widget uploader?如何在使用 Cloudinary 自己的小部件上传器上传之前进行裁剪?
【发布时间】:2019-08-29 23:49:26
【问题描述】:

我正在开发一个使用 Cloudinary's Upload Widget 的应用程序,它可以帮助我上传图像并裁剪它们,但我意识到它实际上并没有在上传之前裁剪图像,但它创建了一个“感兴趣的区域”,这不是什么我正在寻找,因为如果我只需要大图像中的一小块区域,它会上传整个图像(使用 .

有办法吗?我查看了文档,但找不到任何线索。

this.widget = this.cloudinary.createUploadWidget({
      cloudName: "######",
      uploadPreset: "###",
      cropping: true,
      croppingCoordinatesMode: "custom",
      apiKey: "##########",
      uploadSignature: this.generateSignature.bind(this)
    }, (error, result) => {
      console.log(result)
      console.error(error)
    })

我实际上需要在上传之前实际裁剪小部件。

提前谢谢你。

【问题讨论】:

    标签: angular image cloudinary


    【解决方案1】:

    您可以使用预设中的传入转换->上传操作并将裁剪设置为裁剪并将重力设置为自定义。 还要在小部件参数中添加cropping: true ,这应该裁剪图像的选定部分,并且只会上传裁剪的图像。

    【讨论】:

    • 首先,我非常感谢快速响应,我已经将裁剪设置为 true。但是我会尝试在预设设置中设置您所说的内容并返回结果。
    • 工作就像一个魅力!非常感谢!
    猜你喜欢
    • 2021-08-10
    • 1970-01-01
    • 2020-05-26
    • 2019-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-02
    相关资源
    最近更新 更多