react-image-cropper icon indicating copy to clipboard operation
react-image-cropper copied to clipboard

crop frame maximum size option

Open rmeissn opened this issue 8 years ago • 5 comments

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?

rmeissn avatar Apr 05 '17 12:04 rmeissn

@rmeissn you can create a PR.

flyfloor avatar Apr 06 '17 04:04 flyfloor

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?

rmeissn avatar Apr 06 '17 08:04 rmeissn

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

flyfloor avatar Apr 06 '17 12:04 flyfloor

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

flyfloor avatar Apr 12 '17 07:04 flyfloor

@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" />

supromikali avatar Jan 18 '18 12:01 supromikali