2

In filestack v2 I was able to force users to crop an image after they uploaded it using the 'cropForce' attribute like this:

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

    }
);

However in filestack V3 there is no more option to do this?

Werner Bihl
  • 196
  • 2
  • 7

3 Answers3

3

This answer is most definitely a bit late in the game for you. I believe the features you required were released in July 2017.

For other people trying to figure this out, the V3 equivalent to what you're trying to achieve:

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

For reference to forcing cropping see:

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

Allan of Sydney
  • 1,410
  • 14
  • 23
2

Force crop is a feature that is presently in the development pipeline for V3 and should be available for users in the near future.

-1

Force Crop is available by setting

transformations: { crop: true }

in the .pick() function.

  • Hey @Flutterby_Dev, this doesn't seem to force cropping, rather it allows the user to use the transform in the picker widget. Ref: https://filestack.github.io/filestack-js/interfaces/pickeroptions.html#transformations – Allan of Sydney Jul 05 '18 at 23:46