title: Displaying image returned with REST call
body: <p>I want to display the image of an item the user picks. When the user clicks on an item a rest call is made and an image is retrieved but I cannot display it.</p>
  <p>I have tried following the ideas from <a href="https://stackoverflow.com/questions/38080654/ionic-2-angular-2-images-prepended-with-unsafe-therefore-not-displaying-ev">here</a> and <a href="https://stackoverflow.com/questions/38324762/angular-2-render-byte-from-web-api-as-an-image-src">here</a> but cannot seem to get them to work.</p>
  <p>The basic principle (to my understanding) is that when the rest call response with (what is supposed to be) an image/png type I can format my image source in my TS like this:</p>
  <pre><code>import {DomSanitizer} from '@angular/platform-browser';
  constructor(private _DomSanitizationService: DomSanitizer ){}
  </code></pre>
  <p>...</p>
  <pre><code>this.showPage = &quot;data:image/png;base64,&quot; + rest_response;
  </code></pre>
  <p>then use &quot;DomSanitizer&quot; to enable this to be used in the html like this:</p>
  <pre><code>&lt;img [src]=&quot;_DomSanitizationService.bypassSecurityTrustUrl(showPage )&quot;&gt;
  </code></pre>
  <p>but when I try to use it the image is broken and when I inspect it I see:</p>
  <pre><code>src=&quot;data:image/png;base64,�PNG...,㘑��&quot; etc...
  </code></pre>
  <p>Why is this happening?</p>