I'm trying to snap a photo (insurance card), save it locally, and retrieve it later.
I've managed to save the binary to localStorage
code
var policy_shot = localStorage.getItem( 'elephant' );
console.log( policy_shot );
$('#TestScreen_mobileimage_1').crossOrigin = 'anonymous';
console.log(policy_shot.length);
$('#TestScreen_mobileimage_1').src = policy_shot ;
/code
The console logs a binary; binary renders properly when pasted in a fresh browser tab:
code
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABALDA4
/code
And policy_shot.length logs at: 20203
But no image displays in the test. ( renders src="files/resources/image/no-image.jpg" )
Thanks, Ed