I can successfully get what appears to be the png data of a user image but am unable to get it to display in an img element. (Im getting the data by calling - https://graph.windows.net/{my tenant}/users/{my user}/thumbnailPhoto?api-version=1.6)
I have tried src="data:image/png;base64,{THE_DATA_HERE}" but that doesn't seem to work. (Pasting the data here - http://codebeautify.org/base64-to-image-converter didnt work either so apparently its not base64)
Any ideas on how to get this result to appear in an img? (This is being done in JavaScript - client side)
I'm using Angular 2 and have to pass the result through the DOM Sanitizer.bypassSecurityTrustUrl before it will apply it to the src so perhaps my code isn't quite right yet. Anybody have this working in any browser based client?
let image = btoa(response.thumbnailPhoto);
and thensrc="data:image/png;base64,{image}"
? – dlcardozobtoa(unescape(encodeURIComponent(response.thumbnailPhoto)))
I don't know if this will work with .png files. – dlcardozo