Skip to content
Advertisement

How to make the cropped image to be square instead of circular in react-avatar-edit

I am using react-avatar-edit to allow a user crop their images before saving to database. It only shows a circular crop thereby making the uploaded images circular but I want to have a rectanglar crop. I can’t seem to find a prop for that in the documentation. Please has anyone achieved that yet?

JavaScript

Screenshot showing the circular preview. I want square one

Advertisement

Answer

Adding exportSize={500} eventually solved it for me like so:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement