【问题标题】:How to force users to crop an image in Filestack V3如何强制用户在 Filestack V3 中裁剪图像
【发布时间】:2017-03-23 07:41:02
【问题描述】:

在 filestack v2 中,我可以强制用户在上传图片后使用 'cropForce' 属性对其进行裁剪,如下所示:

filepicker.pick(
    {
    mimetype: 'image/*',
    cropForce: true,
    cropRatio: 8/2.5,
    conversions: ['crop'],
    services: ['CONVERT','COMPUTER','INSTAGRAM','URL','FACEBOOK','GOOGLE_DRIVE','IMAGE_SEARCH']
    }, function(response){

    }
);

但是在 filestack V3 中没有更多的选项可以做到这一点?

【问题讨论】:

    标签: filepicker.io


    【解决方案1】:

    强制裁剪是目前 V3 开发管道中的一项功能,应该在不久的将来可供用户使用。

    【讨论】:

      【解决方案2】:

      这个答案对你来说肯定有点晚了。我相信您需要的功能已于 2017 年 7 月发布。

      对于其他试图弄清楚这一点的人来说,V3 相当于你想要实现的目标:

      pickerOptions = {
        accept: 'image/*',
        transformations: {
          crop: {
            aspectRatio: 8/2.5,
            force: true
          }
        },
        fromSources: ['local_file_system', 'instagram', 'url', 'facebook', 'googledrive', 'imagesearch']
      };
      

      有关强制裁剪的参考,请参阅:

      https://filestack.github.io/filestack-js/interfaces/pickeroptions.html#transformations & https://filestack.github.io/filestack-js/interfaces/pickertransformationoptions.html &https://filestack.github.io/filestack-js/interfaces/pickercropoptions.html

      【讨论】:

        【解决方案3】:

        可以通过设置强制裁剪

        transformations: { crop: true }
        

        在 .pick() 函数中。

        【讨论】:

        猜你喜欢
        • 2011-01-01
        • 2015-08-10
        • 1970-01-01
        • 1970-01-01
        • 2015-11-05
        • 2012-03-20
        • 2015-02-02
        相关资源
        最近更新 更多