title: Load image from base64 encoded image in Gtk3+
body: <p><strong>The main problem is that, from what I could find, there is no easy/documented way to load an image from base64 encoded image.</strong> I use the following code to encode the image to base64 (so that I wouldn't need to include all the images with the source, nor should I create temp files and delete them at exit). The image format I use is <code>.png</code> which is supported in Gtk3+. (from <code>GdkPixbuf.Pixbuf.get_formats()</code> i have <code>['png']</code> in the results. I am really confused on how to use Gtk3+ for this purpose.</p>
  
  <pre><code>import base64
  image_name = 'image.png'
  image_loc = 'd:\\Home\\' + image_name
  
  with open(image_loc, 'rb') as image_file:
  encoded_string = base64.b64encode(image_file.read())
  
  print(encoded_string)
  </code></pre>
  
  <p>I want to use the output for example:</p>
  
  <pre><code>base64_data="""
          iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABsklEQVRYhe2XIVMCQRSAv2AwGAgEAuFmJBiMFmcMBH8AgUAgXHDMFww2gtFA
          IBicsRgNBgLBcS7yE4gEIsFgIBDO8Pa8x7FwB7cnxTfzyr637327b+/dLiTSBIbAHIgydAGMgAscyUOOpDZdAu2iyZsq4BcwAHpb9NE1xFAl
          P8s558klRFzzwQ5zejgsRxygVxBgbwiXAHtBuAaIIa7KBAgyACJgBlTKAqgBH8A0pWmIXKXYB2CbdFRM/xAA3qEBKipm8A9wCIAa8q/oUOJn
          6FTKAqgA10gZWkD9rwAugRfWm1IEfCKlKQ2ghdwrstp0vwyAuiX5HGnRMwtE1zVAfLPS6hubZ7HNgaorgFPkppxOEvcBG0AE3LoCuGZ1Zb7R
          hrGfqLGJ8h24ArhTcaYZvqHyDV0BtFWcGbLlHrJygCM1Nla+r5Cc0OcCAA3sNfaN3dtgDwDeSO5xzQIQthvRNoAlcA7yGFmowTFSmzz6jmwv
          rL6wYp0Yv7HFttKMusC3xSmP3qs4/ZxzJiTn41c85N032mEHQqQBHacWs+mFvTSQa8ldSxW4Qb7zEDntAabmWn4A0clKl9nNvDwAAAAASUVO
          RK5CYII
          """
  </code></pre>
  
  <p>And render the image from base64.</p>
  
  <p>As a side note, on <code>tkinter</code> this was easily done with:</p>
  
  <pre><code>tkinter.PhotoImage(data=base64_data)
  </code></pre>
  
  <p>And then display the image where you needed it.</p>
  
  <p>Getting back to Gtk3+, I didn't find a method of loading the image from base64. Even with <code>GdkPixbuf.Pixbuf.new_from_data</code>, I get a broken image. I have also tried with <code>Gio.MemoryInputStream.new_from_bytes</code>, but it says that the format of the image isn't supported. </p>