Possibility for variable aspect ratio locking (i.e. min + max aspect ratio)?
See original GitHub issueHi there, thanks so much for this library! Just threw it into a project and got up and running nice and easily (just had to tweak some CSS things to ensure vertical images don’t overflow the cropping area).
I have a use case I’d like to implement somehow. For example, I want to allow people to add poster images to my app - in this case, a poster can be of multiple sizes, as some countries / cinemas choose to use a slightly different aspect ratio for their posters. It’s not major differences, but the differences do exist. I’d like to allow cropping between the minimum aspect ratio and the maximum aspect ratio within those sizes.
My aspect ratios might look like this:
{
minAspect: 0.66,
maxAspect: 0.75,
}
I think this is not currently possible with react-image-crop
. Is this something you think could be implemented? I’m happy to try take a look at it myself as well and make a PR.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (2 by maintainers)
I was able to get this working by changing my onChange to this:
Cool maybe I’ll incorporate this logic