mosch / react-avatar-editor

Small avatar & profile picture component. Resize and crop uploaded images using a intuitive user interface.
https://react-avatar-editor.netlify.app/
MIT License
2.35k stars 369 forks source link

How to get the cropped image client-side? #419

Open anshul-kai opened 2 weeks ago

anshul-kai commented 2 weeks ago

getImage returns the original image ignoring scale and crop/position.

getImageScaledToCanvas returns the original image scaled down to the canvas dimensions, again ignoring both scale and crop/position.

I'm working through a hacky approach to generate the cropped image client-side. Isn't there an easy way to provide this via the current API?

anshul-kai commented 2 weeks ago

For anything beyond a baseline use case, use react-advanced-cropper.

This library is full of bugs if advanced features like scaling or cropping are used.