ngx-image-cropper
ngx-image-cropper copied to clipboard
base 64 output is empty
when i tried to get event output from imageCropped(event:ImageCroppedEvent){ // if I take bloob its fine working good but when I tried to get base 64 it didn't give any output console.log(event.blob) // working fine console.log(event.base64) // returning empty data
}
Did you set the output to base64? By default it's set to blob because it has better performance.
yes i did and it worked but it should be in document
I'm actually facing the same problem, commenting here awaiting for the fix, now I'm at work but as I get home gonna try to find the error
GN guys, hope you're well, I've just the code and found how to make it work for base64, I made it goes fine at work today and tried on the demo-app and worked, it seems to have a problem on cropper when the return type is base64 (but at work worked fine) so this is how to make it run
as you can see the 'this.imageCropper.crop("base64")' need to be setted somewhere, at work I applied to a button click function inside a modal, so when you hit the apply button it saves, but here at demo-project it did not work so well.
Hope it helped :D
https://github.com/Mawi137/ngx-image-cropper/releases/tag/7.0.0
simply add
output="base64"
to the<image-cropper>
tag.
<image-cropper output="base64"></image-cropper>
hope it helps someone
You only have to add this parameter in the html component
<image-cropper
output="base64"
>
</image-cropper>