Cropper: How to make minCropBoxWidth/minCropBoxHeight relative to image size?

Created on 11 Jun 2015  路  13Comments  路  Source: fengyuanchen/cropper

Using cropper on a image bigger than the container (e.g. max-width:500px on an image 2500px width) is it possible to deny a crop smaller than a defined size?

I'd like to have images cropped to 16/9 aspectRatio and with a minimum width of 960px.

I've tried minCropBoxWidth but it's not relative to image real size.

Most helpful comment

Also had to implement this 'unnecessary' feature myself today. Cheers @pixxelfriend :)

All 13 comments

Please just set the aspectRatio option and resize the cropped image with getCroppedCanvas, or crop and resize the image on the server side.

It's not a problem of crop, that part server side works great, I would like to make impossible to narrow too much the crop rectangle, like it was possible on version 0.7.*

Sorry! We don't support it now as we want to show the whole image by default when initialized.

@endelwar i got the same problem yesterday. My cropped images must not be smaller than 250px in width and height. I found this JSFiddle, this could help you to find the right way: http://jsfiddle.net/dekkard/9r6czo65/12/

Yes @pixxelfriend that's what I'd like to achieve, many thanks!

Would be great if the functionality implemented in example provided by @pixxelfriend was inbuilt in the plugin.

:thumbsup:

I think it is unnecessary to implement this.

:disappointed:

Also had to implement this 'unnecessary' feature myself today. Cheers @pixxelfriend :)

Any update on this?

this is really kind of strange...so many people wanna use this feature (like myself). It would be very kind to make this feature 'necessary' :)

@fengyuanchen Please rethink your stance on this. It's clearly not "unnecessary" when so many people are requesting it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

niklasravnsborg picture niklasravnsborg  路  5Comments

richdenis86 picture richdenis86  路  8Comments

jzahka picture jzahka  路  4Comments

ThameDBA picture ThameDBA  路  4Comments

rajjanorkar picture rajjanorkar  路  4Comments