Closed Zyostes closed 6 years ago
Restrict the width and height of the crop box doesn't make sense. Why not just resize the cropped image to your wanted sizes after cropped?
var width = 340;
var height = 340;
var cropImage = $('.crop-image:visible');
cropImage.cropper({
aspectRatio: width/height,
viewMode: 1,
preview: '.preview-image',
}).on('ready', function() {
// Resize the cropped image to 340x340
cropImage.cropper('getCroppedCanvas', {
width: width,
height: height,
});
});
I actually have this configuration :
I am trying to prevent zoom in when width or height is reached but with this code, when zoom stops, the data width/height is 317, it stops too late.
Thank you per advance.