Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crop frame maximum size option #6

Open
rmeissn opened this issue Apr 5, 2017 · 5 comments
Open

crop frame maximum size option #6

rmeissn opened this issue Apr 5, 2017 · 5 comments

Comments

@rmeissn
Copy link

rmeissn commented Apr 5, 2017

Thank you @jerryshew for this nice and useful library!

A nice addition would be to offer an option to size the crop frame to the maximum possible size by default (respecting any ratio settings). This is currently not possible, unless I calculate the width and height myself by reimplementing some of your code outside of your library and later setting width and height for the cropper manually via the offered properties.

This could be implemented by: <cropper ... width='100%' height='100%' rate={1}> for a square cropped picture.

Or is there a workaround to achieve this feature, I haven't discovered yet?

@flyfloor
Copy link
Owner

flyfloor commented Apr 6, 2017

@rmeissn you can create a PR.

@rmeissn
Copy link
Author

rmeissn commented Apr 6, 2017

I tried to read through your code, but I'm still a bit confused about the exact meaning of some variables you use. Could you add some explaining comments or change the name of some variables to more descriptive ones?

@flyfloor
Copy link
Owner

flyfloor commented Apr 6, 2017

@rmeissn ok, i will add comments and update README, but you have to wait because recently very busy.

@flyfloor
Copy link
Owner

@rmeissn ok,add some comments, maximum size not intent to do, you can set width and height instand.

@supromikali
Copy link

@rmeissn @jerryshew Found some workaround that works just fine for me: if you set width and height to a large number that is always greater than image container, you automatically achieve max-width / max-height, for example, I set it to 999 like so:

<Cropper width={999} height={999} src={cropSrc} ref="cropper" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants