flyfloor / react-image-cropper

react image crop
https://braavos.me/react-image-cropper/
MIT License
174 stars 56 forks source link

max-height option #5

Open rmeissn opened 7 years ago

rmeissn commented 7 years ago

Thank you @jerryshew for this nice and useful library!

A nice addition would be a max-height option (instead of always sizing the image to the maximum width of the container), in order to limit portrait (e.g. 9:16) pictures from being rendered too huge. The implementation could even provide options for setting this as a pixel size or relative to the window/container size, in order to fit the picture to the screen.

Or is there a workaround that I've missed? The only way I can think of is to limit the container width separately for different pictures by reading picture width and height and to add a width limiting grid in case it's a portrait picture.

I noticed that @Pajn implemented the feature as a fork of your project: https://github.com/Pajn/react-image-cropper/commits/master @Pajn I haven't tested your code yet, but would you be able to issue a PR back to this project, in case your implementation works fine?

flyfloor commented 7 years ago

@rmeissn you can create a PR