[Question] How can I crop a rounded image?
revington opened this issue · 4 comments
revington commented
Agontuk commented
You can checkout the source code here https://github.com/fengyuanchen/cropperjs/blob/master/docs/examples/crop-a-round-image.html
revington commented
Hey @Agontuk that is the same example I have submitted. My question is about how to do it with vue-cropperjs
Agontuk commented
Not sure what you're asking, vue-cropperjs is the same as cropperjs. Just use the same code used in the example
- use getCroppedCanvas to get the cropped area
- copy & use
getRoundedCanvas
function to get rounded image from cropped canvas - use
toDataURL
to get the base64 image.
FrenchGithubUser commented
Hi ! I saw the example code for cropperjs.
However, what I'd like to do would be to have a rounded preview (like in the example) and a squared crop. Is there a way to do that ?