Unsafe prepended on base64 image url, trying to use domsanitizer, but not working

Hi, I’m trying to load up an image I received from a get request in base64 form and I tried looking into it and it seems like the domSanitizer is the way to go.

<img [src]="_domSanitizer.bypassSecurityTrustUrl("data:image/gif;base64,R0lGODlhPQBEAPeoA......")">

but it shows up as

anyone know why it doesn’t load the image?

Anyone have an idea?

Whenever I interact with the DOMSanitizer, I store the sanitized SafeUrl in an object property and reference that from the template. I suspect doing it the way you are is silently converting it to a string and messing things up.