Skip to content

Is it possible to control how much vertical space is left between the crop selection region and the inactive area? #530

Discussion options

You must be logged in to vote

You need to compute the aspect ratio of the image selected by the user and then modify the Cropper container to have this ratio. Indeed, the cropper just fills its parent so it's the parent component responsibility to have the right dimensions.

If your user is selecting the image from disk, you can get inspiration from this example to learn how to read the image.
Otherwise, you can use the onMediaLoaded prop to get the image dimensions once it's loaded to then compute the aspect ratio.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ValentinH
Comment options

Answer selected by KevinJHall-Launchpad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants