So i am sending an image file over a socket, I encode the file as base64 before sending it.
Sending the image:
const img = cv.imencode('.jpg', frame).toString('base64');
ws.send(img);
Now on the other side of the socket, when I receive the image and try to display it, the image seems to be broken. Does anyone know what I need to do to convert it back to a regular image file (jpg, jpeg, etc)?
Receiving the image:
incomingImage = event.data.toString('base64');
IMAGE_SAMPLES.push(incomingImage);