I started from Crop Avatar exemple for my app with this configurations
this.$img.cropper({
preview: this.$avatarPreview.selector,
viewMode: 2,
dragMode: 'move',
guides: false,
highlight: false,
autoCropArea: 1,
movable: true,
strict: true,
cropBoxResizable: false,
minCropBoxWidth: 1000,
minCropBoxHeight: 1000,
zoom: function (e) {
if (e.ratio > 1) {
e.preventDefault();
$(this).cropper('zoomTo', 1);
}
},
Using it like this I can zoom to ratio 1 but for smaller images is too much. For example a 1200x1200 image can be zoomed with ratio 1 to a level that saving it to 1000x1000 it loses to much quality.
I tried to go under 1 with $(this).cropper('zoomTo', 1); but it makes a strange effect.If i zoom to much it brings me to the original size.
My question is how can i block the zoom to something like x0.2 or a reasonable value.Thank you
This answer comes from fengyuanchen who developed the cropper and I think fits my need for different resolutions of the cropbox on different devices