I have the following image:
<img id="preview" class="cropped rounded-circle align-center animated fadeIn" width="220px" height="220px">
I need to pass it to a function that will convert to base 64, but to convert to base 64, my image must be in blob before: What I've tried:
handleCropSelect(){
var file = document.getElementById("preview")
var reader = new FileReader();
reader.onload = this._handleReaderLoaded.bind(this);
reader.readAsBinaryString(file);
}
What I get:
Argument of type 'HTMLElement' is not assignable to parameter of type 'Blob'. Property 'size' is missing in type 'HTMLElement'.