Add support for specifying min and max aspect ratio values for cropping
This PR tries to add a functionality that allows users to specify a minimum and maximum range for aspect ratio. This can be useful when you want to allow a varying number of crop aspect ratios. It uses a listener on a CropperJs instance to determine the crop box. I have still kept the existing vue-cropperjs implementation and that is preferred when the user wants a crop of a fixed aspect ratio. It also allows for cropping outside the bounds of the image. The empty space is filled a white (#ffffff) color.
Usage
AdvancedImage::make('Logo', 'logo')->croppable(1); // square crop 1:1
AdvancedImage::make('Logo', 'logo')->croppable(16 / 9); // 16:9 crop ratio
AdvancedImage::make('Logo', 'logo')->croppable(1, 2); // allowed crop ratios are from 1 (1:1) to 2 (2:1)
Add support for specifying min and max aspect ratio values for cropping
This PR tries to add a functionality that allows users to specify a minimum and maximum range for aspect ratio. This can be useful when you want to allow a varying number of crop aspect ratios. It uses a listener on a
CropperJs
instance to determine the crop box. I have still kept the existingvue-cropperjs
implementation and that is preferred when the user wants a crop of a fixed aspect ratio. It also allows for cropping outside the bounds of the image. The empty space is filled a white (#ffffff
) color.Usage