In developer the data returned is of type {JSMedia} has these characters at the beginning:
- Code: Select all
"data:image/jpeg;base64,/9j/4AA...."
The URI format is data:[<media type>][;base64],<data>
the handler for the capture call back is (where the var is a form var defined as media):
- Code: Select all
function getBase64Data_from_webcam_4(data) {
vf_cam_image = data;
return;
}
I tried to convert it to a byte array:
- Code: Select all
var img_byte_array = utils.base64ToBytes(vf_cam_image)
and get this error message:
exception= java.lang.IllegalArgumentException: Illegal base64 character 3a
The ascii for 3a is the colon (:). I scanned the <data> part and did not find any more.
So does this mean the webcam component is incorrect or is it the utils method that is out of date for JSMedia type?
I am using servoy 2020.12.1 and the latest package: svywebcam (1.0.4)
I have no insight as to how to fix this issue.
Any ideas?
Tom