ngx-image-cropper icon indicating copy to clipboard operation
ngx-image-cropper copied to clipboard

base 64 output is empty

Open subhajitwiner opened this issue 1 year ago • 5 comments

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

}

subhajitwiner avatar Dec 07 '23 13:12 subhajitwiner

Did you set the output to base64? By default it's set to blob because it has better performance.

Mawi137 avatar Jan 04 '24 16:01 Mawi137

yes i did and it worked but it should be in document

subhajitwiner avatar Jan 15 '24 19:01 subhajitwiner

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

edubaldin13 avatar Jan 15 '24 19:01 edubaldin13

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 image 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

edubaldin13 avatar Jan 16 '24 03:01 edubaldin13

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

komendantaa avatar Mar 26 '24 23:03 komendantaa

You only have to add this parameter in the html component

  <image-cropper
  output="base64"
  >
   </image-cropper>

Hansel03 avatar Apr 24 '24 19:04 Hansel03