I am having some trouble with displaying a binary image in my HTML from a database. First I am getting the image from the db, and then encoding the response as base 64 using the following function:
$scope.frontImage=$window.btoa(unescape(encodeURIComponent(response)));
Then in my html I am passing that into the img tag's source like so:
src="data:image/jpeg;base64,{{frontImage}}"
This, however, is not working. When I inspect the element it only says . The string I am getting from the btoa function looks like this (except obviously much longer):
77+977+977+977+9ABBKRklGAAECAQEsASwAAO+/ve+/vRLvv71FeGlmAABNTQAqAAAACAAHARIAAwAAAAEAAQAAARoABQAAAAEAAABiARsABQAAAAEAAABqASgAAwAAAAEAAgAAATEAAgAAAB0AAAByATIAAgAAABQAAADvv73vv71pAAQAAAABAAAA77+9
Any thoughts? Thank you!